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

Side by Side Diff: src/compiler/js-intrinsic-lowering.cc

Issue 1266013006: [stubs] Unify (and optimize) implementation of ToObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing support for %_ToObject in TurboFan and Crankshaft. Created 5 years, 4 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/compiler/js-intrinsic-lowering.h ('k') | src/compiler/linkage.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 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/js-intrinsic-lowering.h" 5 #include "src/compiler/js-intrinsic-lowering.h"
6 6
7 #include <stack> 7 #include <stack>
8 8
9 #include "src/compiler/access-builder.h" 9 #include "src/compiler/access-builder.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 case Runtime::kInlineIsMinusZero: 87 case Runtime::kInlineIsMinusZero:
88 return ReduceIsMinusZero(node); 88 return ReduceIsMinusZero(node);
89 case Runtime::kInlineFixedArrayGet: 89 case Runtime::kInlineFixedArrayGet:
90 return ReduceFixedArrayGet(node); 90 return ReduceFixedArrayGet(node);
91 case Runtime::kInlineFixedArraySet: 91 case Runtime::kInlineFixedArraySet:
92 return ReduceFixedArraySet(node); 92 return ReduceFixedArraySet(node);
93 case Runtime::kInlineGetTypeFeedbackVector: 93 case Runtime::kInlineGetTypeFeedbackVector:
94 return ReduceGetTypeFeedbackVector(node); 94 return ReduceGetTypeFeedbackVector(node);
95 case Runtime::kInlineGetCallerJSFunction: 95 case Runtime::kInlineGetCallerJSFunction:
96 return ReduceGetCallerJSFunction(node); 96 return ReduceGetCallerJSFunction(node);
97 case Runtime::kInlineToObject:
98 return ReduceToObject(node);
97 case Runtime::kInlineThrowNotDateError: 99 case Runtime::kInlineThrowNotDateError:
98 return ReduceThrowNotDateError(node); 100 return ReduceThrowNotDateError(node);
99 case Runtime::kInlineCallFunction: 101 case Runtime::kInlineCallFunction:
100 return ReduceCallFunction(node); 102 return ReduceCallFunction(node);
101 default: 103 default:
102 break; 104 break;
103 } 105 }
104 return NoChange(); 106 return NoChange();
105 } 107 }
106 108
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 Node* deoptimize = 523 Node* deoptimize =
522 graph()->NewNode(common()->Deoptimize(), frame_state, effect, control); 524 graph()->NewNode(common()->Deoptimize(), frame_state, effect, control);
523 NodeProperties::MergeControlToEnd(graph(), common(), deoptimize); 525 NodeProperties::MergeControlToEnd(graph(), common(), deoptimize);
524 526
525 node->set_op(common()->Dead()); 527 node->set_op(common()->Dead());
526 node->TrimInputCount(0); 528 node->TrimInputCount(0);
527 return Changed(node); 529 return Changed(node);
528 } 530 }
529 531
530 532
533 Reduction JSIntrinsicLowering::ReduceToObject(Node* node) {
534 node->set_op(javascript()->ToObject());
535 return Changed(node);
536 }
537
538
531 Reduction JSIntrinsicLowering::ReduceCallFunction(Node* node) { 539 Reduction JSIntrinsicLowering::ReduceCallFunction(Node* node) {
532 CallRuntimeParameters params = OpParameter<CallRuntimeParameters>(node->op()); 540 CallRuntimeParameters params = OpParameter<CallRuntimeParameters>(node->op());
533 size_t arity = params.arity(); 541 size_t arity = params.arity();
534 node->set_op(javascript()->CallFunction(arity, NO_CALL_FUNCTION_FLAGS, STRICT, 542 node->set_op(javascript()->CallFunction(arity, NO_CALL_FUNCTION_FLAGS, STRICT,
535 VectorSlotPair(), ALLOW_TAIL_CALLS)); 543 VectorSlotPair(), ALLOW_TAIL_CALLS));
536 Node* function = node->InputAt(static_cast<int>(arity - 1)); 544 Node* function = node->InputAt(static_cast<int>(arity - 1));
537 while (--arity != 0) { 545 while (--arity != 0) {
538 node->ReplaceInput(static_cast<int>(arity), 546 node->ReplaceInput(static_cast<int>(arity),
539 node->InputAt(static_cast<int>(arity - 1))); 547 node->InputAt(static_cast<int>(arity - 1)));
540 } 548 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 } 605 }
598 606
599 607
600 MachineOperatorBuilder* JSIntrinsicLowering::machine() const { 608 MachineOperatorBuilder* JSIntrinsicLowering::machine() const {
601 return jsgraph()->machine(); 609 return jsgraph()->machine();
602 } 610 }
603 611
604 } // namespace compiler 612 } // namespace compiler
605 } // namespace internal 613 } // namespace internal
606 } // namespace v8 614 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-intrinsic-lowering.h ('k') | src/compiler/linkage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698