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/api.h" | 5 #include "src/api.h" |
6 #include "src/api-natives.h" | 6 #include "src/api-natives.h" |
7 #include "src/assert-scope.h" | 7 #include "src/assert-scope.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 if (result.val) delete result.val; | 125 if (result.val) delete result.val; |
126 } | 126 } |
127 | 127 |
128 | 128 |
129 v8::internal::wasm::WasmModuleIndex* TranslateAsmModule(i::ParseInfo* info) { | 129 v8::internal::wasm::WasmModuleIndex* TranslateAsmModule(i::ParseInfo* info) { |
130 info->set_global(); | 130 info->set_global(); |
131 info->set_lazy(false); | 131 info->set_lazy(false); |
132 info->set_allow_lazy_parsing(false); | 132 info->set_allow_lazy_parsing(false); |
133 info->set_toplevel(true); | 133 info->set_toplevel(true); |
134 | 134 |
135 CHECK(i::Compiler::ParseAndAnalyze(info)); | 135 if (!i::Compiler::ParseAndAnalyze(info)) { |
| 136 return nullptr; |
| 137 } |
| 138 |
136 info->set_literal( | 139 info->set_literal( |
137 info->scope()->declarations()->at(0)->AsFunctionDeclaration()->fun()); | 140 info->scope()->declarations()->at(0)->AsFunctionDeclaration()->fun()); |
138 | 141 |
139 v8::internal::AsmTyper typer(info->isolate(), info->zone(), *(info->script()), | 142 v8::internal::AsmTyper typer(info->isolate(), info->zone(), *(info->script()), |
140 info->literal()); | 143 info->literal()); |
141 if (!typer.Validate()) { | 144 if (!typer.Validate()) { |
142 return nullptr; | 145 return nullptr; |
143 } | 146 } |
144 | 147 |
145 auto module = v8::internal::wasm::AsmWasmBuilder( | 148 auto module = v8::internal::wasm::AsmWasmBuilder( |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 InstallFunc(isolate, wasm_object, "instantiateModule", InstantiateModule); | 328 InstallFunc(isolate, wasm_object, "instantiateModule", InstantiateModule); |
326 InstallFunc(isolate, wasm_object, "verifyModule", VerifyModule); | 329 InstallFunc(isolate, wasm_object, "verifyModule", VerifyModule); |
327 InstallFunc(isolate, wasm_object, "verifyFunction", VerifyFunction); | 330 InstallFunc(isolate, wasm_object, "verifyFunction", VerifyFunction); |
328 InstallFunc(isolate, wasm_object, "compileRun", CompileRun); | 331 InstallFunc(isolate, wasm_object, "compileRun", CompileRun); |
329 InstallFunc(isolate, wasm_object, "asmCompileRun", AsmCompileRun); | 332 InstallFunc(isolate, wasm_object, "asmCompileRun", AsmCompileRun); |
330 InstallFunc(isolate, wasm_object, "instantiateModuleFromAsm", | 333 InstallFunc(isolate, wasm_object, "instantiateModuleFromAsm", |
331 InstantiateModuleFromAsm); | 334 InstantiateModuleFromAsm); |
332 } | 335 } |
333 } // namespace internal | 336 } // namespace internal |
334 } // namespace v8 | 337 } // namespace v8 |
OLD | NEW |