OLD | NEW |
1 // Copyright 2011 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 |
(...skipping 28 matching lines...) Expand all Loading... |
39 // Forward declarations. | 39 // Forward declarations. |
40 class HBasicBlock; | 40 class HBasicBlock; |
41 class HEnvironment; | 41 class HEnvironment; |
42 class HInstruction; | 42 class HInstruction; |
43 class HLoopInformation; | 43 class HLoopInformation; |
44 class HValue; | 44 class HValue; |
45 class LInstruction; | 45 class LInstruction; |
46 class LChunkBuilder; | 46 class LChunkBuilder; |
47 | 47 |
48 | 48 |
49 // Type hierarchy: | |
50 // | |
51 // HValue | |
52 // HInstruction | |
53 // HAccessArgumentsAt | |
54 // HApplyArguments | |
55 // HArgumentsElements | |
56 // HArgumentsLength | |
57 // HArgumentsObject | |
58 // HBinaryOperation | |
59 // HArithmeticBinaryOperation | |
60 // HAdd | |
61 // HDiv | |
62 // HMod | |
63 // HMul | |
64 // HSub | |
65 // HBitwiseBinaryOperation | |
66 // HBitAnd | |
67 // HBitOr | |
68 // HBitXor | |
69 // HSar | |
70 // HShl | |
71 // HShr | |
72 // HBoundsCheck | |
73 // HCompare | |
74 // HCompareJSObjectEq | |
75 // HInstanceOf | |
76 // HInstanceOfKnownGlobal | |
77 // HLoadKeyed | |
78 // HLoadKeyedFastElement | |
79 // HLoadKeyedGeneric | |
80 // HPower | |
81 // HStoreNamed | |
82 // HStoreNamedField | |
83 // HStoreNamedGeneric | |
84 // HStringCharCodeAt | |
85 // HBlockEntry | |
86 // HCall | |
87 // HCallConstantFunction | |
88 // HCallFunction | |
89 // HCallGlobal | |
90 // HCallKeyed | |
91 // HCallKnownGlobal | |
92 // HCallNamed | |
93 // HCallNew | |
94 // HCallRuntime | |
95 // HCallStub | |
96 // HCheckPrototypeMaps | |
97 // HConstant | |
98 // HControlInstruction | |
99 // HDeoptimize | |
100 // HGoto | |
101 // HUnaryControlInstruction | |
102 // HCompareMap | |
103 // HReturn | |
104 // HTest | |
105 // HThrow | |
106 // HEnterInlined | |
107 // HFunctionLiteral | |
108 // HGlobalObject | |
109 // HGlobalReceiver | |
110 // HLeaveInlined | |
111 // HLoadContextSlot | |
112 // HLoadGlobal | |
113 // HMaterializedLiteral | |
114 // HArrayLiteral | |
115 // HObjectLiteral | |
116 // HRegExpLiteral | |
117 // HOsrEntry | |
118 // HParameter | |
119 // HSimulate | |
120 // HStackCheck | |
121 // HStoreKeyed | |
122 // HStoreKeyedFastElement | |
123 // HStoreKeyedGeneric | |
124 // HUnaryOperation | |
125 // HBitNot | |
126 // HChange | |
127 // HCheckFunction | |
128 // HCheckInstanceType | |
129 // HCheckMap | |
130 // HCheckNonSmi | |
131 // HCheckSmi | |
132 // HDeleteProperty | |
133 // HFixedArrayLength | |
134 // HJSArrayLength | |
135 // HLoadElements | |
136 // HLoadFunctionPrototype | |
137 // HLoadNamedField | |
138 // HLoadNamedGeneric | |
139 // HPushArgument | |
140 // HStringLength | |
141 // HTypeof | |
142 // HUnaryMathOperation | |
143 // HUnaryPredicate | |
144 // HClassOfTest | |
145 // HHasCachedArrayIndex | |
146 // HHasInstanceType | |
147 // HIsNull | |
148 // HIsObject | |
149 // HIsSmi | |
150 // HTypeofIs | |
151 // HValueOf | |
152 // HUnknownOSRValue | |
153 // HPhi | |
154 | |
155 #define HYDROGEN_ALL_INSTRUCTION_LIST(V) \ | 49 #define HYDROGEN_ALL_INSTRUCTION_LIST(V) \ |
156 V(ArithmeticBinaryOperation) \ | 50 V(ArithmeticBinaryOperation) \ |
157 V(BinaryOperation) \ | 51 V(BinaryOperation) \ |
158 V(BitwiseBinaryOperation) \ | 52 V(BitwiseBinaryOperation) \ |
159 V(Call) \ | 53 V(Call) \ |
160 V(ControlInstruction) \ | 54 V(ControlInstruction) \ |
161 V(Instruction) \ | 55 V(Instruction) \ |
162 V(LoadKeyed) \ | 56 V(LoadKeyed) \ |
163 V(MaterializedLiteral) \ | 57 V(MaterializedLiteral) \ |
164 V(Phi) \ | 58 V(Phi) \ |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 } | 459 } |
566 | 460 |
567 static int DependsFlagsMask() { | 461 static int DependsFlagsMask() { |
568 return ConvertChangesToDependsFlags(ChangesFlagsMask()); | 462 return ConvertChangesToDependsFlags(ChangesFlagsMask()); |
569 } | 463 } |
570 | 464 |
571 static int ConvertChangesToDependsFlags(int flags) { | 465 static int ConvertChangesToDependsFlags(int flags) { |
572 return flags << kChangesToDependsFlagsLeftShift; | 466 return flags << kChangesToDependsFlagsLeftShift; |
573 } | 467 } |
574 | 468 |
575 // A flag mask to mark an instruction as having arbitrary side effects. | |
576 static int AllSideEffects() { | |
577 return ChangesFlagsMask() & ~(1 << kChangesOsrEntries); | |
578 } | |
579 | |
580 static HValue* cast(HValue* value) { return value; } | 469 static HValue* cast(HValue* value) { return value; } |
581 | 470 |
582 enum Opcode { | 471 enum Opcode { |
583 // Declare a unique enum value for each hydrogen instruction. | 472 // Declare a unique enum value for each hydrogen instruction. |
584 #define DECLARE_DO(type) k##type, | 473 #define DECLARE_DO(type) k##type, |
585 HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO) | 474 HYDROGEN_ALL_INSTRUCTION_LIST(DECLARE_DO) |
586 #undef DECLARE_DO | 475 #undef DECLARE_DO |
587 kMaxInstructionClass | 476 kMaxInstructionClass |
588 }; | 477 }; |
589 | 478 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 // If the operation also exists in a form that takes int32 and outputs int32 | 517 // If the operation also exists in a form that takes int32 and outputs int32 |
629 // then the operation should return its input value so that we can propagate | 518 // then the operation should return its input value so that we can propagate |
630 // back. There are two operations that need to propagate back to more than | 519 // back. There are two operations that need to propagate back to more than |
631 // one input. They are phi and binary add. They always return NULL and | 520 // one input. They are phi and binary add. They always return NULL and |
632 // expect the caller to take care of things. | 521 // expect the caller to take care of things. |
633 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited) { | 522 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited) { |
634 visited->Add(id()); | 523 visited->Add(id()); |
635 return NULL; | 524 return NULL; |
636 } | 525 } |
637 | 526 |
638 bool HasSideEffects() const { | |
639 return (flags_ & AllSideEffects()) != 0; | |
640 } | |
641 bool IsDefinedAfter(HBasicBlock* other) const; | 527 bool IsDefinedAfter(HBasicBlock* other) const; |
642 | 528 |
643 // Operands. | 529 // Operands. |
644 virtual int OperandCount() const { return 0; } | 530 virtual int OperandCount() const { return 0; } |
645 virtual HValue* OperandAt(int index) const { | 531 virtual HValue* OperandAt(int index) const { |
646 UNREACHABLE(); | 532 UNREACHABLE(); |
647 return NULL; | 533 return NULL; |
648 } | 534 } |
649 void SetOperandAt(int index, HValue* value); | 535 void SetOperandAt(int index, HValue* value); |
650 | 536 |
651 int LookupOperandIndex(int occurrence_index, HValue* op) const; | 537 int LookupOperandIndex(int occurrence_index, HValue* op) const; |
652 bool UsesMultipleTimes(HValue* op) const; | 538 bool UsesMultipleTimes(HValue* op) const; |
653 | 539 |
654 void ReplaceAndDelete(HValue* other); | 540 void ReplaceAndDelete(HValue* other); |
655 void ReplaceValue(HValue* other); | 541 void ReplaceValue(HValue* other); |
656 void ReplaceAtUse(HValue* use, HValue* other); | 542 void ReplaceAtUse(HValue* use, HValue* other); |
657 void ReplaceFirstAtUse(HValue* use, HValue* other, Representation r); | 543 void ReplaceFirstAtUse(HValue* use, HValue* other, Representation r); |
658 bool HasNoUses() const { return uses_.is_empty(); } | 544 bool HasNoUses() const { return uses_.is_empty(); } |
659 void ClearOperands(); | 545 void ClearOperands(); |
660 void Delete(); | 546 void Delete(); |
661 | 547 |
662 int flags() const { return flags_; } | 548 int flags() const { return flags_; } |
663 void SetFlagMask(int mask) { flags_ |= mask; } | 549 void SetFlag(Flag f) { flags_ |= (1 << f); } |
664 void SetFlag(Flag f) { SetFlagMask(1 << f); } | 550 void ClearFlag(Flag f) { flags_ &= ~(1 << f); } |
665 void ClearFlagMask(int mask) { flags_ &= ~mask; } | 551 bool CheckFlag(Flag f) const { return (flags_ & (1 << f)) != 0; } |
666 void ClearFlag(Flag f) { ClearFlagMask(1 << f); } | 552 |
667 bool CheckFlag(Flag f) const { return CheckFlagMask(1 << f); } | 553 void SetAllSideEffects() { flags_ |= AllSideEffects(); } |
668 bool CheckFlagMask(int mask) const { return (flags_ & mask) != 0; } | 554 void ClearAllSideEffects() { flags_ &= ~AllSideEffects(); } |
| 555 bool HasSideEffects() const { return (flags_ & AllSideEffects()) != 0; } |
669 | 556 |
670 Range* range() const { return range_; } | 557 Range* range() const { return range_; } |
671 bool HasRange() const { return range_ != NULL; } | 558 bool HasRange() const { return range_ != NULL; } |
672 void AddNewRange(Range* r); | 559 void AddNewRange(Range* r); |
673 void RemoveLastAddedRange(); | 560 void RemoveLastAddedRange(); |
674 void ComputeInitialRange(); | 561 void ComputeInitialRange(); |
675 | 562 |
676 // Representation helpers. | 563 // Representation helpers. |
677 virtual Representation RequiredInputRepresentation(int index) const { | 564 virtual Representation RequiredInputRepresentation(int index) const { |
678 return Representation::None(); | 565 return Representation::None(); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 block_ = NULL; | 619 block_ = NULL; |
733 } | 620 } |
734 | 621 |
735 void set_representation(Representation r) { | 622 void set_representation(Representation r) { |
736 // Representation is set-once. | 623 // Representation is set-once. |
737 ASSERT(representation_.IsNone() && !r.IsNone()); | 624 ASSERT(representation_.IsNone() && !r.IsNone()); |
738 representation_ = r; | 625 representation_ = r; |
739 } | 626 } |
740 | 627 |
741 private: | 628 private: |
| 629 // A flag mask to mark an instruction as having arbitrary side effects. |
| 630 static int AllSideEffects() { |
| 631 return ChangesFlagsMask() & ~(1 << kChangesOsrEntries); |
| 632 } |
| 633 |
742 void InternalReplaceAtUse(HValue* use, HValue* other); | 634 void InternalReplaceAtUse(HValue* use, HValue* other); |
743 void RegisterUse(int index, HValue* new_value); | 635 void RegisterUse(int index, HValue* new_value); |
744 | 636 |
745 HBasicBlock* block_; | 637 HBasicBlock* block_; |
746 | 638 |
747 // The id of this instruction in the hydrogen graph, assigned when first | 639 // The id of this instruction in the hydrogen graph, assigned when first |
748 // added to the graph. Reflects creation order. | 640 // added to the graph. Reflects creation order. |
749 int id_; | 641 int id_; |
750 | 642 |
751 Representation representation_; | 643 Representation representation_; |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2066 virtual bool DataEquals(HValue* other) const { return true; } | 1958 virtual bool DataEquals(HValue* other) const { return true; } |
2067 }; | 1959 }; |
2068 | 1960 |
2069 | 1961 |
2070 class HBitwiseBinaryOperation: public HBinaryOperation { | 1962 class HBitwiseBinaryOperation: public HBinaryOperation { |
2071 public: | 1963 public: |
2072 HBitwiseBinaryOperation(HValue* left, HValue* right) | 1964 HBitwiseBinaryOperation(HValue* left, HValue* right) |
2073 : HBinaryOperation(left, right) { | 1965 : HBinaryOperation(left, right) { |
2074 set_representation(Representation::Tagged()); | 1966 set_representation(Representation::Tagged()); |
2075 SetFlag(kFlexibleRepresentation); | 1967 SetFlag(kFlexibleRepresentation); |
2076 SetFlagMask(AllSideEffects()); | 1968 SetAllSideEffects(); |
2077 } | 1969 } |
2078 | 1970 |
2079 virtual Representation RequiredInputRepresentation(int index) const { | 1971 virtual Representation RequiredInputRepresentation(int index) const { |
2080 return representation(); | 1972 return representation(); |
2081 } | 1973 } |
2082 | 1974 |
2083 virtual void RepresentationChanged(Representation to) { | 1975 virtual void RepresentationChanged(Representation to) { |
2084 if (!to.IsTagged()) { | 1976 if (!to.IsTagged()) { |
2085 ASSERT(to.IsInteger32()); | 1977 ASSERT(to.IsInteger32()); |
2086 ClearFlagMask(AllSideEffects()); | 1978 ClearAllSideEffects(); |
2087 SetFlag(kTruncatingToInt32); | 1979 SetFlag(kTruncatingToInt32); |
2088 SetFlag(kUseGVN); | 1980 SetFlag(kUseGVN); |
2089 } | 1981 } |
2090 } | 1982 } |
2091 | 1983 |
2092 HType CalculateInferredType() const; | 1984 HType CalculateInferredType() const; |
2093 | 1985 |
2094 DECLARE_INSTRUCTION(BitwiseBinaryOperation) | 1986 DECLARE_INSTRUCTION(BitwiseBinaryOperation) |
2095 }; | 1987 }; |
2096 | 1988 |
2097 | 1989 |
2098 class HArithmeticBinaryOperation: public HBinaryOperation { | 1990 class HArithmeticBinaryOperation: public HBinaryOperation { |
2099 public: | 1991 public: |
2100 HArithmeticBinaryOperation(HValue* left, HValue* right) | 1992 HArithmeticBinaryOperation(HValue* left, HValue* right) |
2101 : HBinaryOperation(left, right) { | 1993 : HBinaryOperation(left, right) { |
2102 set_representation(Representation::Tagged()); | 1994 set_representation(Representation::Tagged()); |
2103 SetFlag(kFlexibleRepresentation); | 1995 SetFlag(kFlexibleRepresentation); |
2104 SetFlagMask(AllSideEffects()); | 1996 SetAllSideEffects(); |
2105 } | 1997 } |
2106 | 1998 |
2107 virtual void RepresentationChanged(Representation to) { | 1999 virtual void RepresentationChanged(Representation to) { |
2108 if (!to.IsTagged()) { | 2000 if (!to.IsTagged()) { |
2109 ClearFlagMask(AllSideEffects()); | 2001 ClearAllSideEffects(); |
2110 SetFlag(kUseGVN); | 2002 SetFlag(kUseGVN); |
2111 } | 2003 } |
2112 } | 2004 } |
2113 | 2005 |
2114 virtual HType CalculateInferredType() const; | 2006 virtual HType CalculateInferredType() const; |
2115 virtual Representation RequiredInputRepresentation(int index) const { | 2007 virtual Representation RequiredInputRepresentation(int index) const { |
2116 return representation(); | 2008 return representation(); |
2117 } | 2009 } |
2118 virtual Representation InferredRepresentation() const { | 2010 virtual Representation InferredRepresentation() const { |
2119 if (left()->representation().Equals(right()->representation())) { | 2011 if (left()->representation().Equals(right()->representation())) { |
2120 return left()->representation(); | 2012 return left()->representation(); |
2121 } | 2013 } |
2122 return HValue::InferredRepresentation(); | 2014 return HValue::InferredRepresentation(); |
2123 } | 2015 } |
2124 | 2016 |
2125 DECLARE_INSTRUCTION(ArithmeticBinaryOperation) | 2017 DECLARE_INSTRUCTION(ArithmeticBinaryOperation) |
2126 }; | 2018 }; |
2127 | 2019 |
2128 | 2020 |
2129 class HCompare: public HBinaryOperation { | 2021 class HCompare: public HBinaryOperation { |
2130 public: | 2022 public: |
2131 HCompare(HValue* left, HValue* right, Token::Value token) | 2023 HCompare(HValue* left, HValue* right, Token::Value token) |
2132 : HBinaryOperation(left, right), token_(token) { | 2024 : HBinaryOperation(left, right), token_(token) { |
2133 ASSERT(Token::IsCompareOp(token)); | 2025 ASSERT(Token::IsCompareOp(token)); |
2134 set_representation(Representation::Tagged()); | 2026 set_representation(Representation::Tagged()); |
2135 SetFlagMask(AllSideEffects()); | 2027 SetAllSideEffects(); |
2136 } | 2028 } |
2137 | 2029 |
2138 void SetInputRepresentation(Representation r); | 2030 void SetInputRepresentation(Representation r); |
2139 virtual bool EmitAtUses() const { return uses()->length() <= 1; } | 2031 virtual bool EmitAtUses() const { return uses()->length() <= 1; } |
2140 virtual Representation RequiredInputRepresentation(int index) const { | 2032 virtual Representation RequiredInputRepresentation(int index) const { |
2141 return input_representation_; | 2033 return input_representation_; |
2142 } | 2034 } |
2143 Representation GetInputRepresentation() const { | 2035 Representation GetInputRepresentation() const { |
2144 return input_representation_; | 2036 return input_representation_; |
2145 } | 2037 } |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2322 | 2214 |
2323 private: | 2215 private: |
2324 Handle<String> type_literal_; | 2216 Handle<String> type_literal_; |
2325 }; | 2217 }; |
2326 | 2218 |
2327 | 2219 |
2328 class HInstanceOf: public HBinaryOperation { | 2220 class HInstanceOf: public HBinaryOperation { |
2329 public: | 2221 public: |
2330 HInstanceOf(HValue* left, HValue* right) : HBinaryOperation(left, right) { | 2222 HInstanceOf(HValue* left, HValue* right) : HBinaryOperation(left, right) { |
2331 set_representation(Representation::Tagged()); | 2223 set_representation(Representation::Tagged()); |
2332 SetFlagMask(AllSideEffects()); | 2224 SetAllSideEffects(); |
2333 } | 2225 } |
2334 | 2226 |
2335 virtual bool EmitAtUses() const { return uses()->length() <= 1; } | 2227 virtual bool EmitAtUses() const { return uses()->length() <= 1; } |
2336 | 2228 |
2337 virtual Representation RequiredInputRepresentation(int index) const { | 2229 virtual Representation RequiredInputRepresentation(int index) const { |
2338 return Representation::Tagged(); | 2230 return Representation::Tagged(); |
2339 } | 2231 } |
2340 | 2232 |
2341 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of") | 2233 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of") |
2342 }; | 2234 }; |
2343 | 2235 |
2344 | 2236 |
2345 class HInstanceOfKnownGlobal: public HUnaryOperation { | 2237 class HInstanceOfKnownGlobal: public HUnaryOperation { |
2346 public: | 2238 public: |
2347 HInstanceOfKnownGlobal(HValue* left, Handle<JSFunction> right) | 2239 HInstanceOfKnownGlobal(HValue* left, Handle<JSFunction> right) |
2348 : HUnaryOperation(left), function_(right) { | 2240 : HUnaryOperation(left), function_(right) { |
2349 set_representation(Representation::Tagged()); | 2241 set_representation(Representation::Tagged()); |
2350 SetFlagMask(AllSideEffects()); | 2242 SetAllSideEffects(); |
2351 } | 2243 } |
2352 | 2244 |
2353 Handle<JSFunction> function() { return function_; } | 2245 Handle<JSFunction> function() { return function_; } |
2354 | 2246 |
2355 virtual Representation RequiredInputRepresentation(int index) const { | 2247 virtual Representation RequiredInputRepresentation(int index) const { |
2356 return Representation::Tagged(); | 2248 return Representation::Tagged(); |
2357 } | 2249 } |
2358 | 2250 |
2359 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, | 2251 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, |
2360 "instance_of_known_global") | 2252 "instance_of_known_global") |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2607 }; | 2499 }; |
2608 | 2500 |
2609 | 2501 |
2610 class HCallStub: public HInstruction { | 2502 class HCallStub: public HInstruction { |
2611 public: | 2503 public: |
2612 HCallStub(CodeStub::Major major_key, int argument_count) | 2504 HCallStub(CodeStub::Major major_key, int argument_count) |
2613 : major_key_(major_key), | 2505 : major_key_(major_key), |
2614 argument_count_(argument_count), | 2506 argument_count_(argument_count), |
2615 transcendental_type_(TranscendentalCache::kNumberOfCaches) { | 2507 transcendental_type_(TranscendentalCache::kNumberOfCaches) { |
2616 set_representation(Representation::Tagged()); | 2508 set_representation(Representation::Tagged()); |
2617 SetFlagMask(AllSideEffects()); | 2509 SetAllSideEffects(); |
2618 } | 2510 } |
2619 | 2511 |
2620 CodeStub::Major major_key() { return major_key_; } | 2512 CodeStub::Major major_key() { return major_key_; } |
2621 int argument_count() { return argument_count_; } | 2513 int argument_count() { return argument_count_; } |
2622 | 2514 |
2623 void set_transcendental_type(TranscendentalCache::Type transcendental_type) { | 2515 void set_transcendental_type(TranscendentalCache::Type transcendental_type) { |
2624 transcendental_type_ = transcendental_type; | 2516 transcendental_type_ = transcendental_type; |
2625 } | 2517 } |
2626 TranscendentalCache::Type transcendental_type() { | 2518 TranscendentalCache::Type transcendental_type() { |
2627 return transcendental_type_; | 2519 return transcendental_type_; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2771 bool is_in_object_; | 2663 bool is_in_object_; |
2772 int offset_; | 2664 int offset_; |
2773 }; | 2665 }; |
2774 | 2666 |
2775 | 2667 |
2776 class HLoadNamedGeneric: public HUnaryOperation { | 2668 class HLoadNamedGeneric: public HUnaryOperation { |
2777 public: | 2669 public: |
2778 HLoadNamedGeneric(HValue* object, Handle<Object> name) | 2670 HLoadNamedGeneric(HValue* object, Handle<Object> name) |
2779 : HUnaryOperation(object), name_(name) { | 2671 : HUnaryOperation(object), name_(name) { |
2780 set_representation(Representation::Tagged()); | 2672 set_representation(Representation::Tagged()); |
2781 SetFlagMask(AllSideEffects()); | 2673 SetAllSideEffects(); |
2782 } | 2674 } |
2783 | 2675 |
2784 HValue* object() const { return OperandAt(0); } | 2676 HValue* object() const { return OperandAt(0); } |
2785 Handle<Object> name() const { return name_; } | 2677 Handle<Object> name() const { return name_; } |
2786 | 2678 |
2787 virtual Representation RequiredInputRepresentation(int index) const { | 2679 virtual Representation RequiredInputRepresentation(int index) const { |
2788 return Representation::Tagged(); | 2680 return Representation::Tagged(); |
2789 } | 2681 } |
2790 | 2682 |
2791 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load_named_generic") | 2683 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load_named_generic") |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2852 "load_keyed_fast_element") | 2744 "load_keyed_fast_element") |
2853 | 2745 |
2854 protected: | 2746 protected: |
2855 virtual bool DataEquals(HValue* other) const { return true; } | 2747 virtual bool DataEquals(HValue* other) const { return true; } |
2856 }; | 2748 }; |
2857 | 2749 |
2858 | 2750 |
2859 class HLoadKeyedGeneric: public HLoadKeyed { | 2751 class HLoadKeyedGeneric: public HLoadKeyed { |
2860 public: | 2752 public: |
2861 HLoadKeyedGeneric(HValue* obj, HValue* key) : HLoadKeyed(obj, key) { | 2753 HLoadKeyedGeneric(HValue* obj, HValue* key) : HLoadKeyed(obj, key) { |
2862 SetFlagMask(AllSideEffects()); | 2754 SetAllSideEffects(); |
2863 } | 2755 } |
2864 | 2756 |
2865 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load_keyed_generic") | 2757 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load_keyed_generic") |
2866 }; | 2758 }; |
2867 | 2759 |
2868 | 2760 |
2869 static inline bool StoringValueNeedsWriteBarrier(HValue* value) { | 2761 static inline bool StoringValueNeedsWriteBarrier(HValue* value) { |
2870 return !value->type().IsSmi() && | 2762 return !value->type().IsSmi() && |
2871 !(value->IsConstant() && HConstant::cast(value)->InOldSpace()); | 2763 !(value->IsConstant() && HConstant::cast(value)->InOldSpace()); |
2872 } | 2764 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2933 bool is_in_object_; | 2825 bool is_in_object_; |
2934 int offset_; | 2826 int offset_; |
2935 Handle<Map> transition_; | 2827 Handle<Map> transition_; |
2936 }; | 2828 }; |
2937 | 2829 |
2938 | 2830 |
2939 class HStoreNamedGeneric: public HStoreNamed { | 2831 class HStoreNamedGeneric: public HStoreNamed { |
2940 public: | 2832 public: |
2941 HStoreNamedGeneric(HValue* obj, Handle<Object> name, HValue* val) | 2833 HStoreNamedGeneric(HValue* obj, Handle<Object> name, HValue* val) |
2942 : HStoreNamed(obj, name, val) { | 2834 : HStoreNamed(obj, name, val) { |
2943 SetFlagMask(AllSideEffects()); | 2835 SetAllSideEffects(); |
2944 } | 2836 } |
2945 | 2837 |
2946 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store_named_generic") | 2838 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store_named_generic") |
2947 }; | 2839 }; |
2948 | 2840 |
2949 | 2841 |
2950 class HStoreKeyed: public HInstruction { | 2842 class HStoreKeyed: public HInstruction { |
2951 public: | 2843 public: |
2952 HStoreKeyed(HValue* obj, HValue* key, HValue* val) { | 2844 HStoreKeyed(HValue* obj, HValue* key, HValue* val) { |
2953 SetOperandAt(0, obj); | 2845 SetOperandAt(0, obj); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2998 | 2890 |
2999 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, | 2891 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, |
3000 "store_keyed_fast_element") | 2892 "store_keyed_fast_element") |
3001 }; | 2893 }; |
3002 | 2894 |
3003 | 2895 |
3004 class HStoreKeyedGeneric: public HStoreKeyed { | 2896 class HStoreKeyedGeneric: public HStoreKeyed { |
3005 public: | 2897 public: |
3006 HStoreKeyedGeneric(HValue* obj, HValue* key, HValue* val) | 2898 HStoreKeyedGeneric(HValue* obj, HValue* key, HValue* val) |
3007 : HStoreKeyed(obj, key, val) { | 2899 : HStoreKeyed(obj, key, val) { |
3008 SetFlagMask(AllSideEffects()); | 2900 SetAllSideEffects(); |
3009 } | 2901 } |
3010 | 2902 |
3011 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic") | 2903 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store_keyed_generic") |
3012 }; | 2904 }; |
3013 | 2905 |
3014 | 2906 |
3015 class HStringCharCodeAt: public HBinaryOperation { | 2907 class HStringCharCodeAt: public HBinaryOperation { |
3016 public: | 2908 public: |
3017 HStringCharCodeAt(HValue* string, HValue* index) | 2909 HStringCharCodeAt(HValue* string, HValue* index) |
3018 : HBinaryOperation(string, index) { | 2910 : HBinaryOperation(string, index) { |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3187 | 3079 |
3188 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value_of") | 3080 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value_of") |
3189 }; | 3081 }; |
3190 | 3082 |
3191 | 3083 |
3192 class HDeleteProperty: public HBinaryOperation { | 3084 class HDeleteProperty: public HBinaryOperation { |
3193 public: | 3085 public: |
3194 HDeleteProperty(HValue* obj, HValue* key) | 3086 HDeleteProperty(HValue* obj, HValue* key) |
3195 : HBinaryOperation(obj, key) { | 3087 : HBinaryOperation(obj, key) { |
3196 set_representation(Representation::Tagged()); | 3088 set_representation(Representation::Tagged()); |
3197 SetFlagMask(AllSideEffects()); | 3089 SetAllSideEffects(); |
3198 } | 3090 } |
3199 | 3091 |
3200 virtual Representation RequiredInputRepresentation(int index) const { | 3092 virtual Representation RequiredInputRepresentation(int index) const { |
3201 return Representation::Tagged(); | 3093 return Representation::Tagged(); |
3202 } | 3094 } |
3203 | 3095 |
3204 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete_property") | 3096 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete_property") |
3205 | 3097 |
3206 HValue* object() const { return left(); } | 3098 HValue* object() const { return left(); } |
3207 HValue* key() const { return right(); } | 3099 HValue* key() const { return right(); } |
3208 }; | 3100 }; |
3209 | 3101 |
3210 #undef DECLARE_INSTRUCTION | 3102 #undef DECLARE_INSTRUCTION |
3211 #undef DECLARE_CONCRETE_INSTRUCTION | 3103 #undef DECLARE_CONCRETE_INSTRUCTION |
3212 | 3104 |
3213 } } // namespace v8::internal | 3105 } } // namespace v8::internal |
3214 | 3106 |
3215 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3107 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |