OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WASM_RUN_UTILS_H | 5 #ifndef WASM_RUN_UTILS_H |
6 #define WASM_RUN_UTILS_H | 6 #define WASM_RUN_UTILS_H |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 namespace { | 44 namespace { |
45 using namespace v8::base; | 45 using namespace v8::base; |
46 using namespace v8::internal; | 46 using namespace v8::internal; |
47 using namespace v8::internal::compiler; | 47 using namespace v8::internal::compiler; |
48 using namespace v8::internal::wasm; | 48 using namespace v8::internal::wasm; |
49 | 49 |
50 inline void init_env(FunctionEnv* env, FunctionSig* sig) { | 50 inline void init_env(FunctionEnv* env, FunctionSig* sig) { |
51 env->module = nullptr; | 51 env->module = nullptr; |
52 env->sig = sig; | 52 env->sig = sig; |
53 env->local_int32_count = 0; | 53 env->local_i32_count = 0; |
54 env->local_int64_count = 0; | 54 env->local_i64_count = 0; |
55 env->local_float32_count = 0; | 55 env->local_f32_count = 0; |
56 env->local_float64_count = 0; | 56 env->local_f64_count = 0; |
57 env->SumLocals(); | 57 env->SumLocals(); |
58 } | 58 } |
59 | 59 |
60 const uint32_t kMaxGlobalsSize = 128; | 60 const uint32_t kMaxGlobalsSize = 128; |
61 | 61 |
62 // A helper for module environments that adds the ability to allocate memory | 62 // A helper for module environments that adds the ability to allocate memory |
63 // and global variables. Contains a built-in {WasmModuleInstance}. | 63 // and global variables. Contains a built-in {WasmModuleInstance}. |
64 class TestingModule : public ModuleEnv { | 64 class TestingModule : public ModuleEnv { |
65 public: | 65 public: |
66 TestingModule() : instance_(nullptr), global_offset(0) { | 66 TestingModule() : instance_(nullptr), global_offset(0) { |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 if (p1 == MachineType::None()) return 1; | 407 if (p1 == MachineType::None()) return 1; |
408 if (p2 == MachineType::None()) return 2; | 408 if (p2 == MachineType::None()) return 2; |
409 if (p3 == MachineType::None()) return 3; | 409 if (p3 == MachineType::None()) return 3; |
410 return 4; | 410 return 4; |
411 } | 411 } |
412 }; | 412 }; |
413 | 413 |
414 } // namespace | 414 } // namespace |
415 | 415 |
416 #endif | 416 #endif |
OLD | NEW |