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-natives.h" | 5 #include "src/api-natives.h" |
6 #include "src/api.h" | 6 #include "src/api.h" |
7 #include "src/asmjs/asm-wasm-builder.h" | 7 #include "src/asmjs/asm-wasm-builder.h" |
8 #include "src/asmjs/typing-asm.h" | 8 #include "src/asmjs/typing-asm.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 if (!info->scope()->declarations()->at(0)->IsFunctionDeclaration()) { | 144 if (!info->scope()->declarations()->at(0)->IsFunctionDeclaration()) { |
145 thrower->Error("Asm.js validation failed: non-function declaration"); | 145 thrower->Error("Asm.js validation failed: non-function declaration"); |
146 return nullptr; | 146 return nullptr; |
147 } | 147 } |
148 | 148 |
149 info->set_literal( | 149 info->set_literal( |
150 info->scope()->declarations()->at(0)->AsFunctionDeclaration()->fun()); | 150 info->scope()->declarations()->at(0)->AsFunctionDeclaration()->fun()); |
151 | 151 |
152 v8::internal::AsmTyper typer(info->isolate(), info->zone(), *(info->script()), | 152 v8::internal::wasm::AsmTyper typer(info->isolate(), info->zone(), |
153 info->literal()); | 153 *(info->script()), info->literal()); |
154 if (i::FLAG_enable_simd_asmjs) { | |
155 typer.set_allow_simd(true); | |
156 } | |
157 if (!typer.Validate()) { | 154 if (!typer.Validate()) { |
158 thrower->Error("Asm.js validation failed: %s", typer.error_message()); | 155 thrower->Error("Asm.js validation failed: %s", typer.error_message()); |
159 return nullptr; | 156 return nullptr; |
160 } | 157 } |
161 | 158 |
162 v8::internal::wasm::AsmWasmBuilder builder(info->isolate(), info->zone(), | 159 v8::internal::wasm::AsmWasmBuilder builder(info->isolate(), info->zone(), |
163 info->literal(), &typer); | 160 info->literal(), &typer); |
164 | 161 |
165 return builder.Run(foreign_args); | 162 return builder.Run(foreign_args); |
166 } | 163 } |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 int unused_property_fields = in_object_properties - pre_allocated; | 502 int unused_property_fields = in_object_properties - pre_allocated; |
506 Handle<Map> map = Map::CopyInitialMap( | 503 Handle<Map> map = Map::CopyInitialMap( |
507 prev_map, instance_size, in_object_properties, unused_property_fields); | 504 prev_map, instance_size, in_object_properties, unused_property_fields); |
508 | 505 |
509 context->set_wasm_function_map(*map); | 506 context->set_wasm_function_map(*map); |
510 } | 507 } |
511 } | 508 } |
512 | 509 |
513 } // namespace internal | 510 } // namespace internal |
514 } // namespace v8 | 511 } // namespace v8 |
OLD | NEW |