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" |
11 #include "src/assert-scope.h" | 11 #include "src/assert-scope.h" |
| 12 #include "src/compilation-info.h" |
12 #include "src/execution.h" | 13 #include "src/execution.h" |
13 #include "src/factory.h" | 14 #include "src/factory.h" |
14 #include "src/handles.h" | 15 #include "src/handles.h" |
15 #include "src/isolate.h" | 16 #include "src/isolate.h" |
16 #include "src/objects.h" | 17 #include "src/objects.h" |
17 #include "src/parsing/parse-info.h" | 18 #include "src/parsing/parse-info.h" |
18 | 19 |
19 #include "src/wasm/module-decoder.h" | 20 #include "src/wasm/module-decoder.h" |
20 #include "src/wasm/wasm-js.h" | 21 #include "src/wasm/wasm-js.h" |
21 #include "src/wasm/wasm-module-builder.h" | 22 #include "src/wasm/wasm-module-builder.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 STDLIB_MATH_CONST(SQRT1_2, 0.7071067811865476) | 154 STDLIB_MATH_CONST(SQRT1_2, 0.7071067811865476) |
154 STDLIB_MATH_CONST(SQRT2, 1.4142135623730951) | 155 STDLIB_MATH_CONST(SQRT2, 1.4142135623730951) |
155 #undef STDLIB_MATH_CONST | 156 #undef STDLIB_MATH_CONST |
156 default: { UNREACHABLE(); } | 157 default: { UNREACHABLE(); } |
157 } | 158 } |
158 return false; | 159 return false; |
159 } | 160 } |
160 | 161 |
161 } // namespace | 162 } // namespace |
162 | 163 |
163 MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(ParseInfo* info) { | 164 MaybeHandle<FixedArray> AsmJs::CompileAsmViaWasm(CompilationInfo* info) { |
164 ErrorThrower thrower(info->isolate(), "Asm.js -> WebAssembly conversion"); | 165 ErrorThrower thrower(info->isolate(), "Asm.js -> WebAssembly conversion"); |
165 base::ElapsedTimer asm_wasm_timer; | 166 base::ElapsedTimer asm_wasm_timer; |
166 asm_wasm_timer.Start(); | 167 asm_wasm_timer.Start(); |
167 wasm::AsmWasmBuilder builder(info->isolate(), info->zone(), | 168 wasm::AsmWasmBuilder builder(info); |
168 info->ast_value_factory(), info->script(), | |
169 info->literal()); | |
170 Handle<FixedArray> foreign_globals; | 169 Handle<FixedArray> foreign_globals; |
171 auto asm_wasm_result = builder.Run(&foreign_globals); | 170 auto asm_wasm_result = builder.Run(&foreign_globals); |
172 if (!asm_wasm_result.success) { | 171 if (!asm_wasm_result.success) { |
173 DCHECK(!info->isolate()->has_pending_exception()); | 172 DCHECK(!info->isolate()->has_pending_exception()); |
174 MessageHandler::ReportMessage(info->isolate(), | 173 MessageHandler::ReportMessage(info->isolate(), |
175 builder.typer()->message_location(), | 174 builder.typer()->message_location(), |
176 builder.typer()->error_message()); | 175 builder.typer()->error_message()); |
177 return MaybeHandle<FixedArray>(); | 176 return MaybeHandle<FixedArray>(); |
178 } | 177 } |
179 double asm_wasm_time = asm_wasm_timer.Elapsed().InMillisecondsF(); | 178 double asm_wasm_time = asm_wasm_timer.Elapsed().InMillisecondsF(); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 isolate, MessageTemplate::kAsmJsInstantiated, &location, stext, | 326 isolate, MessageTemplate::kAsmJsInstantiated, &location, stext, |
328 Handle<JSArray>::null()); | 327 Handle<JSArray>::null()); |
329 message->set_error_level(v8::Isolate::kMessageInfo); | 328 message->set_error_level(v8::Isolate::kMessageInfo); |
330 MessageHandler::ReportMessage(isolate, &location, message); | 329 MessageHandler::ReportMessage(isolate, &location, message); |
331 | 330 |
332 return module_object; | 331 return module_object; |
333 } | 332 } |
334 | 333 |
335 } // namespace internal | 334 } // namespace internal |
336 } // namespace v8 | 335 } // namespace v8 |
OLD | NEW |