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

Side by Side Diff: src/runtime/runtime-compiler.cc

Issue 2264913002: [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 3 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
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/asmjs/asm-js.h" 8 #include "src/asmjs/asm-js.h"
9 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h" 9 #include "src/compiler-dispatcher/optimizing-compile-dispatcher.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 DCHECK(function->is_compiled()); 80 DCHECK(function->is_compiled());
81 return function->code(); 81 return function->code();
82 } 82 }
83 83
84 RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) { 84 RUNTIME_FUNCTION(Runtime_InstantiateAsmJs) {
85 HandleScope scope(isolate); 85 HandleScope scope(isolate);
86 DCHECK_EQ(args.length(), 4); 86 DCHECK_EQ(args.length(), 4);
87 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); 87 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
88 88
89 Handle<JSReceiver> stdlib;
90 if (args[1]->IsJSReceiver()) {
91 stdlib = args.at<JSReceiver>(1);
92 }
89 Handle<JSObject> foreign; 93 Handle<JSObject> foreign;
90 if (args[2]->IsJSObject()) { 94 if (args[2]->IsJSObject()) {
91 foreign = args.at<i::JSObject>(2); 95 foreign = args.at<i::JSObject>(2);
92 } 96 }
93 Handle<JSArrayBuffer> memory; 97 Handle<JSArrayBuffer> memory;
94 if (args[3]->IsJSArrayBuffer()) { 98 if (args[3]->IsJSArrayBuffer()) {
95 memory = args.at<i::JSArrayBuffer>(3); 99 memory = args.at<i::JSArrayBuffer>(3);
96 } 100 }
97 if (args[1]->IsJSObject() && function->shared()->HasAsmWasmData() && 101 if (function->shared()->HasAsmWasmData() &&
98 AsmJs::IsStdlibValid(isolate, handle(function->shared()->asm_wasm_data()), 102 AsmJs::IsStdlibValid(isolate, handle(function->shared()->asm_wasm_data()),
99 args.at<JSReceiver>(1))) { 103 stdlib)) {
100 MaybeHandle<Object> result; 104 MaybeHandle<Object> result;
101 result = AsmJs::InstantiateAsmWasm( 105 result = AsmJs::InstantiateAsmWasm(
102 isolate, handle(function->shared()->asm_wasm_data()), memory, foreign); 106 isolate, handle(function->shared()->asm_wasm_data()), memory, foreign);
103 if (!result.is_null()) { 107 if (!result.is_null()) {
104 return *result.ToHandleChecked(); 108 return *result.ToHandleChecked();
105 } 109 }
106 } 110 }
107 // Remove wasm data, mark as broken for asm->wasm, 111 // Remove wasm data, mark as broken for asm->wasm,
108 // replace code with CompileLazy, and return a smi 0 to indicate failure. 112 // replace code with CompileLazy, and return a smi 0 to indicate failure.
109 if (function->shared()->HasAsmWasmData()) { 113 if (function->shared()->HasAsmWasmData()) {
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 DCHECK(is_valid_language_mode(args.smi_at(3))); 448 DCHECK(is_valid_language_mode(args.smi_at(3)));
445 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); 449 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3));
446 DCHECK(args[4]->IsSmi()); 450 DCHECK(args[4]->IsSmi());
447 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), 451 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(),
448 isolate); 452 isolate);
449 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, 453 return CompileGlobalEval(isolate, args.at<String>(1), outer_info,
450 language_mode, args.smi_at(4), args.smi_at(5)); 454 language_mode, args.smi_at(4), args.smi_at(5));
451 } 455 }
452 } // namespace internal 456 } // namespace internal
453 } // namespace v8 457 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698