Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
| 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 5387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5398 | 5398 |
| 5399 class HLoadGlobalGeneric V8_FINAL : public HTemplateInstruction<2> { | 5399 class HLoadGlobalGeneric V8_FINAL : public HTemplateInstruction<2> { |
| 5400 public: | 5400 public: |
| 5401 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*, | 5401 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HLoadGlobalGeneric, HValue*, |
| 5402 Handle<Object>, bool); | 5402 Handle<Object>, bool); |
| 5403 | 5403 |
| 5404 HValue* context() { return OperandAt(0); } | 5404 HValue* context() { return OperandAt(0); } |
| 5405 HValue* global_object() { return OperandAt(1); } | 5405 HValue* global_object() { return OperandAt(1); } |
| 5406 Handle<Object> name() const { return name_; } | 5406 Handle<Object> name() const { return name_; } |
| 5407 bool for_typeof() const { return for_typeof_; } | 5407 bool for_typeof() const { return for_typeof_; } |
| 5408 int slot() const { | |
| 5409 ASSERT(FLAG_vector_ics && slot_ != -1); | |
|
Toon Verwaest
2014/07/18 09:52:16
!= kInvalidFeedbackSlot
mvstanton
2014/07/18 13:35:05
Done.
| |
| 5410 return slot_; | |
| 5411 } | |
| 5412 void set_slot(int slot) { | |
| 5413 ASSERT(FLAG_vector_ics); | |
| 5414 slot_ = slot; | |
| 5415 } | |
| 5408 | 5416 |
| 5409 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 5417 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 5410 | 5418 |
| 5411 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 5419 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 5412 return Representation::Tagged(); | 5420 return Representation::Tagged(); |
| 5413 } | 5421 } |
| 5414 | 5422 |
| 5415 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric) | 5423 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric) |
| 5416 | 5424 |
| 5417 private: | 5425 private: |
| 5418 HLoadGlobalGeneric(HValue* context, | 5426 HLoadGlobalGeneric(HValue* context, |
| 5419 HValue* global_object, | 5427 HValue* global_object, |
| 5420 Handle<Object> name, | 5428 Handle<Object> name, |
| 5421 bool for_typeof) | 5429 bool for_typeof) |
| 5422 : name_(name), | 5430 : name_(name), |
| 5423 for_typeof_(for_typeof) { | 5431 for_typeof_(for_typeof), |
| 5432 slot_(-1) { | |
|
Toon Verwaest
2014/07/18 09:52:16
kInvalidFeedbackSlot
mvstanton
2014/07/18 13:35:05
Done.
| |
| 5424 SetOperandAt(0, context); | 5433 SetOperandAt(0, context); |
| 5425 SetOperandAt(1, global_object); | 5434 SetOperandAt(1, global_object); |
| 5426 set_representation(Representation::Tagged()); | 5435 set_representation(Representation::Tagged()); |
| 5427 SetAllSideEffects(); | 5436 SetAllSideEffects(); |
| 5428 } | 5437 } |
| 5429 | 5438 |
| 5430 Handle<Object> name_; | 5439 Handle<Object> name_; |
| 5431 bool for_typeof_; | 5440 bool for_typeof_; |
| 5441 int slot_; | |
| 5432 }; | 5442 }; |
| 5433 | 5443 |
| 5434 | 5444 |
| 5435 class HAllocate V8_FINAL : public HTemplateInstruction<2> { | 5445 class HAllocate V8_FINAL : public HTemplateInstruction<2> { |
| 5436 public: | 5446 public: |
| 5437 static bool CompatibleInstanceTypes(InstanceType type1, | 5447 static bool CompatibleInstanceTypes(InstanceType type1, |
| 5438 InstanceType type2) { | 5448 InstanceType type2) { |
| 5439 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && | 5449 return ComputeFlags(TENURED, type1) == ComputeFlags(TENURED, type2) && |
| 5440 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); | 5450 ComputeFlags(NOT_TENURED, type1) == ComputeFlags(NOT_TENURED, type2); |
| 5441 } | 5451 } |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6388 | 6398 |
| 6389 class HLoadNamedGeneric V8_FINAL : public HTemplateInstruction<2> { | 6399 class HLoadNamedGeneric V8_FINAL : public HTemplateInstruction<2> { |
| 6390 public: | 6400 public: |
| 6391 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, | 6401 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, |
| 6392 Handle<Object>); | 6402 Handle<Object>); |
| 6393 | 6403 |
| 6394 HValue* context() { return OperandAt(0); } | 6404 HValue* context() { return OperandAt(0); } |
| 6395 HValue* object() { return OperandAt(1); } | 6405 HValue* object() { return OperandAt(1); } |
| 6396 Handle<Object> name() const { return name_; } | 6406 Handle<Object> name() const { return name_; } |
| 6397 | 6407 |
| 6408 int slot() const { | |
| 6409 ASSERT(FLAG_vector_ics && slot_ != -1); | |
|
Toon Verwaest
2014/07/18 09:52:16
kInvalidFeedbackSlot
mvstanton
2014/07/18 13:35:05
Done.
| |
| 6410 return slot_; | |
| 6411 } | |
| 6412 void set_slot(int slot) { | |
| 6413 ASSERT(FLAG_vector_ics); | |
| 6414 slot_ = slot; | |
| 6415 } | |
| 6416 | |
| 6398 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 6417 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 6399 return Representation::Tagged(); | 6418 return Representation::Tagged(); |
| 6400 } | 6419 } |
| 6401 | 6420 |
| 6402 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 6421 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 6403 | 6422 |
| 6404 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) | 6423 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric) |
| 6405 | 6424 |
| 6406 private: | 6425 private: |
| 6407 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) | 6426 HLoadNamedGeneric(HValue* context, HValue* object, Handle<Object> name) |
| 6408 : name_(name) { | 6427 : name_(name), |
| 6428 slot_(-1) { | |
|
Toon Verwaest
2014/07/18 09:52:16
kInvalidFeedbackSlot
mvstanton
2014/07/18 13:35:05
Done.
| |
| 6409 SetOperandAt(0, context); | 6429 SetOperandAt(0, context); |
| 6410 SetOperandAt(1, object); | 6430 SetOperandAt(1, object); |
| 6411 set_representation(Representation::Tagged()); | 6431 set_representation(Representation::Tagged()); |
| 6412 SetAllSideEffects(); | 6432 SetAllSideEffects(); |
| 6413 } | 6433 } |
| 6414 | 6434 |
| 6415 Handle<Object> name_; | 6435 Handle<Object> name_; |
| 6436 int slot_; | |
| 6416 }; | 6437 }; |
| 6417 | 6438 |
| 6418 | 6439 |
| 6419 class HLoadFunctionPrototype V8_FINAL : public HUnaryOperation { | 6440 class HLoadFunctionPrototype V8_FINAL : public HUnaryOperation { |
| 6420 public: | 6441 public: |
| 6421 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); | 6442 DECLARE_INSTRUCTION_FACTORY_P1(HLoadFunctionPrototype, HValue*); |
| 6422 | 6443 |
| 6423 HValue* function() { return OperandAt(0); } | 6444 HValue* function() { return OperandAt(0); } |
| 6424 | 6445 |
| 6425 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 6446 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6651 }; | 6672 }; |
| 6652 | 6673 |
| 6653 | 6674 |
| 6654 class HLoadKeyedGeneric V8_FINAL : public HTemplateInstruction<3> { | 6675 class HLoadKeyedGeneric V8_FINAL : public HTemplateInstruction<3> { |
| 6655 public: | 6676 public: |
| 6656 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*, | 6677 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadKeyedGeneric, HValue*, |
| 6657 HValue*); | 6678 HValue*); |
| 6658 HValue* object() { return OperandAt(0); } | 6679 HValue* object() { return OperandAt(0); } |
| 6659 HValue* key() { return OperandAt(1); } | 6680 HValue* key() { return OperandAt(1); } |
| 6660 HValue* context() { return OperandAt(2); } | 6681 HValue* context() { return OperandAt(2); } |
| 6682 int slot() const { | |
| 6683 ASSERT(FLAG_vector_ics && slot_ != -1); | |
| 6684 return slot_; | |
| 6685 } | |
| 6686 void set_slot(int slot) { | |
| 6687 ASSERT(FLAG_vector_ics); | |
| 6688 slot_ = slot; | |
| 6689 } | |
| 6661 | 6690 |
| 6662 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 6691 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 6663 | 6692 |
| 6664 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 6693 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 6665 // tagged[tagged] | 6694 // tagged[tagged] |
| 6666 return Representation::Tagged(); | 6695 return Representation::Tagged(); |
| 6667 } | 6696 } |
| 6668 | 6697 |
| 6669 virtual HValue* Canonicalize() V8_OVERRIDE; | 6698 virtual HValue* Canonicalize() V8_OVERRIDE; |
| 6670 | 6699 |
| 6671 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) | 6700 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric) |
| 6672 | 6701 |
| 6673 private: | 6702 private: |
| 6674 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) { | 6703 HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key) |
| 6704 : slot_(-1) { | |
| 6675 set_representation(Representation::Tagged()); | 6705 set_representation(Representation::Tagged()); |
| 6676 SetOperandAt(0, obj); | 6706 SetOperandAt(0, obj); |
| 6677 SetOperandAt(1, key); | 6707 SetOperandAt(1, key); |
| 6678 SetOperandAt(2, context); | 6708 SetOperandAt(2, context); |
| 6679 SetAllSideEffects(); | 6709 SetAllSideEffects(); |
| 6680 } | 6710 } |
| 6711 | |
| 6712 int slot_; | |
| 6681 }; | 6713 }; |
| 6682 | 6714 |
| 6683 | 6715 |
| 6684 // Indicates whether the store is a store to an entry that was previously | 6716 // Indicates whether the store is a store to an entry that was previously |
| 6685 // initialized or not. | 6717 // initialized or not. |
| 6686 enum StoreFieldOrKeyedMode { | 6718 enum StoreFieldOrKeyedMode { |
| 6687 // The entry could be either previously initialized or not. | 6719 // The entry could be either previously initialized or not. |
| 6688 INITIALIZING_STORE, | 6720 INITIALIZING_STORE, |
| 6689 // At the time of this store it is guaranteed that the entry is already | 6721 // At the time of this store it is guaranteed that the entry is already |
| 6690 // initialized. | 6722 // initialized. |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7787 }; | 7819 }; |
| 7788 | 7820 |
| 7789 | 7821 |
| 7790 | 7822 |
| 7791 #undef DECLARE_INSTRUCTION | 7823 #undef DECLARE_INSTRUCTION |
| 7792 #undef DECLARE_CONCRETE_INSTRUCTION | 7824 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7793 | 7825 |
| 7794 } } // namespace v8::internal | 7826 } } // namespace v8::internal |
| 7795 | 7827 |
| 7796 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7828 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |