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

Side by Side Diff: src/hydrogen-instructions.h

Issue 8002019: Add Crankshaft support for smi-only elements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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
« src/hydrogen.cc ('K') | « src/hydrogen.cc ('k') | src/ic.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 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 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 } 901 }
902 902
903 private: 903 private:
904 ZoneList<HValue*> values_; 904 ZoneList<HValue*> values_;
905 }; 905 };
906 906
907 907
908 class HGoto: public HTemplateControlInstruction<1, 0> { 908 class HGoto: public HTemplateControlInstruction<1, 0> {
909 public: 909 public:
910 explicit HGoto(HBasicBlock* target) { 910 explicit HGoto(HBasicBlock* target) {
911 SetSuccessorAt(0, target); 911 SetSuccessorAt(0, target);
912 } 912 }
913 913
914 virtual Representation RequiredInputRepresentation(int index) const { 914 virtual Representation RequiredInputRepresentation(int index) const {
915 return Representation::None(); 915 return Representation::None();
916 } 916 }
917 917
918 virtual void PrintDataTo(StringStream* stream); 918 virtual void PrintDataTo(StringStream* stream);
919 919
920 DECLARE_CONCRETE_INSTRUCTION(Goto) 920 DECLARE_CONCRETE_INSTRUCTION(Goto)
921 }; 921 };
922 922
(...skipping 2802 matching lines...) Expand 10 before | Expand all | Expand 10 after
3725 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) 3725 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric)
3726 3726
3727 private: 3727 private:
3728 Handle<String> name_; 3728 Handle<String> name_;
3729 bool strict_mode_; 3729 bool strict_mode_;
3730 }; 3730 };
3731 3731
3732 3732
3733 class HStoreKeyedFastElement: public HTemplateInstruction<3> { 3733 class HStoreKeyedFastElement: public HTemplateInstruction<3> {
3734 public: 3734 public:
3735 HStoreKeyedFastElement(HValue* obj, HValue* key, HValue* val) { 3735 enum ValueType { VALUE_IS_SMI, GENERIC_VALUE };
3736 HStoreKeyedFastElement(HValue* obj, HValue* key, HValue* val,
3737 ValueType value_type = GENERIC_VALUE)
danno 2011/09/23 09:05:24 Why not just use ElementKind here?
Jakob Kummerow 2011/09/26 11:30:32 Done.
3738 : value_type_(value_type) {
3736 SetOperandAt(0, obj); 3739 SetOperandAt(0, obj);
3737 SetOperandAt(1, key); 3740 SetOperandAt(1, key);
3738 SetOperandAt(2, val); 3741 SetOperandAt(2, val);
3739 SetFlag(kChangesArrayElements); 3742 SetFlag(kChangesArrayElements);
3740 } 3743 }
3741 3744
3742 virtual Representation RequiredInputRepresentation(int index) const { 3745 virtual Representation RequiredInputRepresentation(int index) const {
3743 // The key is supposed to be Integer32. 3746 // The key is supposed to be Integer32.
3744 return index == 1 3747 return index == 1
3745 ? Representation::Integer32() 3748 ? Representation::Integer32()
3746 : Representation::Tagged(); 3749 : Representation::Tagged();
3747 } 3750 }
3748 3751
3749 HValue* object() { return OperandAt(0); } 3752 HValue* object() { return OperandAt(0); }
3750 HValue* key() { return OperandAt(1); } 3753 HValue* key() { return OperandAt(1); }
3751 HValue* value() { return OperandAt(2); } 3754 HValue* value() { return OperandAt(2); }
3755 bool value_is_smi() {
3756 return value_type_ == VALUE_IS_SMI;
3757 }
3752 3758
3753 bool NeedsWriteBarrier() { 3759 bool NeedsWriteBarrier() {
3754 return StoringValueNeedsWriteBarrier(value()); 3760 if (value_is_smi()) {
3761 return false;
3762 } else {
3763 return StoringValueNeedsWriteBarrier(value());
3764 }
3755 } 3765 }
3756 3766
3757 virtual void PrintDataTo(StringStream* stream); 3767 virtual void PrintDataTo(StringStream* stream);
3758 3768
3759 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement) 3769 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement)
3770
3771 private:
3772 ValueType value_type_;
3760 }; 3773 };
3761 3774
3762 3775
3763 class HStoreKeyedFastDoubleElement: public HTemplateInstruction<3> { 3776 class HStoreKeyedFastDoubleElement: public HTemplateInstruction<3> {
3764 public: 3777 public:
3765 HStoreKeyedFastDoubleElement(HValue* elements, 3778 HStoreKeyedFastDoubleElement(HValue* elements,
3766 HValue* key, 3779 HValue* key,
3767 HValue* val) { 3780 HValue* val) {
3768 SetOperandAt(0, elements); 3781 SetOperandAt(0, elements);
3769 SetOperandAt(1, key); 3782 SetOperandAt(1, key);
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
4216 4229
4217 DECLARE_CONCRETE_INSTRUCTION(In) 4230 DECLARE_CONCRETE_INSTRUCTION(In)
4218 }; 4231 };
4219 4232
4220 #undef DECLARE_INSTRUCTION 4233 #undef DECLARE_INSTRUCTION
4221 #undef DECLARE_CONCRETE_INSTRUCTION 4234 #undef DECLARE_CONCRETE_INSTRUCTION
4222 4235
4223 } } // namespace v8::internal 4236 } } // namespace v8::internal
4224 4237
4225 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 4238 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« src/hydrogen.cc ('K') | « src/hydrogen.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698