Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: src/wasm/wasm-js.cc

Issue 1702293002: Add asm.js stdlib portion implementable as wasm opcodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixes Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 v8::internal::AsmTyper typer(info->isolate(), info->zone(), *(info->script()), 116 v8::internal::AsmTyper typer(info->isolate(), info->zone(), *(info->script()),
117 info->literal()); 117 info->literal());
118 if (i::FLAG_enable_simd_asmjs) { 118 if (i::FLAG_enable_simd_asmjs) {
119 typer.set_allow_simd(true); 119 typer.set_allow_simd(true);
120 } 120 }
121 if (!typer.Validate()) { 121 if (!typer.Validate()) {
122 thrower->Error("Asm.js validation failed: %s", typer.error_message()); 122 thrower->Error("Asm.js validation failed: %s", typer.error_message());
123 return nullptr; 123 return nullptr;
124 } 124 }
125 125
126 auto module = v8::internal::wasm::AsmWasmBuilder( 126 auto module =
127 info->isolate(), info->zone(), info->literal(), foreign) 127 v8::internal::wasm::AsmWasmBuilder(info->isolate(), info->zone(),
128 .Run(); 128 info->literal(), foreign, &typer)
129 .Run();
129 130
130 if (i::FLAG_dump_asmjs_wasm) { 131 if (i::FLAG_dump_asmjs_wasm) {
131 FILE* wasm_file = fopen(i::FLAG_asmjs_wasm_dumpfile, "wb"); 132 FILE* wasm_file = fopen(i::FLAG_asmjs_wasm_dumpfile, "wb");
132 if (wasm_file) { 133 if (wasm_file) {
133 fwrite(module->Begin(), module->End() - module->Begin(), 1, wasm_file); 134 fwrite(module->Begin(), module->End() - module->Begin(), 1, wasm_file);
134 fclose(wasm_file); 135 fclose(wasm_file);
135 } 136 }
136 } 137 }
137 138
138 return module; 139 return module;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 if (!context->get(Context::WASM_FUNCTION_MAP_INDEX)->IsMap()) { 283 if (!context->get(Context::WASM_FUNCTION_MAP_INDEX)->IsMap()) {
283 Handle<Map> wasm_function_map = isolate->factory()->NewMap( 284 Handle<Map> wasm_function_map = isolate->factory()->NewMap(
284 JS_FUNCTION_TYPE, JSFunction::kSize + kPointerSize); 285 JS_FUNCTION_TYPE, JSFunction::kSize + kPointerSize);
285 wasm_function_map->set_is_callable(); 286 wasm_function_map->set_is_callable();
286 context->set_wasm_function_map(*wasm_function_map); 287 context->set_wasm_function_map(*wasm_function_map);
287 } 288 }
288 } 289 }
289 290
290 } // namespace internal 291 } // namespace internal
291 } // namespace v8 292 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698