| 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/base/iterator.h" | 8 #include "src/base/iterator.h" |
| 9 #include "src/debug/debug-interface.h" | 9 #include "src/debug/debug-interface.h" |
| 10 #include "src/wasm/module-decoder.h" | 10 #include "src/wasm/module-decoder.h" |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 } | 730 } |
| 731 | 731 |
| 732 Handle<WasmCompiledModule> WasmCompiledModule::New( | 732 Handle<WasmCompiledModule> WasmCompiledModule::New( |
| 733 Isolate* isolate, Handle<WasmSharedModuleData> shared) { | 733 Isolate* isolate, Handle<WasmSharedModuleData> shared) { |
| 734 Handle<FixedArray> ret = | 734 Handle<FixedArray> ret = |
| 735 isolate->factory()->NewFixedArray(PropertyIndices::Count, TENURED); | 735 isolate->factory()->NewFixedArray(PropertyIndices::Count, TENURED); |
| 736 // WasmCompiledModule::cast would fail since fields are not set yet. | 736 // WasmCompiledModule::cast would fail since fields are not set yet. |
| 737 Handle<WasmCompiledModule> compiled_module( | 737 Handle<WasmCompiledModule> compiled_module( |
| 738 reinterpret_cast<WasmCompiledModule*>(*ret), isolate); | 738 reinterpret_cast<WasmCompiledModule*>(*ret), isolate); |
| 739 compiled_module->InitId(); | 739 compiled_module->InitId(); |
| 740 compiled_module->set_num_imported_functions(0); |
| 740 compiled_module->set_shared(shared); | 741 compiled_module->set_shared(shared); |
| 741 compiled_module->set_native_context(isolate->native_context()); | 742 compiled_module->set_native_context(isolate->native_context()); |
| 742 return compiled_module; | 743 return compiled_module; |
| 743 } | 744 } |
| 744 | 745 |
| 745 void WasmCompiledModule::InitId() { | 746 void WasmCompiledModule::InitId() { |
| 746 #if DEBUG | 747 #if DEBUG |
| 747 static uint32_t instance_id_counter = 0; | 748 static uint32_t instance_id_counter = 0; |
| 748 set(kID_instance_id, Smi::FromInt(instance_id_counter++)); | 749 set(kID_instance_id, Smi::FromInt(instance_id_counter++)); |
| 749 TRACE("New compiled module id: %d\n", instance_id()); | 750 TRACE("New compiled module id: %d\n", instance_id()); |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) | 1178 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) |
| 1178 return false; | 1179 return false; |
| 1179 return true; | 1180 return true; |
| 1180 } | 1181 } |
| 1181 | 1182 |
| 1182 void WasmInstanceWrapper::set_instance_object(Handle<JSObject> instance, | 1183 void WasmInstanceWrapper::set_instance_object(Handle<JSObject> instance, |
| 1183 Isolate* isolate) { | 1184 Isolate* isolate) { |
| 1184 Handle<WeakCell> cell = isolate->factory()->NewWeakCell(instance); | 1185 Handle<WeakCell> cell = isolate->factory()->NewWeakCell(instance); |
| 1185 set(kWrapperInstanceObject, *cell); | 1186 set(kWrapperInstanceObject, *cell); |
| 1186 } | 1187 } |
| OLD | NEW |