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/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/elapsed-timer.h" | 9 #include "src/base/platform/elapsed-timer.h" |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2098 UNREACHABLE(); | 2098 UNREACHABLE(); |
2099 return nullptr; | 2099 return nullptr; |
2100 } | 2100 } |
2101 } | 2101 } |
2102 | 2102 |
2103 Node* WasmGraphBuilder::BuildJavaScriptToNumber(Node* node, Node* context, | 2103 Node* WasmGraphBuilder::BuildJavaScriptToNumber(Node* node, Node* context, |
2104 Node* effect, Node* control) { | 2104 Node* effect, Node* control) { |
2105 Callable callable = CodeFactory::ToNumber(jsgraph()->isolate()); | 2105 Callable callable = CodeFactory::ToNumber(jsgraph()->isolate()); |
2106 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 2106 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
2107 jsgraph()->isolate(), jsgraph()->zone(), callable.descriptor(), 0, | 2107 jsgraph()->isolate(), jsgraph()->zone(), callable.descriptor(), 0, |
2108 CallDescriptor::kNeedsFrameState, Operator::kNoProperties); | 2108 CallDescriptor::kNoFlags, Operator::kNoProperties); |
2109 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 2109 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
2110 | 2110 |
2111 Node* result = | 2111 Node* result = graph()->NewNode(jsgraph()->common()->Call(desc), stub_code, |
2112 graph()->NewNode(jsgraph()->common()->Call(desc), stub_code, node, | 2112 node, context, effect, control); |
2113 context, jsgraph()->EmptyFrameState(), effect, control); | |
2114 | 2113 |
2115 *control_ = result; | 2114 *control_ = result; |
2116 *effect_ = result; | 2115 *effect_ = result; |
2117 | 2116 |
2118 return result; | 2117 return result; |
2119 } | 2118 } |
2120 | 2119 |
2121 Node* WasmGraphBuilder::FromJS(Node* node, Node* context, | 2120 Node* WasmGraphBuilder::FromJS(Node* node, Node* context, |
2122 wasm::LocalType type) { | 2121 wasm::LocalType type) { |
2123 // Do a JavaScript ToNumber. | 2122 // Do a JavaScript ToNumber. |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2792 // TODO(bradnelson): Improve histogram handling of size_t. | 2791 // TODO(bradnelson): Improve histogram handling of size_t. |
2793 isolate->counters()->wasm_compile_function_peak_memory_bytes()->AddSample( | 2792 isolate->counters()->wasm_compile_function_peak_memory_bytes()->AddSample( |
2794 static_cast<int>(zone.allocation_size())); | 2793 static_cast<int>(zone.allocation_size())); |
2795 return code; | 2794 return code; |
2796 } | 2795 } |
2797 | 2796 |
2798 | 2797 |
2799 } // namespace compiler | 2798 } // namespace compiler |
2800 } // namespace internal | 2799 } // namespace internal |
2801 } // namespace v8 | 2800 } // namespace v8 |
OLD | NEW |