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

Side by Side Diff: src/arm/lithium-arm.h

Issue 6577036: [Isolates] Merge from bleeding_edge to isolates, revisions 6100-6300. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm/lithium-arm.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution. 11 // with the distribution.
(...skipping 11 matching lines...) Expand all
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_ARM_LITHIUM_ARM_H_ 28 #ifndef V8_ARM_LITHIUM_ARM_H_
29 #define V8_ARM_LITHIUM_ARM_H_ 29 #define V8_ARM_LITHIUM_ARM_H_
30 30
31 #include "hydrogen.h" 31 #include "hydrogen.h"
32 #include "lithium-allocator.h" 32 #include "lithium-allocator.h"
33 #include "lithium.h"
33 #include "safepoint-table.h" 34 #include "safepoint-table.h"
34 35
35 namespace v8 { 36 namespace v8 {
36 namespace internal { 37 namespace internal {
37 38
38 // Forward declarations. 39 // Forward declarations.
39 class LCodeGen; 40 class LCodeGen;
40 class LEnvironment;
41 class Translation;
42 41
43 42
44 // Type hierarchy: 43 // Type hierarchy:
45 // 44 //
46 // LInstruction 45 // LInstruction
47 // LAccessArgumentsAt 46 // LAccessArgumentsAt
48 // LArgumentsElements 47 // LArgumentsElements
49 // LArgumentsLength 48 // LArgumentsLength
50 // LBinaryOperation 49 // LBinaryOperation
51 // LAddI 50 // LAddI
52 // LApplyArguments 51 // LApplyArguments
53 // LArithmeticD 52 // LArithmeticD
54 // LArithmeticT 53 // LArithmeticT
55 // LBitI 54 // LBitI
56 // LBoundsCheck 55 // LBoundsCheck
57 // LCmpID 56 // LCmpID
58 // LCmpIDAndBranch 57 // LCmpIDAndBranch
59 // LCmpJSObjectEq 58 // LCmpJSObjectEq
60 // LCmpJSObjectEqAndBranch 59 // LCmpJSObjectEqAndBranch
61 // LCmpT 60 // LCmpT
62 // LDivI 61 // LDivI
63 // LInstanceOf 62 // LInstanceOf
64 // LInstanceOfAndBranch 63 // LInstanceOfAndBranch
64 // LInstanceOfKnownGlobal
65 // LLoadKeyedFastElement 65 // LLoadKeyedFastElement
66 // LLoadKeyedGeneric 66 // LLoadKeyedGeneric
67 // LModI 67 // LModI
68 // LMulI 68 // LMulI
69 // LShiftI 69 // LShiftI
70 // LSubI 70 // LSubI
71 // LCallConstantFunction 71 // LCallConstantFunction
72 // LCallFunction 72 // LCallFunction
73 // LCallGlobal 73 // LCallGlobal
74 // LCallKeyed 74 // LCallKeyed
75 // LCallKnownGlobal 75 // LCallKnownGlobal
76 // LCallNamed 76 // LCallNamed
77 // LCallRuntime 77 // LCallRuntime
78 // LCallStub 78 // LCallStub
79 // LCheckPrototypeMaps
79 // LConstant 80 // LConstant
80 // LConstantD 81 // LConstantD
81 // LConstantI 82 // LConstantI
82 // LConstantT 83 // LConstantT
83 // LDeoptimize 84 // LDeoptimize
84 // LFunctionLiteral 85 // LFunctionLiteral
85 // LGlobalObject 86 // LGlobalObject
86 // LGlobalReceiver 87 // LGlobalReceiver
87 // LLabel 88 // LLabel
88 // LLayzBailout 89 // LLayzBailout
89 // LLoadGlobal 90 // LLoadGlobal
90 // LMaterializedLiteral 91 // LMaterializedLiteral
91 // LArrayLiteral 92 // LArrayLiteral
92 // LObjectLiteral 93 // LObjectLiteral
93 // LRegExpLiteral 94 // LRegExpLiteral
94 // LOsrEntry 95 // LOsrEntry
95 // LParameter 96 // LParameter
96 // LStackCheck 97 // LStackCheck
97 // LStoreKeyed 98 // LStoreKeyed
98 // LStoreKeyedFastElement 99 // LStoreKeyedFastElement
99 // LStoreKeyedGeneric 100 // LStoreKeyedGeneric
100 // LStoreNamed 101 // LStoreNamed
101 // LStoreNamedField 102 // LStoreNamedField
102 // LStoreNamedGeneric 103 // LStoreNamedGeneric
103 // LUnaryOperation 104 // LUnaryOperation
104 // LArrayLength 105 // LJSArrayLength
106 // LFixedArrayLength
105 // LBitNotI 107 // LBitNotI
106 // LBranch 108 // LBranch
107 // LCallNew 109 // LCallNew
108 // LCheckFunction 110 // LCheckFunction
109 // LCheckInstanceType 111 // LCheckInstanceType
110 // LCheckMap 112 // LCheckMap
111 // LCheckPrototypeMaps
112 // LCheckSmi 113 // LCheckSmi
113 // LClassOfTest 114 // LClassOfTest
114 // LClassOfTestAndBranch 115 // LClassOfTestAndBranch
115 // LDeleteProperty 116 // LDeleteProperty
116 // LDoubleToI 117 // LDoubleToI
117 // LHasCachedArrayIndex 118 // LHasCachedArrayIndex
118 // LHasCachedArrayIndexAndBranch 119 // LHasCachedArrayIndexAndBranch
119 // LHasInstanceType 120 // LHasInstanceType
120 // LHasInstanceTypeAndBranch 121 // LHasInstanceTypeAndBranch
121 // LInteger32ToDouble 122 // LInteger32ToDouble
122 // LIsNull 123 // LIsNull
123 // LIsNullAndBranch 124 // LIsNullAndBranch
124 // LIsObject 125 // LIsObject
125 // LIsObjectAndBranch 126 // LIsObjectAndBranch
126 // LIsSmi 127 // LIsSmi
127 // LIsSmiAndBranch 128 // LIsSmiAndBranch
128 // LLoadNamedField 129 // LLoadNamedField
129 // LLoadNamedGeneric 130 // LLoadNamedGeneric
131 // LLoadFunctionPrototype
130 // LNumberTagD 132 // LNumberTagD
131 // LNumberTagI 133 // LNumberTagI
132 // LPushArgument 134 // LPushArgument
133 // LReturn 135 // LReturn
134 // LSmiTag 136 // LSmiTag
135 // LStoreGlobal 137 // LStoreGlobal
136 // LTaggedToI 138 // LTaggedToI
137 // LThrow 139 // LThrow
138 // LTypeof 140 // LTypeof
139 // LTypeofIs 141 // LTypeofIs
(...skipping 14 matching lines...) Expand all
154 156
155 157
156 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ 158 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
157 V(AccessArgumentsAt) \ 159 V(AccessArgumentsAt) \
158 V(AddI) \ 160 V(AddI) \
159 V(ApplyArguments) \ 161 V(ApplyArguments) \
160 V(ArgumentsElements) \ 162 V(ArgumentsElements) \
161 V(ArgumentsLength) \ 163 V(ArgumentsLength) \
162 V(ArithmeticD) \ 164 V(ArithmeticD) \
163 V(ArithmeticT) \ 165 V(ArithmeticT) \
164 V(ArrayLength) \
165 V(ArrayLiteral) \ 166 V(ArrayLiteral) \
166 V(BitI) \ 167 V(BitI) \
167 V(BitNotI) \ 168 V(BitNotI) \
168 V(BoundsCheck) \ 169 V(BoundsCheck) \
169 V(Branch) \ 170 V(Branch) \
170 V(CallConstantFunction) \ 171 V(CallConstantFunction) \
171 V(CallFunction) \ 172 V(CallFunction) \
172 V(CallGlobal) \ 173 V(CallGlobal) \
173 V(CallKeyed) \ 174 V(CallKeyed) \
174 V(CallKnownGlobal) \ 175 V(CallKnownGlobal) \
(...skipping 13 matching lines...) Expand all
188 V(CmpMapAndBranch) \ 189 V(CmpMapAndBranch) \
189 V(CmpT) \ 190 V(CmpT) \
190 V(CmpTAndBranch) \ 191 V(CmpTAndBranch) \
191 V(ConstantD) \ 192 V(ConstantD) \
192 V(ConstantI) \ 193 V(ConstantI) \
193 V(ConstantT) \ 194 V(ConstantT) \
194 V(DeleteProperty) \ 195 V(DeleteProperty) \
195 V(Deoptimize) \ 196 V(Deoptimize) \
196 V(DivI) \ 197 V(DivI) \
197 V(DoubleToI) \ 198 V(DoubleToI) \
199 V(FixedArrayLength) \
198 V(FunctionLiteral) \ 200 V(FunctionLiteral) \
199 V(Gap) \ 201 V(Gap) \
200 V(GlobalObject) \ 202 V(GlobalObject) \
201 V(GlobalReceiver) \ 203 V(GlobalReceiver) \
202 V(Goto) \ 204 V(Goto) \
203 V(InstanceOf) \ 205 V(InstanceOf) \
204 V(InstanceOfAndBranch) \ 206 V(InstanceOfAndBranch) \
207 V(InstanceOfKnownGlobal) \
205 V(Integer32ToDouble) \ 208 V(Integer32ToDouble) \
206 V(IsNull) \ 209 V(IsNull) \
207 V(IsNullAndBranch) \ 210 V(IsNullAndBranch) \
208 V(IsObject) \ 211 V(IsObject) \
209 V(IsObjectAndBranch) \ 212 V(IsObjectAndBranch) \
210 V(IsSmi) \ 213 V(IsSmi) \
211 V(IsSmiAndBranch) \ 214 V(IsSmiAndBranch) \
215 V(JSArrayLength) \
212 V(HasInstanceType) \ 216 V(HasInstanceType) \
213 V(HasInstanceTypeAndBranch) \ 217 V(HasInstanceTypeAndBranch) \
214 V(HasCachedArrayIndex) \ 218 V(HasCachedArrayIndex) \
215 V(HasCachedArrayIndexAndBranch) \ 219 V(HasCachedArrayIndexAndBranch) \
216 V(ClassOfTest) \ 220 V(ClassOfTest) \
217 V(ClassOfTestAndBranch) \ 221 V(ClassOfTestAndBranch) \
218 V(Label) \ 222 V(Label) \
219 V(LazyBailout) \ 223 V(LazyBailout) \
220 V(LoadElements) \ 224 V(LoadElements) \
221 V(LoadGlobal) \ 225 V(LoadGlobal) \
222 V(LoadKeyedFastElement) \ 226 V(LoadKeyedFastElement) \
223 V(LoadKeyedGeneric) \ 227 V(LoadKeyedGeneric) \
224 V(LoadNamedField) \ 228 V(LoadNamedField) \
225 V(LoadNamedGeneric) \ 229 V(LoadNamedGeneric) \
230 V(LoadFunctionPrototype) \
226 V(ModI) \ 231 V(ModI) \
227 V(MulI) \ 232 V(MulI) \
228 V(NumberTagD) \ 233 V(NumberTagD) \
229 V(NumberTagI) \ 234 V(NumberTagI) \
230 V(NumberUntagD) \ 235 V(NumberUntagD) \
231 V(ObjectLiteral) \ 236 V(ObjectLiteral) \
232 V(OsrEntry) \ 237 V(OsrEntry) \
233 V(Parameter) \ 238 V(Parameter) \
234 V(PushArgument) \ 239 V(PushArgument) \
235 V(RegExpLiteral) \ 240 V(RegExpLiteral) \
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 323
319 private: 324 private:
320 SetOncePointer<LEnvironment> environment_; 325 SetOncePointer<LEnvironment> environment_;
321 SetOncePointer<LPointerMap> pointer_map_; 326 SetOncePointer<LPointerMap> pointer_map_;
322 SetOncePointer<LOperand> result_; 327 SetOncePointer<LOperand> result_;
323 HValue* hydrogen_value_; 328 HValue* hydrogen_value_;
324 SetOncePointer<LEnvironment> deoptimization_environment_; 329 SetOncePointer<LEnvironment> deoptimization_environment_;
325 }; 330 };
326 331
327 332
328 class LGapNode;
329
330
331 class LGapResolver BASE_EMBEDDED {
332 public:
333 LGapResolver(const ZoneList<LMoveOperands>* moves, LOperand* marker_operand);
334 const ZoneList<LMoveOperands>* ResolveInReverseOrder();
335
336 private:
337 LGapNode* LookupNode(LOperand* operand);
338 bool CanReach(LGapNode* a, LGapNode* b, int visited_id);
339 bool CanReach(LGapNode* a, LGapNode* b);
340 void RegisterMove(LMoveOperands move);
341 void AddResultMove(LOperand* from, LOperand* to);
342 void AddResultMove(LGapNode* from, LGapNode* to);
343 void ResolveCycle(LGapNode* start);
344
345 ZoneList<LGapNode*> nodes_;
346 ZoneList<LGapNode*> identified_cycles_;
347 ZoneList<LMoveOperands> result_;
348 LOperand* marker_operand_;
349 int next_visited_id_;
350 int bailout_after_ast_id_;
351 };
352
353
354 class LParallelMove : public ZoneObject {
355 public:
356 LParallelMove() : move_operands_(4) { }
357
358 void AddMove(LOperand* from, LOperand* to) {
359 move_operands_.Add(LMoveOperands(from, to));
360 }
361
362 bool IsRedundant() const;
363
364 const ZoneList<LMoveOperands>* move_operands() const {
365 return &move_operands_;
366 }
367
368 void PrintDataTo(StringStream* stream) const;
369
370 private:
371 ZoneList<LMoveOperands> move_operands_;
372 };
373
374
375 class LGap: public LInstruction { 333 class LGap: public LInstruction {
376 public: 334 public:
377 explicit LGap(HBasicBlock* block) 335 explicit LGap(HBasicBlock* block)
378 : block_(block) { 336 : block_(block) {
379 parallel_moves_[BEFORE] = NULL; 337 parallel_moves_[BEFORE] = NULL;
380 parallel_moves_[START] = NULL; 338 parallel_moves_[START] = NULL;
381 parallel_moves_[END] = NULL; 339 parallel_moves_[END] = NULL;
382 parallel_moves_[AFTER] = NULL; 340 parallel_moves_[AFTER] = NULL;
383 } 341 }
384 342
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 class LParameter: public LInstruction { 436 class LParameter: public LInstruction {
479 public: 437 public:
480 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") 438 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
481 }; 439 };
482 440
483 441
484 class LCallStub: public LInstruction { 442 class LCallStub: public LInstruction {
485 public: 443 public:
486 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") 444 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
487 DECLARE_HYDROGEN_ACCESSOR(CallStub) 445 DECLARE_HYDROGEN_ACCESSOR(CallStub)
446
447 TranscendentalCache::Type transcendental_type() {
448 return hydrogen()->transcendental_type();
449 }
488 }; 450 };
489 451
490 452
491 class LUnknownOSRValue: public LInstruction { 453 class LUnknownOSRValue: public LInstruction {
492 public: 454 public:
493 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") 455 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
494 }; 456 };
495 457
496 458
497 class LUnaryOperation: public LInstruction { 459 class LUnaryOperation: public LInstruction {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 576
615 LOperand* temp() const { return temp_; } 577 LOperand* temp() const { return temp_; }
616 578
617 private: 579 private:
618 LOperand* temp_; 580 LOperand* temp_;
619 }; 581 };
620 582
621 583
622 class LCmpID: public LBinaryOperation { 584 class LCmpID: public LBinaryOperation {
623 public: 585 public:
624 LCmpID(Token::Value op, LOperand* left, LOperand* right, bool is_double) 586 LCmpID(LOperand* left, LOperand* right)
625 : LBinaryOperation(left, right), op_(op), is_double_(is_double) { } 587 : LBinaryOperation(left, right) { }
626 588
627 Token::Value op() const { return op_; } 589 Token::Value op() const { return hydrogen()->token(); }
628 bool is_double() const { return is_double_; } 590 bool is_double() const {
591 return hydrogen()->GetInputRepresentation().IsDouble();
592 }
629 593
630 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id") 594 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id")
631 595 DECLARE_HYDROGEN_ACCESSOR(Compare)
632 private:
633 Token::Value op_;
634 bool is_double_;
635 }; 596 };
636 597
637 598
638 class LCmpIDAndBranch: public LCmpID { 599 class LCmpIDAndBranch: public LCmpID {
639 public: 600 public:
640 LCmpIDAndBranch(Token::Value op, 601 LCmpIDAndBranch(LOperand* left,
641 LOperand* left,
642 LOperand* right, 602 LOperand* right,
643 int true_block_id, 603 int true_block_id,
644 int false_block_id, 604 int false_block_id)
645 bool is_double) 605 : LCmpID(left, right),
646 : LCmpID(op, left, right, is_double),
647 true_block_id_(true_block_id), 606 true_block_id_(true_block_id),
648 false_block_id_(false_block_id) { } 607 false_block_id_(false_block_id) { }
649 608
650 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") 609 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
651 virtual void PrintDataTo(StringStream* stream) const; 610 virtual void PrintDataTo(StringStream* stream) const;
652 virtual bool IsControl() const { return true; } 611 virtual bool IsControl() const { return true; }
653 612
654 int true_block_id() const { return true_block_id_; } 613 int true_block_id() const { return true_block_id_; }
655 int false_block_id() const { return false_block_id_; } 614 int false_block_id() const { return false_block_id_; }
656 615
657 private: 616 private:
658 int true_block_id_; 617 int true_block_id_;
659 int false_block_id_; 618 int false_block_id_;
660 }; 619 };
661 620
662 621
663 class LUnaryMathOperation: public LUnaryOperation { 622 class LUnaryMathOperation: public LUnaryOperation {
664 public: 623 public:
665 explicit LUnaryMathOperation(LOperand* value) 624 explicit LUnaryMathOperation(LOperand* value, LOperand* temp)
666 : LUnaryOperation(value) { } 625 : LUnaryOperation(value), temp_(temp) { }
667 626
668 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") 627 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
669 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 628 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
670 629
671 virtual void PrintDataTo(StringStream* stream) const; 630 virtual void PrintDataTo(StringStream* stream) const;
672 BuiltinFunctionId op() const { return hydrogen()->op(); } 631 BuiltinFunctionId op() const { return hydrogen()->op(); }
632 LOperand* temp() const { return temp_; }
633
634 private:
635 LOperand* temp_;
673 }; 636 };
674 637
675 638
676 class LCmpJSObjectEq: public LBinaryOperation { 639 class LCmpJSObjectEq: public LBinaryOperation {
677 public: 640 public:
678 LCmpJSObjectEq(LOperand* left, LOperand* right) 641 LCmpJSObjectEq(LOperand* left, LOperand* right)
679 : LBinaryOperation(left, right) {} 642 : LBinaryOperation(left, right) {}
680 643
681 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq") 644 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq")
682 }; 645 };
(...skipping 16 matching lines...) Expand all
699 int false_block_id() const { return false_block_id_; } 662 int false_block_id() const { return false_block_id_; }
700 663
701 private: 664 private:
702 int true_block_id_; 665 int true_block_id_;
703 int false_block_id_; 666 int false_block_id_;
704 }; 667 };
705 668
706 669
707 class LIsNull: public LUnaryOperation { 670 class LIsNull: public LUnaryOperation {
708 public: 671 public:
709 LIsNull(LOperand* value, bool is_strict) 672 explicit LIsNull(LOperand* value) : LUnaryOperation(value) {}
710 : LUnaryOperation(value), is_strict_(is_strict) {}
711 673
712 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") 674 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null")
675 DECLARE_HYDROGEN_ACCESSOR(IsNull);
713 676
714 bool is_strict() const { return is_strict_; } 677 bool is_strict() const { return hydrogen()->is_strict(); }
715
716 private:
717 bool is_strict_;
718 }; 678 };
719 679
720 680
721 class LIsNullAndBranch: public LIsNull { 681 class LIsNullAndBranch: public LIsNull {
722 public: 682 public:
723 LIsNullAndBranch(LOperand* value, 683 LIsNullAndBranch(LOperand* value,
724 bool is_strict,
725 LOperand* temp,
726 int true_block_id, 684 int true_block_id,
727 int false_block_id) 685 int false_block_id)
728 : LIsNull(value, is_strict), 686 : LIsNull(value),
729 temp_(temp),
730 true_block_id_(true_block_id), 687 true_block_id_(true_block_id),
731 false_block_id_(false_block_id) { } 688 false_block_id_(false_block_id) { }
732 689
733 DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch") 690 DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch")
734 virtual void PrintDataTo(StringStream* stream) const; 691 virtual void PrintDataTo(StringStream* stream) const;
735 virtual bool IsControl() const { return true; } 692 virtual bool IsControl() const { return true; }
736 693
737 int true_block_id() const { return true_block_id_; } 694 int true_block_id() const { return true_block_id_; }
738 int false_block_id() const { return false_block_id_; } 695 int false_block_id() const { return false_block_id_; }
739 696
740 LOperand* temp() const { return temp_; }
741
742 private: 697 private:
743 LOperand* temp_;
744 int true_block_id_; 698 int true_block_id_;
745 int false_block_id_; 699 int false_block_id_;
746 }; 700 };
747 701
748 702
749 class LIsObject: public LUnaryOperation { 703 class LIsObject: public LUnaryOperation {
750 public: 704 public:
751 LIsObject(LOperand* value, LOperand* temp) 705 LIsObject(LOperand* value, LOperand* temp)
752 : LUnaryOperation(value), temp_(temp) {} 706 : LUnaryOperation(value), temp_(temp) {}
753 707
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) 782 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
829 783
830 InstanceType TestType(); // The type to test against when generating code. 784 InstanceType TestType(); // The type to test against when generating code.
831 Condition BranchCondition(); // The branch condition for 'true'. 785 Condition BranchCondition(); // The branch condition for 'true'.
832 }; 786 };
833 787
834 788
835 class LHasInstanceTypeAndBranch: public LHasInstanceType { 789 class LHasInstanceTypeAndBranch: public LHasInstanceType {
836 public: 790 public:
837 LHasInstanceTypeAndBranch(LOperand* value, 791 LHasInstanceTypeAndBranch(LOperand* value,
838 LOperand* temporary,
839 int true_block_id, 792 int true_block_id,
840 int false_block_id) 793 int false_block_id)
841 : LHasInstanceType(value), 794 : LHasInstanceType(value),
842 temp_(temporary),
843 true_block_id_(true_block_id), 795 true_block_id_(true_block_id),
844 false_block_id_(false_block_id) { } 796 false_block_id_(false_block_id) { }
845 797
846 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, 798 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
847 "has-instance-type-and-branch") 799 "has-instance-type-and-branch")
848 virtual void PrintDataTo(StringStream* stream) const; 800 virtual void PrintDataTo(StringStream* stream) const;
849 virtual bool IsControl() const { return true; } 801 virtual bool IsControl() const { return true; }
850 802
851 int true_block_id() const { return true_block_id_; } 803 int true_block_id() const { return true_block_id_; }
852 int false_block_id() const { return false_block_id_; } 804 int false_block_id() const { return false_block_id_; }
853 805
854 LOperand* temp() { return temp_; }
855
856 private: 806 private:
857 LOperand* temp_;
858 int true_block_id_; 807 int true_block_id_;
859 int false_block_id_; 808 int false_block_id_;
860 }; 809 };
861 810
862 811
863 class LHasCachedArrayIndex: public LUnaryOperation { 812 class LHasCachedArrayIndex: public LUnaryOperation {
864 public: 813 public:
865 explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation(value) {} 814 explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation(value) {}
866 815
867 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") 816 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
(...skipping 19 matching lines...) Expand all
887 int false_block_id() const { return false_block_id_; } 836 int false_block_id() const { return false_block_id_; }
888 837
889 private: 838 private:
890 int true_block_id_; 839 int true_block_id_;
891 int false_block_id_; 840 int false_block_id_;
892 }; 841 };
893 842
894 843
895 class LClassOfTest: public LUnaryOperation { 844 class LClassOfTest: public LUnaryOperation {
896 public: 845 public:
897 LClassOfTest(LOperand* value, LOperand* temp) 846 explicit LClassOfTest(LOperand* value) : LUnaryOperation(value) {}
898 : LUnaryOperation(value), temporary_(temp) {}
899 847
900 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test") 848 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test")
901 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) 849 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
902 850
903 virtual void PrintDataTo(StringStream* stream) const; 851 virtual void PrintDataTo(StringStream* stream) const;
904
905 LOperand* temporary() { return temporary_; }
906
907 private:
908 LOperand *temporary_;
909 }; 852 };
910 853
911 854
912 class LClassOfTestAndBranch: public LClassOfTest { 855 class LClassOfTestAndBranch: public LClassOfTest {
913 public: 856 public:
914 LClassOfTestAndBranch(LOperand* value, 857 LClassOfTestAndBranch(LOperand* value,
915 LOperand* temporary, 858 LOperand* temporary,
916 LOperand* temporary2,
917 int true_block_id, 859 int true_block_id,
918 int false_block_id) 860 int false_block_id)
919 : LClassOfTest(value, temporary), 861 : LClassOfTest(value),
920 temporary2_(temporary2), 862 temporary_(temporary),
921 true_block_id_(true_block_id), 863 true_block_id_(true_block_id),
922 false_block_id_(false_block_id) { } 864 false_block_id_(false_block_id) { }
923 865
924 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, 866 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
925 "class-of-test-and-branch") 867 "class-of-test-and-branch")
926 virtual void PrintDataTo(StringStream* stream) const; 868 virtual void PrintDataTo(StringStream* stream) const;
927 virtual bool IsControl() const { return true; } 869 virtual bool IsControl() const { return true; }
928 870
929 int true_block_id() const { return true_block_id_; } 871 int true_block_id() const { return true_block_id_; }
930 int false_block_id() const { return false_block_id_; } 872 int false_block_id() const { return false_block_id_; }
931 LOperand* temporary2() { return temporary2_; } 873 LOperand* temporary() { return temporary_; }
932 874
933 private: 875 private:
934 LOperand* temporary2_; 876 LOperand* temporary_;
935 int true_block_id_; 877 int true_block_id_;
936 int false_block_id_; 878 int false_block_id_;
937 }; 879 };
938 880
939 881
940 class LCmpT: public LBinaryOperation { 882 class LCmpT: public LBinaryOperation {
941 public: 883 public:
942 LCmpT(LOperand* left, LOperand* right) : LBinaryOperation(left, right) {} 884 LCmpT(LOperand* left, LOperand* right) : LBinaryOperation(left, right) {}
943 885
944 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") 886 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 934
993 int true_block_id() const { return true_block_id_; } 935 int true_block_id() const { return true_block_id_; }
994 int false_block_id() const { return false_block_id_; } 936 int false_block_id() const { return false_block_id_; }
995 937
996 private: 938 private:
997 int true_block_id_; 939 int true_block_id_;
998 int false_block_id_; 940 int false_block_id_;
999 }; 941 };
1000 942
1001 943
944 class LInstanceOfKnownGlobal: public LUnaryOperation {
945 public:
946 explicit LInstanceOfKnownGlobal(LOperand* left)
947 : LUnaryOperation(left) { }
948
949 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
950 "instance-of-known-global")
951 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
952
953 Handle<JSFunction> function() const { return hydrogen()->function(); }
954 };
955
956
1002 class LBoundsCheck: public LBinaryOperation { 957 class LBoundsCheck: public LBinaryOperation {
1003 public: 958 public:
1004 LBoundsCheck(LOperand* index, LOperand* length) 959 LBoundsCheck(LOperand* index, LOperand* length)
1005 : LBinaryOperation(index, length) { } 960 : LBinaryOperation(index, length) { }
1006 961
1007 LOperand* index() const { return left(); } 962 LOperand* index() const { return left(); }
1008 LOperand* length() const { return right(); } 963 LOperand* length() const { return right(); }
1009 964
1010 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") 965 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
1011 }; 966 };
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 int false_block_id() const { return false_block_id_; } 1065 int false_block_id() const { return false_block_id_; }
1111 1066
1112 private: 1067 private:
1113 int true_block_id_; 1068 int true_block_id_;
1114 int false_block_id_; 1069 int false_block_id_;
1115 }; 1070 };
1116 1071
1117 1072
1118 class LCmpMapAndBranch: public LUnaryOperation { 1073 class LCmpMapAndBranch: public LUnaryOperation {
1119 public: 1074 public:
1120 LCmpMapAndBranch(LOperand* value, 1075 LCmpMapAndBranch(LOperand* value, LOperand* temp)
1121 Handle<Map> map, 1076 : LUnaryOperation(value), temp_(temp) { }
1122 int true_block_id,
1123 int false_block_id)
1124 : LUnaryOperation(value),
1125 map_(map),
1126 true_block_id_(true_block_id),
1127 false_block_id_(false_block_id) { }
1128 1077
1129 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") 1078 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1079 DECLARE_HYDROGEN_ACCESSOR(CompareMapAndBranch)
1130 1080
1131 virtual bool IsControl() const { return true; } 1081 virtual bool IsControl() const { return true; }
1132 1082
1133 Handle<Map> map() const { return map_; } 1083 LOperand* temp() const { return temp_; }
1134 int true_block_id() const { return true_block_id_; } 1084 Handle<Map> map() const { return hydrogen()->map(); }
1135 int false_block_id() const { return false_block_id_; } 1085 int true_block_id() const {
1086 return hydrogen()->true_destination()->block_id();
1087 }
1088 int false_block_id() const {
1089 return hydrogen()->false_destination()->block_id();
1090 }
1136 1091
1137 private: 1092 private:
1138 Handle<Map> map_; 1093 LOperand* temp_;
1139 int true_block_id_;
1140 int false_block_id_;
1141 }; 1094 };
1142 1095
1143 1096
1144 class LArrayLength: public LUnaryOperation { 1097 class LJSArrayLength: public LUnaryOperation {
1145 public: 1098 public:
1146 LArrayLength(LOperand* input, LOperand* temporary) 1099 explicit LJSArrayLength(LOperand* input) : LUnaryOperation(input) { }
1147 : LUnaryOperation(input), temporary_(temporary) { }
1148 1100
1149 LOperand* temporary() const { return temporary_; } 1101 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
1150 1102 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
1151 DECLARE_CONCRETE_INSTRUCTION(ArrayLength, "array-length")
1152 DECLARE_HYDROGEN_ACCESSOR(ArrayLength)
1153
1154 private:
1155 LOperand* temporary_;
1156 }; 1103 };
1157 1104
1158 1105
1106 class LFixedArrayLength: public LUnaryOperation {
1107 public:
1108 explicit LFixedArrayLength(LOperand* input) : LUnaryOperation(input) { }
1109
1110 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length")
1111 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength)
1112 };
1113
1114
1159 class LValueOf: public LUnaryOperation { 1115 class LValueOf: public LUnaryOperation {
1160 public: 1116 public:
1161 LValueOf(LOperand* input, LOperand* temporary) 1117 LValueOf(LOperand* input, LOperand* temporary)
1162 : LUnaryOperation(input), temporary_(temporary) { } 1118 : LUnaryOperation(input), temporary_(temporary) { }
1163 1119
1164 LOperand* temporary() const { return temporary_; } 1120 LOperand* temporary() const { return temporary_; }
1165 1121
1166 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") 1122 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
1167 DECLARE_HYDROGEN_ACCESSOR(ValueOf) 1123 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1168 1124
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation(object) { } 1205 explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation(object) { }
1250 1206
1251 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") 1207 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1252 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) 1208 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1253 1209
1254 LOperand* object() const { return input(); } 1210 LOperand* object() const { return input(); }
1255 Handle<Object> name() const { return hydrogen()->name(); } 1211 Handle<Object> name() const { return hydrogen()->name(); }
1256 }; 1212 };
1257 1213
1258 1214
1215 class LLoadFunctionPrototype: public LUnaryOperation {
1216 public:
1217 explicit LLoadFunctionPrototype(LOperand* function)
1218 : LUnaryOperation(function) { }
1219
1220 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1221 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1222
1223 LOperand* function() const { return input(); }
1224 };
1225
1226
1259 class LLoadElements: public LUnaryOperation { 1227 class LLoadElements: public LUnaryOperation {
1260 public: 1228 public:
1261 explicit LLoadElements(LOperand* obj) : LUnaryOperation(obj) { } 1229 explicit LLoadElements(LOperand* obj) : LUnaryOperation(obj) { }
1262 1230
1263 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") 1231 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1264 }; 1232 };
1265 1233
1266 1234
1267 class LLoadKeyedFastElement: public LBinaryOperation { 1235 class LLoadKeyedFastElement: public LBinaryOperation {
1268 public: 1236 public:
1269 LLoadKeyedFastElement(LOperand* elements, 1237 LLoadKeyedFastElement(LOperand* elements, LOperand* key)
1270 LOperand* key, 1238 : LBinaryOperation(elements, key) { }
1271 LOperand* load_result)
1272 : LBinaryOperation(elements, key),
1273 load_result_(load_result) { }
1274 1239
1275 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") 1240 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
1276 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) 1241 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
1277 1242
1278 LOperand* elements() const { return left(); } 1243 LOperand* elements() const { return left(); }
1279 LOperand* key() const { return right(); } 1244 LOperand* key() const { return right(); }
1280 LOperand* load_result() const { return load_result_; }
1281
1282 private:
1283 LOperand* load_result_;
1284 }; 1245 };
1285 1246
1286 1247
1287 class LLoadKeyedGeneric: public LBinaryOperation { 1248 class LLoadKeyedGeneric: public LBinaryOperation {
1288 public: 1249 public:
1289 LLoadKeyedGeneric(LOperand* obj, LOperand* key) 1250 LLoadKeyedGeneric(LOperand* obj, LOperand* key)
1290 : LBinaryOperation(obj, key) { } 1251 : LBinaryOperation(obj, key) { }
1291 1252
1292 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") 1253 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1293 1254
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 1470
1510 bool needs_check() const { return needs_check_; } 1471 bool needs_check() const { return needs_check_; }
1511 1472
1512 private: 1473 private:
1513 bool needs_check_; 1474 bool needs_check_;
1514 }; 1475 };
1515 1476
1516 1477
1517 class LStoreNamed: public LInstruction { 1478 class LStoreNamed: public LInstruction {
1518 public: 1479 public:
1519 LStoreNamed(LOperand* obj, Handle<Object> name, LOperand* val) 1480 LStoreNamed(LOperand* obj, LOperand* val)
1520 : object_(obj), name_(name), value_(val) { } 1481 : object_(obj), value_(val) { }
1521 1482
1522 DECLARE_INSTRUCTION(StoreNamed) 1483 DECLARE_INSTRUCTION(StoreNamed)
1484 DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
1523 1485
1524 virtual void PrintDataTo(StringStream* stream) const; 1486 virtual void PrintDataTo(StringStream* stream) const;
1525 1487
1526 LOperand* object() const { return object_; } 1488 LOperand* object() const { return object_; }
1527 Handle<Object> name() const { return name_; } 1489 Handle<Object> name() const { return hydrogen()->name(); }
1528 LOperand* value() const { return value_; } 1490 LOperand* value() const { return value_; }
1529 1491
1530 private: 1492 private:
1531 LOperand* object_; 1493 LOperand* object_;
1532 Handle<Object> name_;
1533 LOperand* value_; 1494 LOperand* value_;
1534 }; 1495 };
1535 1496
1536 1497
1537 class LStoreNamedField: public LStoreNamed { 1498 class LStoreNamedField: public LStoreNamed {
1538 public: 1499 public:
1539 LStoreNamedField(LOperand* obj, 1500 LStoreNamedField(LOperand* obj, LOperand* val)
1540 Handle<Object> name, 1501 : LStoreNamed(obj, val) { }
1541 LOperand* val,
1542 bool in_object,
1543 int offset,
1544 LOperand* temp,
1545 bool needs_write_barrier,
1546 Handle<Map> transition)
1547 : LStoreNamed(obj, name, val),
1548 is_in_object_(in_object),
1549 offset_(offset),
1550 temp_(temp),
1551 needs_write_barrier_(needs_write_barrier),
1552 transition_(transition) { }
1553 1502
1554 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") 1503 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1504 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1555 1505
1556 bool is_in_object() { return is_in_object_; } 1506 bool is_in_object() { return hydrogen()->is_in_object(); }
1557 int offset() { return offset_; } 1507 int offset() { return hydrogen()->offset(); }
1558 LOperand* temp() { return temp_; } 1508 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1559 bool needs_write_barrier() { return needs_write_barrier_; } 1509 Handle<Map> transition() { return hydrogen()->transition(); }
1560 Handle<Map> transition() const { return transition_; }
1561 void set_transition(Handle<Map> map) { transition_ = map; }
1562
1563 private:
1564 bool is_in_object_;
1565 int offset_;
1566 LOperand* temp_;
1567 bool needs_write_barrier_;
1568 Handle<Map> transition_;
1569 }; 1510 };
1570 1511
1571 1512
1572 class LStoreNamedGeneric: public LStoreNamed { 1513 class LStoreNamedGeneric: public LStoreNamed {
1573 public: 1514 public:
1574 LStoreNamedGeneric(LOperand* obj, 1515 LStoreNamedGeneric(LOperand* obj, LOperand* val)
1575 Handle<Object> name, 1516 : LStoreNamed(obj, val) { }
1576 LOperand* val)
1577 : LStoreNamed(obj, name, val) { }
1578 1517
1579 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 1518 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1519 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1580 }; 1520 };
1581 1521
1582 1522
1583 class LStoreKeyed: public LInstruction { 1523 class LStoreKeyed: public LInstruction {
1584 public: 1524 public:
1585 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) 1525 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val)
1586 : object_(obj), key_(key), value_(val) { } 1526 : object_(obj), key_(key), value_(val) { }
1587 1527
1588 DECLARE_INSTRUCTION(StoreKeyed) 1528 DECLARE_INSTRUCTION(StoreKeyed)
1589 1529
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 public: 1564 public:
1625 explicit LCheckFunction(LOperand* use) : LUnaryOperation(use) { } 1565 explicit LCheckFunction(LOperand* use) : LUnaryOperation(use) { }
1626 1566
1627 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") 1567 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
1628 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) 1568 DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
1629 }; 1569 };
1630 1570
1631 1571
1632 class LCheckInstanceType: public LUnaryOperation { 1572 class LCheckInstanceType: public LUnaryOperation {
1633 public: 1573 public:
1634 LCheckInstanceType(LOperand* use, LOperand* temp) 1574 explicit LCheckInstanceType(LOperand* use) : LUnaryOperation(use) { }
1635 : LUnaryOperation(use), temp_(temp) { }
1636 1575
1637 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") 1576 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
1638 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) 1577 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
1639 1578
1640 LOperand* temp() const { return temp_; } 1579 LOperand* temp() const { return temp_; }
1641 1580
1642 private: 1581 private:
1643 LOperand* temp_; 1582 LOperand* temp_;
1644 }; 1583 };
1645 1584
1646 1585
1647 class LCheckMap: public LUnaryOperation { 1586 class LCheckMap: public LUnaryOperation {
1648 public: 1587 public:
1649 explicit LCheckMap(LOperand* use) : LUnaryOperation(use) { } 1588 explicit LCheckMap(LOperand* use) : LUnaryOperation(use) { }
1650 1589
1651 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map") 1590 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map")
1652 DECLARE_HYDROGEN_ACCESSOR(CheckMap) 1591 DECLARE_HYDROGEN_ACCESSOR(CheckMap)
1653 }; 1592 };
1654 1593
1655 1594
1656 class LCheckPrototypeMaps: public LInstruction { 1595 class LCheckPrototypeMaps: public LInstruction {
1657 public: 1596 public:
1658 LCheckPrototypeMaps(LOperand* temp, 1597 LCheckPrototypeMaps(LOperand* temp1, LOperand* temp2)
1659 Handle<JSObject> holder, 1598 : temp1_(temp1), temp2_(temp2) { }
1660 Handle<Map> receiver_map)
1661 : temp_(temp),
1662 holder_(holder),
1663 receiver_map_(receiver_map) { }
1664 1599
1665 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") 1600 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
1601 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
1666 1602
1667 LOperand* temp() const { return temp_; } 1603 Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
1668 Handle<JSObject> holder() const { return holder_; } 1604 Handle<JSObject> holder() const { return hydrogen()->holder(); }
1669 Handle<Map> receiver_map() const { return receiver_map_; } 1605
1606 LOperand* temp1() const { return temp1_; }
1607 LOperand* temp2() const { return temp2_; }
1670 1608
1671 private: 1609 private:
1672 LOperand* temp_; 1610 LOperand* temp1_;
1673 Handle<JSObject> holder_; 1611 LOperand* temp2_;
1674 Handle<Map> receiver_map_;
1675 }; 1612 };
1676 1613
1677 1614
1678 class LCheckSmi: public LUnaryOperation { 1615 class LCheckSmi: public LUnaryOperation {
1679 public: 1616 public:
1680 LCheckSmi(LOperand* use, Condition condition) 1617 LCheckSmi(LOperand* use, Condition condition)
1681 : LUnaryOperation(use), condition_(condition) { } 1618 : LUnaryOperation(use), condition_(condition) { }
1682 1619
1683 Condition condition() const { return condition_; } 1620 Condition condition() const { return condition_; }
1684 1621
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters]; 1741 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters];
1805 }; 1742 };
1806 1743
1807 1744
1808 class LStackCheck: public LInstruction { 1745 class LStackCheck: public LInstruction {
1809 public: 1746 public:
1810 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") 1747 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
1811 }; 1748 };
1812 1749
1813 1750
1814 class LPointerMap: public ZoneObject {
1815 public:
1816 explicit LPointerMap(int position)
1817 : pointer_operands_(8), position_(position), lithium_position_(-1) { }
1818
1819 const ZoneList<LOperand*>* operands() const { return &pointer_operands_; }
1820 int position() const { return position_; }
1821 int lithium_position() const { return lithium_position_; }
1822
1823 void set_lithium_position(int pos) {
1824 ASSERT(lithium_position_ == -1);
1825 lithium_position_ = pos;
1826 }
1827
1828 void RecordPointer(LOperand* op);
1829 void PrintTo(StringStream* stream) const;
1830
1831 private:
1832 ZoneList<LOperand*> pointer_operands_;
1833 int position_;
1834 int lithium_position_;
1835 };
1836
1837
1838 class LEnvironment: public ZoneObject {
1839 public:
1840 LEnvironment(Handle<JSFunction> closure,
1841 int ast_id,
1842 int parameter_count,
1843 int argument_count,
1844 int value_count,
1845 LEnvironment* outer)
1846 : closure_(closure),
1847 arguments_stack_height_(argument_count),
1848 deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
1849 translation_index_(-1),
1850 ast_id_(ast_id),
1851 parameter_count_(parameter_count),
1852 values_(value_count),
1853 representations_(value_count),
1854 spilled_registers_(NULL),
1855 spilled_double_registers_(NULL),
1856 outer_(outer) {
1857 }
1858
1859 Handle<JSFunction> closure() const { return closure_; }
1860 int arguments_stack_height() const { return arguments_stack_height_; }
1861 int deoptimization_index() const { return deoptimization_index_; }
1862 int translation_index() const { return translation_index_; }
1863 int ast_id() const { return ast_id_; }
1864 int parameter_count() const { return parameter_count_; }
1865 const ZoneList<LOperand*>* values() const { return &values_; }
1866 LEnvironment* outer() const { return outer_; }
1867
1868 void AddValue(LOperand* operand, Representation representation) {
1869 values_.Add(operand);
1870 representations_.Add(representation);
1871 }
1872
1873 bool HasTaggedValueAt(int index) const {
1874 return representations_[index].IsTagged();
1875 }
1876
1877 void Register(int deoptimization_index, int translation_index) {
1878 ASSERT(!HasBeenRegistered());
1879 deoptimization_index_ = deoptimization_index;
1880 translation_index_ = translation_index;
1881 }
1882 bool HasBeenRegistered() const {
1883 return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex;
1884 }
1885
1886 void SetSpilledRegisters(LOperand** registers,
1887 LOperand** double_registers) {
1888 spilled_registers_ = registers;
1889 spilled_double_registers_ = double_registers;
1890 }
1891
1892 // Emit frame translation commands for this environment.
1893 void WriteTranslation(LCodeGen* cgen, Translation* translation) const;
1894
1895 void PrintTo(StringStream* stream) const;
1896
1897 private:
1898 Handle<JSFunction> closure_;
1899 int arguments_stack_height_;
1900 int deoptimization_index_;
1901 int translation_index_;
1902 int ast_id_;
1903 int parameter_count_;
1904 ZoneList<LOperand*> values_;
1905 ZoneList<Representation> representations_;
1906
1907 // Allocation index indexed arrays of spill slot operands for registers
1908 // that are also in spill slots at an OSR entry. NULL for environments
1909 // that do not correspond to an OSR entry.
1910 LOperand** spilled_registers_;
1911 LOperand** spilled_double_registers_;
1912
1913 LEnvironment* outer_;
1914 };
1915
1916 class LChunkBuilder; 1751 class LChunkBuilder;
1917 class LChunk: public ZoneObject { 1752 class LChunk: public ZoneObject {
1918 public: 1753 public:
1919 explicit LChunk(HGraph* graph); 1754 explicit LChunk(HGraph* graph);
1920 1755
1921 int AddInstruction(LInstruction* instruction, HBasicBlock* block); 1756 int AddInstruction(LInstruction* instruction, HBasicBlock* block);
1922 LConstantOperand* DefineConstantOperand(HConstant* constant); 1757 LConstantOperand* DefineConstantOperand(HConstant* constant);
1923 Handle<Object> LookupLiteral(LConstantOperand* operand) const; 1758 Handle<Object> LookupLiteral(LConstantOperand* operand) const;
1924 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; 1759 Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
1925 1760
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 LOperand* UseOrConstantAtStart(HValue* value); 1879 LOperand* UseOrConstantAtStart(HValue* value);
2045 LOperand* UseRegisterOrConstant(HValue* value); 1880 LOperand* UseRegisterOrConstant(HValue* value);
2046 LOperand* UseRegisterOrConstantAtStart(HValue* value); 1881 LOperand* UseRegisterOrConstantAtStart(HValue* value);
2047 1882
2048 // Methods for setting up define-use relationships. 1883 // Methods for setting up define-use relationships.
2049 // Return the same instruction that they are passed. 1884 // Return the same instruction that they are passed.
2050 LInstruction* Define(LInstruction* instr, LUnallocated* result); 1885 LInstruction* Define(LInstruction* instr, LUnallocated* result);
2051 LInstruction* Define(LInstruction* instr); 1886 LInstruction* Define(LInstruction* instr);
2052 LInstruction* DefineAsRegister(LInstruction* instr); 1887 LInstruction* DefineAsRegister(LInstruction* instr);
2053 LInstruction* DefineAsSpilled(LInstruction* instr, int index); 1888 LInstruction* DefineAsSpilled(LInstruction* instr, int index);
2054 LInstruction* DefineSameAsAny(LInstruction* instr);
2055 LInstruction* DefineSameAsFirst(LInstruction* instr); 1889 LInstruction* DefineSameAsFirst(LInstruction* instr);
2056 LInstruction* DefineFixed(LInstruction* instr, Register reg); 1890 LInstruction* DefineFixed(LInstruction* instr, Register reg);
2057 LInstruction* DefineFixedDouble(LInstruction* instr, DoubleRegister reg); 1891 LInstruction* DefineFixedDouble(LInstruction* instr, DoubleRegister reg);
2058 LInstruction* AssignEnvironment(LInstruction* instr); 1892 LInstruction* AssignEnvironment(LInstruction* instr);
2059 LInstruction* AssignPointerMap(LInstruction* instr); 1893 LInstruction* AssignPointerMap(LInstruction* instr);
2060 1894
2061 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; 1895 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2062 1896
2063 // By default we assume that instruction sequences generated for calls 1897 // By default we assume that instruction sequences generated for calls
2064 // cannot deoptimize eagerly and we do not attach environment to this 1898 // cannot deoptimize eagerly and we do not attach environment to this
2065 // instruction. 1899 // instruction.
2066 LInstruction* MarkAsCall( 1900 LInstruction* MarkAsCall(
2067 LInstruction* instr, 1901 LInstruction* instr,
2068 HInstruction* hinstr, 1902 HInstruction* hinstr,
2069 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); 1903 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2070 1904
2071 LInstruction* SetInstructionPendingDeoptimizationEnvironment( 1905 LInstruction* SetInstructionPendingDeoptimizationEnvironment(
2072 LInstruction* instr, int ast_id); 1906 LInstruction* instr, int ast_id);
2073 void ClearInstructionPendingDeoptimizationEnvironment(); 1907 void ClearInstructionPendingDeoptimizationEnvironment();
2074 1908
2075 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env); 1909 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
2076 1910
2077 // Temporary operand that may be a memory location.
2078 LOperand* Temp();
2079 // Temporary operand that must be in a register. 1911 // Temporary operand that must be in a register.
2080 LUnallocated* TempRegister(); 1912 LUnallocated* TempRegister();
2081 LOperand* FixedTemp(Register reg); 1913 LOperand* FixedTemp(Register reg);
2082 LOperand* FixedTemp(DoubleRegister reg); 1914 LOperand* FixedTemp(DoubleRegister reg);
2083 1915
2084 void VisitInstruction(HInstruction* current); 1916 void VisitInstruction(HInstruction* current);
2085 1917
2086 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); 1918 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2087 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); 1919 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
2088 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); 1920 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
(...skipping 17 matching lines...) Expand all
2106 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 1938 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2107 }; 1939 };
2108 1940
2109 #undef DECLARE_HYDROGEN_ACCESSOR 1941 #undef DECLARE_HYDROGEN_ACCESSOR
2110 #undef DECLARE_INSTRUCTION 1942 #undef DECLARE_INSTRUCTION
2111 #undef DECLARE_CONCRETE_INSTRUCTION 1943 #undef DECLARE_CONCRETE_INSTRUCTION
2112 1944
2113 } } // namespace v8::internal 1945 } } // namespace v8::internal
2114 1946
2115 #endif // V8_ARM_LITHIUM_ARM_H_ 1947 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm/lithium-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698