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 // 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 6514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6525 if (index == 0 && access().IsExternalMemory()) { | 6525 if (index == 0 && access().IsExternalMemory()) { |
| 6526 // object must be external in case of external memory access | 6526 // object must be external in case of external memory access |
| 6527 return Representation::External(); | 6527 return Representation::External(); |
| 6528 } else if (index == 1) { | 6528 } else if (index == 1) { |
| 6529 if (field_representation().IsInteger8() || | 6529 if (field_representation().IsInteger8() || |
| 6530 field_representation().IsUInteger8() || | 6530 field_representation().IsUInteger8() || |
| 6531 field_representation().IsInteger16() || | 6531 field_representation().IsInteger16() || |
| 6532 field_representation().IsUInteger16() || | 6532 field_representation().IsUInteger16() || |
| 6533 field_representation().IsInteger32()) { | 6533 field_representation().IsInteger32()) { |
| 6534 return Representation::Integer32(); | 6534 return Representation::Integer32(); |
| 6535 } else if (field_representation().IsDouble() || | 6535 } else if (field_representation().IsDouble()) { |
| 6536 field_representation().IsSmi()) { | 6536 return field_representation(); |
| 6537 } else if (field_representation().IsSmi()) { | |
| 6538 if (SmiValuesAre32Bits()) { | |
| 6539 return Representation::Integer32(); | |
| 6540 } | |
| 6537 return field_representation(); | 6541 return field_representation(); |
| 6538 } else if (field_representation().IsExternal()) { | 6542 } else if (field_representation().IsExternal()) { |
| 6539 return Representation::External(); | 6543 return Representation::External(); |
| 6540 } | 6544 } |
| 6541 } | 6545 } |
| 6542 return Representation::Tagged(); | 6546 return Representation::Tagged(); |
| 6543 } | 6547 } |
| 6544 virtual void HandleSideEffectDominator(GVNFlag side_effect, | 6548 virtual void HandleSideEffectDominator(GVNFlag side_effect, |
| 6545 HValue* dominator) V8_OVERRIDE { | 6549 HValue* dominator) V8_OVERRIDE { |
| 6546 ASSERT(side_effect == kChangesNewSpacePromotion); | 6550 ASSERT(side_effect == kChangesNewSpacePromotion); |
| 6547 new_space_dominator_ = dominator; | 6551 new_space_dominator_ = dominator; |
| 6548 } | 6552 } |
| 6549 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 6553 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 6550 | 6554 |
| 6551 void SkipWriteBarrier() { write_barrier_mode_ = SKIP_WRITE_BARRIER; } | 6555 void SkipWriteBarrier() { write_barrier_mode_ = SKIP_WRITE_BARRIER; } |
| 6552 bool IsSkipWriteBarrier() const { | 6556 bool IsSkipWriteBarrier() const { |
| 6553 return write_barrier_mode_ == SKIP_WRITE_BARRIER; | 6557 return write_barrier_mode_ == SKIP_WRITE_BARRIER; |
| 6554 } | 6558 } |
| 6555 | 6559 |
| 6556 HValue* object() const { return OperandAt(0); } | 6560 HValue* object() const { return OperandAt(0); } |
| 6557 HValue* value() const { return OperandAt(1); } | 6561 HValue* value() const { return OperandAt(1); } |
| 6558 HValue* transition() const { return OperandAt(2); } | 6562 HValue* transition() const { return OperandAt(2); } |
| 6559 | 6563 |
| 6560 HObjectAccess access() const { return access_; } | 6564 HObjectAccess access() const { return access_; } |
| 6561 HValue* new_space_dominator() const { return new_space_dominator_; } | 6565 HValue* new_space_dominator() const { return new_space_dominator_; } |
| 6562 bool has_transition() const { return has_transition_; } | 6566 bool has_transition() const { return has_transition_; } |
| 6563 | 6567 |
| 6568 // Controls whether it is guaranteed that the smi word already contains | |
| 6569 // correct smi tag (currently applicable only for x64). | |
| 6570 bool can_omit_smi_tag_store() const { return can_omit_smi_tag_store_; } | |
| 6571 void set_can_omit_smi_tag_store(bool v) { can_omit_smi_tag_store_ = v; } | |
|
Toon Verwaest
2013/12/09 15:51:10
I'd rather distinguish between "initializing store
Igor Sheludko
2013/12/10 09:13:08
Good suggestion! Done.
| |
| 6572 | |
| 6564 Handle<Map> transition_map() const { | 6573 Handle<Map> transition_map() const { |
| 6565 if (has_transition()) { | 6574 if (has_transition()) { |
| 6566 return Handle<Map>::cast( | 6575 return Handle<Map>::cast( |
| 6567 HConstant::cast(transition())->handle(Isolate::Current())); | 6576 HConstant::cast(transition())->handle(Isolate::Current())); |
| 6568 } else { | 6577 } else { |
| 6569 return Handle<Map>(); | 6578 return Handle<Map>(); |
| 6570 } | 6579 } |
| 6571 } | 6580 } |
| 6572 | 6581 |
| 6573 void SetTransition(HConstant* map_constant, CompilationInfo* info) { | 6582 void SetTransition(HConstant* map_constant, CompilationInfo* info) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6607 SetOperandAt(1, value); | 6616 SetOperandAt(1, value); |
| 6608 } | 6617 } |
| 6609 | 6618 |
| 6610 private: | 6619 private: |
| 6611 HStoreNamedField(HValue* obj, | 6620 HStoreNamedField(HValue* obj, |
| 6612 HObjectAccess access, | 6621 HObjectAccess access, |
| 6613 HValue* val) | 6622 HValue* val) |
| 6614 : access_(access), | 6623 : access_(access), |
| 6615 new_space_dominator_(NULL), | 6624 new_space_dominator_(NULL), |
| 6616 write_barrier_mode_(UPDATE_WRITE_BARRIER), | 6625 write_barrier_mode_(UPDATE_WRITE_BARRIER), |
| 6617 has_transition_(false) { | 6626 has_transition_(false), |
| 6627 can_omit_smi_tag_store_(false) { | |
| 6618 SetOperandAt(0, obj); | 6628 SetOperandAt(0, obj); |
| 6619 SetOperandAt(1, val); | 6629 SetOperandAt(1, val); |
| 6620 SetOperandAt(2, obj); | 6630 SetOperandAt(2, obj); |
| 6621 access.SetGVNFlags(this, true); | 6631 access.SetGVNFlags(this, true); |
| 6622 } | 6632 } |
| 6623 | 6633 |
| 6624 HObjectAccess access_; | 6634 HObjectAccess access_; |
| 6625 HValue* new_space_dominator_; | 6635 HValue* new_space_dominator_; |
| 6626 WriteBarrierMode write_barrier_mode_ : 1; | 6636 WriteBarrierMode write_barrier_mode_ : 1; |
| 6627 bool has_transition_ : 1; | 6637 bool has_transition_ : 1; |
| 6638 bool can_omit_smi_tag_store_ : 1; | |
| 6628 }; | 6639 }; |
| 6629 | 6640 |
| 6630 | 6641 |
| 6631 class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> { | 6642 class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> { |
| 6632 public: | 6643 public: |
| 6633 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, | 6644 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, |
| 6634 Handle<String>, HValue*, | 6645 Handle<String>, HValue*, |
| 6635 StrictModeFlag); | 6646 StrictModeFlag); |
| 6636 HValue* object() { return OperandAt(0); } | 6647 HValue* object() { return OperandAt(0); } |
| 6637 HValue* value() { return OperandAt(1); } | 6648 HValue* value() { return OperandAt(1); } |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7489 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7500 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7490 }; | 7501 }; |
| 7491 | 7502 |
| 7492 | 7503 |
| 7493 #undef DECLARE_INSTRUCTION | 7504 #undef DECLARE_INSTRUCTION |
| 7494 #undef DECLARE_CONCRETE_INSTRUCTION | 7505 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7495 | 7506 |
| 7496 } } // namespace v8::internal | 7507 } } // namespace v8::internal |
| 7497 | 7508 |
| 7498 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7509 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |