| 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 #ifndef V8_WASM_MODULE_H_ | 5 #ifndef V8_WASM_MODULE_H_ |
| 6 #define V8_WASM_MODULE_H_ | 6 #define V8_WASM_MODULE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/api.h" | 10 #include "src/api.h" |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 #define WCM_INIT_LARGE_NUMBER(IGNORE, NAME) \ | 435 #define WCM_INIT_LARGE_NUMBER(IGNORE, NAME) \ |
| 436 number = isolate->factory()->NewHeapNumber(0.0, MUTABLE, TENURED); \ | 436 number = isolate->factory()->NewHeapNumber(0.0, MUTABLE, TENURED); \ |
| 437 ret->set(kID_##NAME, *number); | 437 ret->set(kID_##NAME, *number); |
| 438 | 438 |
| 439 #define INITIALIZER(KIND, TYPE, NAME) WCM_INIT_##KIND(TYPE, NAME) | 439 #define INITIALIZER(KIND, TYPE, NAME) WCM_INIT_##KIND(TYPE, NAME) |
| 440 WCM_PROPERTY_TABLE(INITIALIZER) | 440 WCM_PROPERTY_TABLE(INITIALIZER) |
| 441 #undef INITIALIZER | 441 #undef INITIALIZER |
| 442 return handle(WasmCompiledModule::cast(*ret)); | 442 return handle(WasmCompiledModule::cast(*ret)); |
| 443 } | 443 } |
| 444 | 444 |
| 445 Handle<WasmCompiledModule> Clone(Isolate* isolate) { | 445 static Handle<WasmCompiledModule> Clone(Isolate* isolate, |
| 446 Handle<WasmCompiledModule> ret = handle(WasmCompiledModule::cast( | 446 Handle<WasmCompiledModule> module) { |
| 447 *isolate->factory()->CopyFixedArray(handle(this)))); | 447 Handle<WasmCompiledModule> ret = Handle<WasmCompiledModule>::cast( |
| 448 isolate->factory()->CopyFixedArray(module)); |
| 448 Handle<HeapNumber> number = | 449 Handle<HeapNumber> number = |
| 449 isolate->factory()->NewHeapNumber(0.0, MUTABLE, TENURED); | 450 isolate->factory()->NewHeapNumber(0.0, MUTABLE, TENURED); |
| 450 ret->set(kID_mem_size, *number); | 451 ret->set(kID_mem_size, *number); |
| 451 ret->set_mem_size(mem_size()); | 452 ret->set_mem_size(module->mem_size()); |
| 452 return ret; | 453 return ret; |
| 453 } | 454 } |
| 454 | 455 |
| 455 #define DECLARATION(KIND, TYPE, NAME) WCM_##KIND(TYPE, NAME) | 456 #define DECLARATION(KIND, TYPE, NAME) WCM_##KIND(TYPE, NAME) |
| 456 WCM_PROPERTY_TABLE(DECLARATION) | 457 WCM_PROPERTY_TABLE(DECLARATION) |
| 457 #undef DECLARATION | 458 #undef DECLARATION |
| 458 | 459 |
| 459 private: | 460 private: |
| 460 DISALLOW_IMPLICIT_CONSTRUCTORS(WasmCompiledModule); | 461 DISALLOW_IMPLICIT_CONSTRUCTORS(WasmCompiledModule); |
| 461 }; | 462 }; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 int instance_count); | 545 int instance_count); |
| 545 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); | 546 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); |
| 546 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); | 547 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); |
| 547 | 548 |
| 548 } // namespace testing | 549 } // namespace testing |
| 549 } // namespace wasm | 550 } // namespace wasm |
| 550 } // namespace internal | 551 } // namespace internal |
| 551 } // namespace v8 | 552 } // namespace v8 |
| 552 | 553 |
| 553 #endif // V8_WASM_MODULE_H_ | 554 #endif // V8_WASM_MODULE_H_ |
| OLD | NEW |