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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 REPLACE_RUNTIME_CALL(JSCreateCatchContext, Runtime::kPushCatchContext) | 104 REPLACE_RUNTIME_CALL(JSCreateCatchContext, Runtime::kPushCatchContext) |
105 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) | 105 REPLACE_RUNTIME_CALL(JSCreateWithContext, Runtime::kPushWithContext) |
106 REPLACE_RUNTIME_CALL(JSCreateBlockContext, Runtime::kPushBlockContext) | 106 REPLACE_RUNTIME_CALL(JSCreateBlockContext, Runtime::kPushBlockContext) |
107 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext) | 107 REPLACE_RUNTIME_CALL(JSCreateModuleContext, Runtime::kPushModuleContext) |
108 REPLACE_RUNTIME_CALL(JSCreateScriptContext, Runtime::kAbort) | 108 REPLACE_RUNTIME_CALL(JSCreateScriptContext, Runtime::kAbort) |
109 #undef REPLACE_RUNTIME | 109 #undef REPLACE_RUNTIME |
110 | 110 |
111 | 111 |
112 #define REPLACE_UNIMPLEMENTED(op) \ | 112 #define REPLACE_UNIMPLEMENTED(op) \ |
113 void JSGenericLowering::Lower##op(Node* node) { UNIMPLEMENTED(); } | 113 void JSGenericLowering::Lower##op(Node* node) { UNIMPLEMENTED(); } |
114 REPLACE_UNIMPLEMENTED(JSToName) | |
115 REPLACE_UNIMPLEMENTED(JSYield) | 114 REPLACE_UNIMPLEMENTED(JSYield) |
116 REPLACE_UNIMPLEMENTED(JSDebugger) | 115 REPLACE_UNIMPLEMENTED(JSDebugger) |
117 #undef REPLACE_UNIMPLEMENTED | 116 #undef REPLACE_UNIMPLEMENTED |
118 | 117 |
119 | 118 |
120 static CallDescriptor::Flags FlagsForNode(Node* node) { | 119 static CallDescriptor::Flags FlagsForNode(Node* node) { |
121 CallDescriptor::Flags result = CallDescriptor::kNoFlags; | 120 CallDescriptor::Flags result = CallDescriptor::kNoFlags; |
122 if (OperatorProperties::HasFrameStateInput(node->op())) { | 121 if (OperatorProperties::HasFrameStateInput(node->op())) { |
123 result |= CallDescriptor::kNeedsFrameState; | 122 result |= CallDescriptor::kNeedsFrameState; |
124 } | 123 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 Callable callable = CodeFactory::ToNumber(isolate()); | 233 Callable callable = CodeFactory::ToNumber(isolate()); |
235 ReplaceWithStubCall(node, callable, FlagsForNode(node)); | 234 ReplaceWithStubCall(node, callable, FlagsForNode(node)); |
236 } | 235 } |
237 | 236 |
238 | 237 |
239 void JSGenericLowering::LowerJSToString(Node* node) { | 238 void JSGenericLowering::LowerJSToString(Node* node) { |
240 ReplaceWithBuiltinCall(node, Builtins::TO_STRING, 1); | 239 ReplaceWithBuiltinCall(node, Builtins::TO_STRING, 1); |
241 } | 240 } |
242 | 241 |
243 | 242 |
| 243 void JSGenericLowering::LowerJSToName(Node* node) { |
| 244 ReplaceWithBuiltinCall(node, Builtins::TO_NAME, 1); |
| 245 } |
| 246 |
| 247 |
244 void JSGenericLowering::LowerJSToObject(Node* node) { | 248 void JSGenericLowering::LowerJSToObject(Node* node) { |
245 ReplaceWithBuiltinCall(node, Builtins::TO_OBJECT, 1); | 249 ReplaceWithBuiltinCall(node, Builtins::TO_OBJECT, 1); |
246 } | 250 } |
247 | 251 |
248 | 252 |
249 void JSGenericLowering::LowerJSLoadProperty(Node* node) { | 253 void JSGenericLowering::LowerJSLoadProperty(Node* node) { |
250 const LoadPropertyParameters& p = LoadPropertyParametersOf(node->op()); | 254 const LoadPropertyParameters& p = LoadPropertyParametersOf(node->op()); |
251 Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate()); | 255 Callable callable = CodeFactory::KeyedLoadICInOptimizedCode(isolate()); |
252 if (FLAG_vector_ics) { | 256 if (FLAG_vector_ics) { |
253 PatchInsertInput(node, 2, jsgraph()->SmiConstant(p.feedback().index())); | 257 PatchInsertInput(node, 2, jsgraph()->SmiConstant(p.feedback().index())); |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 | 423 |
420 | 424 |
421 void JSGenericLowering::LowerJSCallRuntime(Node* node) { | 425 void JSGenericLowering::LowerJSCallRuntime(Node* node) { |
422 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); | 426 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); |
423 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); | 427 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); |
424 } | 428 } |
425 | 429 |
426 } // namespace compiler | 430 } // namespace compiler |
427 } // namespace internal | 431 } // namespace internal |
428 } // namespace v8 | 432 } // namespace v8 |
OLD | NEW |