| 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 // We parse the module again directly from the module bytes, so | 795 // We parse the module again directly from the module bytes, so |
| 796 // the underlying storage must not be moved meanwhile. | 796 // the underlying storage must not be moved meanwhile. |
| 797 DisallowHeapAllocation no_allocation; | 797 DisallowHeapAllocation no_allocation; |
| 798 SeqOneByteString* module_bytes = shared->module_bytes(); | 798 SeqOneByteString* module_bytes = shared->module_bytes(); |
| 799 const byte* start = | 799 const byte* start = |
| 800 reinterpret_cast<const byte*>(module_bytes->GetCharsAddress()); | 800 reinterpret_cast<const byte*>(module_bytes->GetCharsAddress()); |
| 801 const byte* end = start + module_bytes->length(); | 801 const byte* end = start + module_bytes->length(); |
| 802 // TODO(titzer): remember the module origin in the compiled_module | 802 // TODO(titzer): remember the module origin in the compiled_module |
| 803 // For now, we assume serialized modules did not originate from asm.js. | 803 // For now, we assume serialized modules did not originate from asm.js. |
| 804 ModuleResult result = | 804 ModuleResult result = |
| 805 DecodeWasmModule(isolate, start, end, false, kWasmOrigin); | 805 SyncDecodeWasmModule(isolate, start, end, false, kWasmOrigin); |
| 806 CHECK(result.ok()); | 806 CHECK(result.ok()); |
| 807 CHECK_NOT_NULL(result.val); | 807 CHECK_NOT_NULL(result.val); |
| 808 // Take ownership of the WasmModule and immediately transfer it to the | 808 // Take ownership of the WasmModule and immediately transfer it to the |
| 809 // WasmModuleWrapper below. | 809 // WasmModuleWrapper below. |
| 810 module = result.val.release(); | 810 module = result.val.release(); |
| 811 } | 811 } |
| 812 | 812 |
| 813 Handle<WasmModuleWrapper> module_wrapper = | 813 Handle<WasmModuleWrapper> module_wrapper = |
| 814 WasmModuleWrapper::New(isolate, module); | 814 WasmModuleWrapper::New(isolate, module); |
| 815 | 815 |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 if (!array->get(kWrapperInstanceObject)->IsWeakCell()) return false; | 1578 if (!array->get(kWrapperInstanceObject)->IsWeakCell()) return false; |
| 1579 Isolate* isolate = array->GetIsolate(); | 1579 Isolate* isolate = array->GetIsolate(); |
| 1580 if (!array->get(kNextInstanceWrapper)->IsUndefined(isolate) && | 1580 if (!array->get(kNextInstanceWrapper)->IsUndefined(isolate) && |
| 1581 !array->get(kNextInstanceWrapper)->IsFixedArray()) | 1581 !array->get(kNextInstanceWrapper)->IsFixedArray()) |
| 1582 return false; | 1582 return false; |
| 1583 if (!array->get(kPreviousInstanceWrapper)->IsUndefined(isolate) && | 1583 if (!array->get(kPreviousInstanceWrapper)->IsUndefined(isolate) && |
| 1584 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) | 1584 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) |
| 1585 return false; | 1585 return false; |
| 1586 return true; | 1586 return true; |
| 1587 } | 1587 } |
| OLD | NEW |