OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/wasm/wasm-objects.h" | 5 #include "src/wasm/wasm-objects.h" |
6 #include "src/utils.h" | 6 #include "src/utils.h" |
7 | 7 |
8 #include "src/assembler-inl.h" | 8 #include "src/assembler-inl.h" |
9 #include "src/base/iterator.h" | 9 #include "src/base/iterator.h" |
10 #include "src/compiler/wasm-compiler.h" | 10 #include "src/compiler/wasm-compiler.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 auto table_obj = Handle<WasmTableObject>::cast( | 177 auto table_obj = Handle<WasmTableObject>::cast( |
178 isolate->factory()->NewJSObject(table_ctor)); | 178 isolate->factory()->NewJSObject(table_ctor)); |
179 | 179 |
180 *js_functions = isolate->factory()->NewFixedArray(initial); | 180 *js_functions = isolate->factory()->NewFixedArray(initial); |
181 Object* null = isolate->heap()->null_value(); | 181 Object* null = isolate->heap()->null_value(); |
182 for (int i = 0; i < static_cast<int>(initial); ++i) { | 182 for (int i = 0; i < static_cast<int>(initial); ++i) { |
183 (*js_functions)->set(i, null); | 183 (*js_functions)->set(i, null); |
184 } | 184 } |
185 table_obj->set_functions(**js_functions); | 185 table_obj->set_functions(**js_functions); |
186 DCHECK_EQ(maximum, static_cast<int>(maximum)); | 186 DCHECK_EQ(maximum, static_cast<int>(maximum)); |
187 table_obj->set_maximum_length(static_cast<int>(maximum)); | 187 Handle<Object> max = isolate->factory()->NewNumber(maximum); |
| 188 table_obj->set_maximum_length(*max); |
188 | 189 |
189 Handle<FixedArray> dispatch_tables = isolate->factory()->NewFixedArray(0); | 190 Handle<FixedArray> dispatch_tables = isolate->factory()->NewFixedArray(0); |
190 table_obj->set_dispatch_tables(*dispatch_tables); | 191 table_obj->set_dispatch_tables(*dispatch_tables); |
191 return Handle<WasmTableObject>::cast(table_obj); | 192 return Handle<WasmTableObject>::cast(table_obj); |
192 } | 193 } |
193 | 194 |
194 Handle<FixedArray> WasmTableObject::AddDispatchTable( | 195 Handle<FixedArray> WasmTableObject::AddDispatchTable( |
195 Isolate* isolate, Handle<WasmTableObject> table_obj, | 196 Isolate* isolate, Handle<WasmTableObject> table_obj, |
196 Handle<WasmInstanceObject> instance, int table_index, | 197 Handle<WasmInstanceObject> instance, int table_index, |
197 Handle<FixedArray> function_table, Handle<FixedArray> signature_table) { | 198 Handle<FixedArray> function_table, Handle<FixedArray> signature_table) { |
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 Isolate* isolate, Handle<WasmInstanceObject> instance, Handle<Code> caller, | 1377 Isolate* isolate, Handle<WasmInstanceObject> instance, Handle<Code> caller, |
1377 int offset, int func_index, bool patch_caller) { | 1378 int offset, int func_index, bool patch_caller) { |
1378 isolate->set_context(*instance->compiled_module()->native_context()); | 1379 isolate->set_context(*instance->compiled_module()->native_context()); |
1379 Object* orch_obj = | 1380 Object* orch_obj = |
1380 instance->compiled_module()->shared()->lazy_compilation_orchestrator(); | 1381 instance->compiled_module()->shared()->lazy_compilation_orchestrator(); |
1381 LazyCompilationOrchestrator* orch = | 1382 LazyCompilationOrchestrator* orch = |
1382 Managed<LazyCompilationOrchestrator>::cast(orch_obj)->get(); | 1383 Managed<LazyCompilationOrchestrator>::cast(orch_obj)->get(); |
1383 return orch->CompileLazy(isolate, instance, caller, offset, func_index, | 1384 return orch->CompileLazy(isolate, instance, caller, offset, func_index, |
1384 patch_caller); | 1385 patch_caller); |
1385 } | 1386 } |
OLD | NEW |