OLD | NEW |
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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/graph-inl.h" | 8 #include "src/compiler/graph-inl.h" |
9 #include "src/compiler/js-generic-lowering.h" | 9 #include "src/compiler/js-generic-lowering.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 225 |
226 void JSGenericLowering::LowerJSToBoolean(Node* node) { | 226 void JSGenericLowering::LowerJSToBoolean(Node* node) { |
227 Callable callable = | 227 Callable callable = |
228 CodeFactory::ToBoolean(isolate(), ToBooleanStub::RESULT_AS_ODDBALL); | 228 CodeFactory::ToBoolean(isolate(), ToBooleanStub::RESULT_AS_ODDBALL); |
229 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); | 229 ReplaceWithStubCall(node, callable, CallDescriptor::kPatchableCallSite); |
230 } | 230 } |
231 | 231 |
232 | 232 |
233 void JSGenericLowering::LowerJSToNumber(Node* node) { | 233 void JSGenericLowering::LowerJSToNumber(Node* node) { |
234 Callable callable = CodeFactory::ToNumber(isolate()); | 234 Callable callable = CodeFactory::ToNumber(isolate()); |
235 // TODO(mstarzinger): Embedding the context this way prevents sharing of code | |
236 // across native contexts. | |
237 if (!info_context_constant_.is_set()) { | |
238 info_context_constant_.set(jsgraph()->HeapConstant(info()->context())); | |
239 } | |
240 node->ReplaceInput(1, info_context_constant_.get()); | |
241 ReplaceWithStubCall(node, callable, FlagsForNode(node)); | 235 ReplaceWithStubCall(node, callable, FlagsForNode(node)); |
242 } | 236 } |
243 | 237 |
244 | 238 |
245 void JSGenericLowering::LowerJSToString(Node* node) { | 239 void JSGenericLowering::LowerJSToString(Node* node) { |
246 ReplaceWithBuiltinCall(node, Builtins::TO_STRING, 1); | 240 ReplaceWithBuiltinCall(node, Builtins::TO_STRING, 1); |
247 } | 241 } |
248 | 242 |
249 | 243 |
250 void JSGenericLowering::LowerJSToObject(Node* node) { | 244 void JSGenericLowering::LowerJSToObject(Node* node) { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 419 |
426 | 420 |
427 void JSGenericLowering::LowerJSCallRuntime(Node* node) { | 421 void JSGenericLowering::LowerJSCallRuntime(Node* node) { |
428 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); | 422 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); |
429 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); | 423 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); |
430 } | 424 } |
431 | 425 |
432 } // namespace compiler | 426 } // namespace compiler |
433 } // namespace internal | 427 } // namespace internal |
434 } // namespace v8 | 428 } // namespace v8 |
OLD | NEW |