| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 V(CheckSmi) \ | 72 V(CheckSmi) \ |
| 73 V(ClampDToUint8) \ | 73 V(ClampDToUint8) \ |
| 74 V(ClampIToUint8) \ | 74 V(ClampIToUint8) \ |
| 75 V(ClampTToUint8) \ | 75 V(ClampTToUint8) \ |
| 76 V(ClassOfTestAndBranch) \ | 76 V(ClassOfTestAndBranch) \ |
| 77 V(CompareNumericAndBranch) \ | 77 V(CompareNumericAndBranch) \ |
| 78 V(CmpObjectEqAndBranch) \ | 78 V(CmpObjectEqAndBranch) \ |
| 79 V(CmpMapAndBranch) \ | 79 V(CmpMapAndBranch) \ |
| 80 V(CmpT) \ | 80 V(CmpT) \ |
| 81 V(ConstantD) \ | 81 V(ConstantD) \ |
| 82 V(ConstantE) \ |
| 82 V(ConstantI) \ | 83 V(ConstantI) \ |
| 83 V(ConstantS) \ | 84 V(ConstantS) \ |
| 84 V(ConstantT) \ | 85 V(ConstantT) \ |
| 85 V(Context) \ | 86 V(Context) \ |
| 86 V(DateField) \ | 87 V(DateField) \ |
| 87 V(DebugBreak) \ | 88 V(DebugBreak) \ |
| 88 V(DeclareGlobals) \ | 89 V(DeclareGlobals) \ |
| 89 V(Deoptimize) \ | 90 V(Deoptimize) \ |
| 90 V(DivI) \ | 91 V(DivI) \ |
| 91 V(DoubleToI) \ | 92 V(DoubleToI) \ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 111 V(Integer32ToSmi) \ | 112 V(Integer32ToSmi) \ |
| 112 V(InvokeFunction) \ | 113 V(InvokeFunction) \ |
| 113 V(IsConstructCallAndBranch) \ | 114 V(IsConstructCallAndBranch) \ |
| 114 V(IsObjectAndBranch) \ | 115 V(IsObjectAndBranch) \ |
| 115 V(IsStringAndBranch) \ | 116 V(IsStringAndBranch) \ |
| 116 V(IsSmiAndBranch) \ | 117 V(IsSmiAndBranch) \ |
| 117 V(IsNumberAndBranch) \ | 118 V(IsNumberAndBranch) \ |
| 118 V(IsUndetectableAndBranch) \ | 119 V(IsUndetectableAndBranch) \ |
| 119 V(Label) \ | 120 V(Label) \ |
| 120 V(LazyBailout) \ | 121 V(LazyBailout) \ |
| 121 V(LinkObjectInList) \ | |
| 122 V(LoadContextSlot) \ | 122 V(LoadContextSlot) \ |
| 123 V(LoadExternalArrayPointer) \ | 123 V(LoadExternalArrayPointer) \ |
| 124 V(LoadFieldByIndex) \ | 124 V(LoadFieldByIndex) \ |
| 125 V(LoadFunctionPrototype) \ | 125 V(LoadFunctionPrototype) \ |
| 126 V(LoadGlobalCell) \ | 126 V(LoadGlobalCell) \ |
| 127 V(LoadGlobalGeneric) \ | 127 V(LoadGlobalGeneric) \ |
| 128 V(LoadKeyed) \ | 128 V(LoadKeyed) \ |
| 129 V(LoadKeyedGeneric) \ | 129 V(LoadKeyedGeneric) \ |
| 130 V(LoadNamedField) \ | 130 V(LoadNamedField) \ |
| 131 V(LoadNamedFieldPolymorphic) \ | 131 V(LoadNamedFieldPolymorphic) \ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 V(StoreGlobalCell) \ | 166 V(StoreGlobalCell) \ |
| 167 V(StoreGlobalGeneric) \ | 167 V(StoreGlobalGeneric) \ |
| 168 V(StoreKeyed) \ | 168 V(StoreKeyed) \ |
| 169 V(StoreKeyedGeneric) \ | 169 V(StoreKeyedGeneric) \ |
| 170 V(StoreNamedField) \ | 170 V(StoreNamedField) \ |
| 171 V(StoreNamedGeneric) \ | 171 V(StoreNamedGeneric) \ |
| 172 V(StringAdd) \ | 172 V(StringAdd) \ |
| 173 V(StringCharCodeAt) \ | 173 V(StringCharCodeAt) \ |
| 174 V(StringCharFromCode) \ | 174 V(StringCharFromCode) \ |
| 175 V(StringCompareAndBranch) \ | 175 V(StringCompareAndBranch) \ |
| 176 V(StringLength) \ | |
| 177 V(SubI) \ | 176 V(SubI) \ |
| 178 V(TaggedToI) \ | 177 V(TaggedToI) \ |
| 179 V(ThisFunction) \ | 178 V(ThisFunction) \ |
| 180 V(Throw) \ | 179 V(Throw) \ |
| 181 V(ToFastProperties) \ | 180 V(ToFastProperties) \ |
| 182 V(TransitionElementsKind) \ | 181 V(TransitionElementsKind) \ |
| 183 V(TrapAllocationMemento) \ | 182 V(TrapAllocationMemento) \ |
| 184 V(Typeof) \ | 183 V(Typeof) \ |
| 185 V(TypeofIsAndBranch) \ | 184 V(TypeofIsAndBranch) \ |
| 186 V(Uint32ToDouble) \ | 185 V(Uint32ToDouble) \ |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 bool ClobbersTemps() const { return is_call_; } | 258 bool ClobbersTemps() const { return is_call_; } |
| 260 bool ClobbersRegisters() const { return is_call_; } | 259 bool ClobbersRegisters() const { return is_call_; } |
| 261 bool ClobbersDoubleRegisters() const { return is_call_; } | 260 bool ClobbersDoubleRegisters() const { return is_call_; } |
| 262 | 261 |
| 263 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 262 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
| 264 | 263 |
| 265 // Interface to the register allocator and iterators. | 264 // Interface to the register allocator and iterators. |
| 266 bool IsMarkedAsCall() const { return is_call_; } | 265 bool IsMarkedAsCall() const { return is_call_; } |
| 267 | 266 |
| 268 virtual bool HasResult() const = 0; | 267 virtual bool HasResult() const = 0; |
| 269 virtual LOperand* result() = 0; | 268 virtual LOperand* result() const = 0; |
| 270 | 269 |
| 271 LOperand* FirstInput() { return InputAt(0); } | 270 LOperand* FirstInput() { return InputAt(0); } |
| 272 LOperand* Output() { return HasResult() ? result() : NULL; } | 271 LOperand* Output() { return HasResult() ? result() : NULL; } |
| 273 | 272 |
| 274 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } | 273 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
| 275 | 274 |
| 276 #ifdef DEBUG | 275 #ifdef DEBUG |
| 277 void VerifyCall(); | 276 void VerifyCall(); |
| 278 #endif | 277 #endif |
| 279 | 278 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 295 | 294 |
| 296 | 295 |
| 297 // R = number of result operands (0 or 1). | 296 // R = number of result operands (0 or 1). |
| 298 // I = number of input operands. | 297 // I = number of input operands. |
| 299 // T = number of temporary operands. | 298 // T = number of temporary operands. |
| 300 template<int R, int I, int T> | 299 template<int R, int I, int T> |
| 301 class LTemplateInstruction: public LInstruction { | 300 class LTemplateInstruction: public LInstruction { |
| 302 public: | 301 public: |
| 303 // Allow 0 or 1 output operands. | 302 // Allow 0 or 1 output operands. |
| 304 STATIC_ASSERT(R == 0 || R == 1); | 303 STATIC_ASSERT(R == 0 || R == 1); |
| 305 virtual bool HasResult() const { return R != 0; } | 304 virtual bool HasResult() const { return R != 0 && result() != NULL; } |
| 306 void set_result(LOperand* operand) { results_[0] = operand; } | 305 void set_result(LOperand* operand) { results_[0] = operand; } |
| 307 LOperand* result() { return results_[0]; } | 306 LOperand* result() const { return results_[0]; } |
| 308 | 307 |
| 309 protected: | 308 protected: |
| 310 EmbeddedContainer<LOperand*, R> results_; | 309 EmbeddedContainer<LOperand*, R> results_; |
| 311 EmbeddedContainer<LOperand*, I> inputs_; | 310 EmbeddedContainer<LOperand*, I> inputs_; |
| 312 EmbeddedContainer<LOperand*, T> temps_; | 311 EmbeddedContainer<LOperand*, T> temps_; |
| 313 | 312 |
| 314 private: | 313 private: |
| 315 // Iterator support. | 314 // Iterator support. |
| 316 virtual int InputCount() { return I; } | 315 virtual int InputCount() { return I; } |
| 317 virtual LOperand* InputAt(int i) { return inputs_[i]; } | 316 virtual LOperand* InputAt(int i) { return inputs_[i]; } |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 | 1158 |
| 1160 LOperand* temp() { return temps_[0]; } | 1159 LOperand* temp() { return temps_[0]; } |
| 1161 | 1160 |
| 1162 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") | 1161 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") |
| 1163 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1162 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1164 | 1163 |
| 1165 double value() const { return hydrogen()->DoubleValue(); } | 1164 double value() const { return hydrogen()->DoubleValue(); } |
| 1166 }; | 1165 }; |
| 1167 | 1166 |
| 1168 | 1167 |
| 1168 class LConstantE: public LTemplateInstruction<1, 0, 0> { |
| 1169 public: |
| 1170 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") |
| 1171 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1172 |
| 1173 ExternalReference value() const { |
| 1174 return hydrogen()->ExternalReferenceValue(); |
| 1175 } |
| 1176 }; |
| 1177 |
| 1178 |
| 1169 class LConstantT: public LTemplateInstruction<1, 0, 0> { | 1179 class LConstantT: public LTemplateInstruction<1, 0, 0> { |
| 1170 public: | 1180 public: |
| 1171 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | 1181 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
| 1172 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1182 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1173 | 1183 |
| 1174 Handle<Object> value() const { return hydrogen()->handle(); } | 1184 Handle<Object> value() const { return hydrogen()->handle(); } |
| 1175 }; | 1185 }; |
| 1176 | 1186 |
| 1177 | 1187 |
| 1178 class LBranch: public LControlInstruction<1, 0> { | 1188 class LBranch: public LControlInstruction<1, 0> { |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 LOperand* value() { return inputs_[1]; } | 1604 LOperand* value() { return inputs_[1]; } |
| 1595 | 1605 |
| 1596 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic") | 1606 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic") |
| 1597 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric) | 1607 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric) |
| 1598 | 1608 |
| 1599 Handle<Object> name() const { return hydrogen()->name(); } | 1609 Handle<Object> name() const { return hydrogen()->name(); } |
| 1600 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } | 1610 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } |
| 1601 }; | 1611 }; |
| 1602 | 1612 |
| 1603 | 1613 |
| 1604 class LLinkObjectInList: public LTemplateInstruction<0, 1, 0> { | |
| 1605 public: | |
| 1606 explicit LLinkObjectInList(LOperand* object) { | |
| 1607 inputs_[0] = object; | |
| 1608 } | |
| 1609 | |
| 1610 LOperand* object() { return inputs_[0]; } | |
| 1611 | |
| 1612 ExternalReference GetReference(Isolate* isolate); | |
| 1613 | |
| 1614 DECLARE_CONCRETE_INSTRUCTION(LinkObjectInList, "link-object-in-list") | |
| 1615 DECLARE_HYDROGEN_ACCESSOR(LinkObjectInList) | |
| 1616 | |
| 1617 virtual void PrintDataTo(StringStream* stream); | |
| 1618 }; | |
| 1619 | |
| 1620 | |
| 1621 class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { | 1614 class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { |
| 1622 public: | 1615 public: |
| 1623 explicit LLoadContextSlot(LOperand* context) { | 1616 explicit LLoadContextSlot(LOperand* context) { |
| 1624 inputs_[0] = context; | 1617 inputs_[0] = context; |
| 1625 } | 1618 } |
| 1626 | 1619 |
| 1627 LOperand* context() { return inputs_[0]; } | 1620 LOperand* context() { return inputs_[0]; } |
| 1628 | 1621 |
| 1629 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") | 1622 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") |
| 1630 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) | 1623 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2223 inputs_[0] = char_code; | 2216 inputs_[0] = char_code; |
| 2224 } | 2217 } |
| 2225 | 2218 |
| 2226 LOperand* char_code() { return inputs_[0]; } | 2219 LOperand* char_code() { return inputs_[0]; } |
| 2227 | 2220 |
| 2228 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") | 2221 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") |
| 2229 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) | 2222 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) |
| 2230 }; | 2223 }; |
| 2231 | 2224 |
| 2232 | 2225 |
| 2233 class LStringLength: public LTemplateInstruction<1, 1, 0> { | |
| 2234 public: | |
| 2235 explicit LStringLength(LOperand* string) { | |
| 2236 inputs_[0] = string; | |
| 2237 } | |
| 2238 | |
| 2239 LOperand* string() { return inputs_[0]; } | |
| 2240 | |
| 2241 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") | |
| 2242 DECLARE_HYDROGEN_ACCESSOR(StringLength) | |
| 2243 }; | |
| 2244 | |
| 2245 | |
| 2246 class LCheckFunction: public LTemplateInstruction<0, 1, 0> { | 2226 class LCheckFunction: public LTemplateInstruction<0, 1, 0> { |
| 2247 public: | 2227 public: |
| 2248 explicit LCheckFunction(LOperand* value) { | 2228 explicit LCheckFunction(LOperand* value) { |
| 2249 inputs_[0] = value; | 2229 inputs_[0] = value; |
| 2250 } | 2230 } |
| 2251 | 2231 |
| 2252 LOperand* value() { return inputs_[0]; } | 2232 LOperand* value() { return inputs_[0]; } |
| 2253 | 2233 |
| 2254 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") | 2234 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") |
| 2255 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) | 2235 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2586 LPlatformChunk* chunk() const { return chunk_; } | 2566 LPlatformChunk* chunk() const { return chunk_; } |
| 2587 CompilationInfo* info() const { return info_; } | 2567 CompilationInfo* info() const { return info_; } |
| 2588 HGraph* graph() const { return graph_; } | 2568 HGraph* graph() const { return graph_; } |
| 2589 Zone* zone() const { return zone_; } | 2569 Zone* zone() const { return zone_; } |
| 2590 | 2570 |
| 2591 bool is_unused() const { return status_ == UNUSED; } | 2571 bool is_unused() const { return status_ == UNUSED; } |
| 2592 bool is_building() const { return status_ == BUILDING; } | 2572 bool is_building() const { return status_ == BUILDING; } |
| 2593 bool is_done() const { return status_ == DONE; } | 2573 bool is_done() const { return status_ == DONE; } |
| 2594 bool is_aborted() const { return status_ == ABORTED; } | 2574 bool is_aborted() const { return status_ == ABORTED; } |
| 2595 | 2575 |
| 2596 void Abort(const char* reason); | 2576 void Abort(BailoutReason reason); |
| 2597 | 2577 |
| 2598 // Methods for getting operands for Use / Define / Temp. | 2578 // Methods for getting operands for Use / Define / Temp. |
| 2599 LUnallocated* ToUnallocated(Register reg); | 2579 LUnallocated* ToUnallocated(Register reg); |
| 2600 LUnallocated* ToUnallocated(XMMRegister reg); | 2580 LUnallocated* ToUnallocated(XMMRegister reg); |
| 2601 | 2581 |
| 2602 // Methods for setting up define-use relationships. | 2582 // Methods for setting up define-use relationships. |
| 2603 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); | 2583 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); |
| 2604 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); | 2584 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); |
| 2605 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, | 2585 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, |
| 2606 XMMRegister fixed_register); | 2586 XMMRegister fixed_register); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2706 | 2686 |
| 2707 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2687 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2708 }; | 2688 }; |
| 2709 | 2689 |
| 2710 #undef DECLARE_HYDROGEN_ACCESSOR | 2690 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2711 #undef DECLARE_CONCRETE_INSTRUCTION | 2691 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2712 | 2692 |
| 2713 } } // namespace v8::int | 2693 } } // namespace v8::int |
| 2714 | 2694 |
| 2715 #endif // V8_X64_LITHIUM_X64_H_ | 2695 #endif // V8_X64_LITHIUM_X64_H_ |
| OLD | NEW |