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

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

Issue 25696004: Add support to load/store byte fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
OLDNEW
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 5874 matching lines...) Expand 10 before | Expand all | Expand 10 after
5885 HLoadNamedField* b = HLoadNamedField::cast(other); 5885 HLoadNamedField* b = HLoadNamedField::cast(other);
5886 return access_.Equals(b->access_); 5886 return access_.Equals(b->access_);
5887 } 5887 }
5888 5888
5889 private: 5889 private:
5890 HLoadNamedField(HValue* object, HObjectAccess access) : access_(access) { 5890 HLoadNamedField(HValue* object, HObjectAccess access) : access_(access) {
5891 ASSERT(object != NULL); 5891 ASSERT(object != NULL);
5892 SetOperandAt(0, object); 5892 SetOperandAt(0, object);
5893 5893
5894 Representation representation = access.representation(); 5894 Representation representation = access.representation();
5895 if (representation.IsSmi()) { 5895 if (representation.IsByte()) {
5896 set_representation(Representation::Integer32());
5897 } else if (representation.IsSmi()) {
5896 set_type(HType::Smi()); 5898 set_type(HType::Smi());
5897 set_representation(representation); 5899 set_representation(representation);
5898 } else if (representation.IsDouble() || 5900 } else if (representation.IsDouble() ||
5899 representation.IsExternal() || 5901 representation.IsExternal() ||
5900 representation.IsInteger32()) { 5902 representation.IsInteger32()) {
5901 set_representation(representation); 5903 set_representation(representation);
5902 } else if (FLAG_track_heap_object_fields && 5904 } else if (FLAG_track_heap_object_fields &&
5903 representation.IsHeapObject()) { 5905 representation.IsHeapObject()) {
5904 set_type(HType::NonPrimitive()); 5906 set_type(HType::NonPrimitive());
5905 set_representation(Representation::Tagged()); 5907 set_representation(Representation::Tagged());
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
6183 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { 6185 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE {
6184 return index == 1; 6186 return index == 1;
6185 } 6187 }
6186 virtual bool HasOutOfBoundsAccess(int size) V8_OVERRIDE { 6188 virtual bool HasOutOfBoundsAccess(int size) V8_OVERRIDE {
6187 return !access().IsInobject() || access().offset() >= size; 6189 return !access().IsInobject() || access().offset() >= size;
6188 } 6190 }
6189 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 6191 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
6190 if (index == 0 && access().IsExternalMemory()) { 6192 if (index == 0 && access().IsExternalMemory()) {
6191 // object must be external in case of external memory access 6193 // object must be external in case of external memory access
6192 return Representation::External(); 6194 return Representation::External();
6193 } else if (index == 1 && 6195 } else if (index == 1) {
6194 (field_representation().IsDouble() || 6196 if (field_representation().IsByte() ||
6195 field_representation().IsSmi() || 6197 field_representation().IsInteger32()) {
6196 field_representation().IsInteger32())) { 6198 return Representation::Integer32();
6197 return field_representation(); 6199 } else if (field_representation().IsDouble() ||
6200 field_representation().IsSmi()) {
6201 return field_representation();
6202 }
6198 } 6203 }
6199 return Representation::Tagged(); 6204 return Representation::Tagged();
6200 } 6205 }
6201 virtual void HandleSideEffectDominator(GVNFlag side_effect, 6206 virtual void HandleSideEffectDominator(GVNFlag side_effect,
6202 HValue* dominator) V8_OVERRIDE { 6207 HValue* dominator) V8_OVERRIDE {
6203 ASSERT(side_effect == kChangesNewSpacePromotion); 6208 ASSERT(side_effect == kChangesNewSpacePromotion);
6204 new_space_dominator_ = dominator; 6209 new_space_dominator_ = dominator;
6205 } 6210 }
6206 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 6211 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
6207 6212
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
7064 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7069 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7065 }; 7070 };
7066 7071
7067 7072
7068 #undef DECLARE_INSTRUCTION 7073 #undef DECLARE_INSTRUCTION
7069 #undef DECLARE_CONCRETE_INSTRUCTION 7074 #undef DECLARE_CONCRETE_INSTRUCTION
7070 7075
7071 } } // namespace v8::internal 7076 } } // namespace v8::internal
7072 7077
7073 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7078 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698