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

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

Issue 1581393003: Reland of [wasm] Add tests for JS wrappers to test-run-wasm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | src/wasm/wasm-js.h » ('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 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/compiler/wasm-compiler.h" 5 #include "src/compiler/wasm-compiler.h"
6 6
7 #include "src/isolate-inl.h" 7 #include "src/isolate-inl.h"
8 8
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 10
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 desc = Linkage::GetStubCallDescriptor(isolate, graph()->zone(), 1590 desc = Linkage::GetStubCallDescriptor(isolate, graph()->zone(),
1591 callable.descriptor(), wasm_count + 1, 1591 callable.descriptor(), wasm_count + 1,
1592 CallDescriptor::kNoFlags); 1592 CallDescriptor::kNoFlags);
1593 arg_count_before_args = true; 1593 arg_count_before_args = true;
1594 } 1594 }
1595 1595
1596 args[pos++] = jsgraph()->Constant(function); // JS function. 1596 args[pos++] = jsgraph()->Constant(function); // JS function.
1597 if (arg_count_before_args) { 1597 if (arg_count_before_args) {
1598 args[pos++] = jsgraph()->Int32Constant(wasm_count); // argument count 1598 args[pos++] = jsgraph()->Int32Constant(wasm_count); // argument count
1599 } 1599 }
1600 args[pos++] = jsgraph()->UndefinedConstant(); // JS receiver. 1600 // JS receiver.
1601 Handle<Object> global(function->context()->global_object(), isolate);
1602 args[pos++] = jsgraph()->Constant(global);
1601 1603
1602 // Convert WASM numbers to JS values. 1604 // Convert WASM numbers to JS values.
1603 for (int i = 0; i < wasm_count; i++) { 1605 for (int i = 0; i < wasm_count; i++) {
1604 Node* param = graph()->NewNode(jsgraph()->common()->Parameter(i), start); 1606 Node* param = graph()->NewNode(jsgraph()->common()->Parameter(i), start);
1605 args[pos++] = ToJS(param, context, sig->GetParam(i)); 1607 args[pos++] = ToJS(param, context, sig->GetParam(i));
1606 } 1608 }
1607 1609
1608 if (add_new_target_undefined) { 1610 if (add_new_target_undefined) {
1609 args[pos++] = jsgraph()->UndefinedConstant(); // new target 1611 args[pos++] = jsgraph()->UndefinedConstant(); // new target
1610 } 1612 }
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 code->Disassemble(buffer.start(), os); 2022 code->Disassemble(buffer.start(), os);
2021 } 2023 }
2022 #endif 2024 #endif
2023 return code; 2025 return code;
2024 } 2026 }
2025 2027
2026 2028
2027 } // namespace compiler 2029 } // namespace compiler
2028 } // namespace internal 2030 } // namespace internal
2029 } // namespace v8 2031 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-js.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698