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/asmjs/asm-js.h" | 5 #include "src/asmjs/asm-js.h" |
6 | 6 |
7 #include "src/api-natives.h" | 7 #include "src/api-natives.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/asmjs/asm-typer.h" | 9 #include "src/asmjs/asm-typer.h" |
10 #include "src/asmjs/asm-wasm-builder.h" | 10 #include "src/asmjs/asm-wasm-builder.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 i::Zone zone(isolate->allocator()); | 41 i::Zone zone(isolate->allocator()); |
42 internal::wasm::ModuleResult result = internal::wasm::DecodeWasmModule( | 42 internal::wasm::ModuleResult result = internal::wasm::DecodeWasmModule( |
43 isolate, &zone, start, end, false, origin); | 43 isolate, &zone, start, end, false, origin); |
44 | 44 |
45 i::MaybeHandle<i::FixedArray> compiled_module; | 45 i::MaybeHandle<i::FixedArray> compiled_module; |
46 if (result.failed() && origin == internal::wasm::kAsmJsOrigin) { | 46 if (result.failed() && origin == internal::wasm::kAsmJsOrigin) { |
47 thrower->Error("Asm.js converted module failed to decode"); | 47 thrower->Error("Asm.js converted module failed to decode"); |
48 } else if (result.failed()) { | 48 } else if (result.failed()) { |
49 thrower->Failed("", result); | 49 thrower->Failed("", result); |
50 } else { | 50 } else { |
51 compiled_module = result.val->CompileFunctions(isolate); | 51 compiled_module = result.val->CompileFunctions(isolate, thrower); |
52 } | 52 } |
53 | 53 |
54 if (result.val) delete result.val; | 54 if (result.val) delete result.val; |
55 return compiled_module; | 55 return compiled_module; |
56 } | 56 } |
57 | 57 |
58 } // namespace | 58 } // namespace |
59 | 59 |
60 MaybeHandle<FixedArray> AsmJs::ConvertAsmToWasm(ParseInfo* info) { | 60 MaybeHandle<FixedArray> AsmJs::ConvertAsmToWasm(ParseInfo* info) { |
61 ErrorThrower thrower(info->isolate(), "Asm.js -> WebAssembly conversion"); | 61 ErrorThrower thrower(info->isolate(), "Asm.js -> WebAssembly conversion"); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if (retval.is_null()) { | 132 if (retval.is_null()) { |
133 thrower.Error( | 133 thrower.Error( |
134 "WASM.instantiateModuleFromAsm(): foreign init function failed"); | 134 "WASM.instantiateModuleFromAsm(): foreign init function failed"); |
135 return MaybeHandle<Object>(); | 135 return MaybeHandle<Object>(); |
136 } | 136 } |
137 return maybe_module_object; | 137 return maybe_module_object; |
138 } | 138 } |
139 | 139 |
140 } // namespace internal | 140 } // namespace internal |
141 } // namespace v8 | 141 } // namespace v8 |
OLD | NEW |