| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 if (!i::Compiler::ParseAndAnalyze(info)) { | 135 if (!i::Compiler::ParseAndAnalyze(info)) { |
| 136 return nullptr; | 136 return nullptr; |
| 137 } | 137 } |
| 138 | 138 |
| 139 info->set_literal( | 139 info->set_literal( |
| 140 info->scope()->declarations()->at(0)->AsFunctionDeclaration()->fun()); | 140 info->scope()->declarations()->at(0)->AsFunctionDeclaration()->fun()); |
| 141 | 141 |
| 142 v8::internal::AsmTyper typer(info->isolate(), info->zone(), *(info->script()), | 142 v8::internal::AsmTyper typer(info->isolate(), info->zone(), *(info->script()), |
| 143 info->literal()); | 143 info->literal()); |
| 144 if (i::FLAG_enable_simd_asmjs) { |
| 145 typer.set_allow_simd(true); |
| 146 } |
| 144 if (!typer.Validate()) { | 147 if (!typer.Validate()) { |
| 145 thrower->Error("Asm.js validation failed: %s", typer.error_message()); | 148 thrower->Error("Asm.js validation failed: %s", typer.error_message()); |
| 146 return nullptr; | 149 return nullptr; |
| 147 } | 150 } |
| 148 | 151 |
| 149 auto module = v8::internal::wasm::AsmWasmBuilder( | 152 auto module = v8::internal::wasm::AsmWasmBuilder( |
| 150 info->isolate(), info->zone(), info->literal()) | 153 info->isolate(), info->zone(), info->literal()) |
| 151 .Run(); | 154 .Run(); |
| 152 return module; | 155 return module; |
| 153 } | 156 } |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 if (!context->get(Context::WASM_FUNCTION_MAP_INDEX)->IsMap()) { | 326 if (!context->get(Context::WASM_FUNCTION_MAP_INDEX)->IsMap()) { |
| 324 Handle<Map> wasm_function_map = isolate->factory()->NewMap( | 327 Handle<Map> wasm_function_map = isolate->factory()->NewMap( |
| 325 JS_FUNCTION_TYPE, JSFunction::kSize + kPointerSize); | 328 JS_FUNCTION_TYPE, JSFunction::kSize + kPointerSize); |
| 326 wasm_function_map->set_is_callable(); | 329 wasm_function_map->set_is_callable(); |
| 327 context->set_wasm_function_map(*wasm_function_map); | 330 context->set_wasm_function_map(*wasm_function_map); |
| 328 } | 331 } |
| 329 } | 332 } |
| 330 | 333 |
| 331 } // namespace internal | 334 } // namespace internal |
| 332 } // namespace v8 | 335 } // namespace v8 |
| OLD | NEW |