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