mirror of
https://github.com/open-goal/jak-project.git
synced 2025-02-17 12:40:04 +00:00
[compiler] add psize-of
(#564)
This commit is contained in:
parent
698d96cc4e
commit
63821755e6
@ -557,6 +557,7 @@ class Compiler {
|
||||
Val* compile_none(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
Val* compile_defenum(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
Val* compile_size_of(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
Val* compile_psize_of(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
};
|
||||
|
||||
extern const std::unordered_map<
|
||||
|
@ -174,6 +174,7 @@ const std::unordered_map<
|
||||
{"declare-type", &Compiler::compile_declare_type},
|
||||
{"none", &Compiler::compile_none},
|
||||
{"size-of", &Compiler::compile_size_of},
|
||||
{"psize-of", &Compiler::compile_psize_of},
|
||||
|
||||
// LAMBDA
|
||||
{"lambda", &Compiler::compile_lambda},
|
||||
|
@ -1260,3 +1260,7 @@ int Compiler::get_size_for_size_of(const goos::Object& form, const goos::Object&
|
||||
Val* Compiler::compile_size_of(const goos::Object& form, const goos::Object& rest, Env* env) {
|
||||
return compile_integer(get_size_for_size_of(form, rest), env);
|
||||
}
|
||||
|
||||
Val* Compiler::compile_psize_of(const goos::Object& form, const goos::Object& rest, Env* env) {
|
||||
return compile_integer((get_size_for_size_of(form, rest) + 0xf) & ~0xf, env);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user