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

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

Issue 236843002: Revert "Track field types." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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
« no previous file with comments | « src/hydrogen-check-elimination.cc ('k') | src/hydrogen-instructions.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 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 6126 matching lines...) Expand 10 before | Expand all | Expand 10 after
6137 inline Portion portion() const { 6137 inline Portion portion() const {
6138 return PortionField::decode(value_); 6138 return PortionField::decode(value_);
6139 } 6139 }
6140 }; 6140 };
6141 6141
6142 6142
6143 class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> { 6143 class HLoadNamedField V8_FINAL : public HTemplateInstruction<2> {
6144 public: 6144 public:
6145 DECLARE_INSTRUCTION_FACTORY_P3(HLoadNamedField, HValue*, HValue*, 6145 DECLARE_INSTRUCTION_FACTORY_P3(HLoadNamedField, HValue*, HValue*,
6146 HObjectAccess); 6146 HObjectAccess);
6147 DECLARE_INSTRUCTION_FACTORY_P4(HLoadNamedField, HValue*, HValue*,
6148 HObjectAccess, Handle<Map>);
6149 6147
6150 HValue* object() { return OperandAt(0); } 6148 HValue* object() { return OperandAt(0); }
6151 HValue* dependency() { 6149 HValue* dependency() {
6152 ASSERT(HasDependency()); 6150 ASSERT(HasDependency());
6153 return OperandAt(1); 6151 return OperandAt(1);
6154 } 6152 }
6155 bool HasDependency() const { return OperandAt(0) != OperandAt(1); } 6153 bool HasDependency() const { return OperandAt(0) != OperandAt(1); }
6156 HObjectAccess access() const { return access_; } 6154 HObjectAccess access() const { return access_; }
6157 Representation field_representation() const { 6155 Representation field_representation() const {
6158 return access_.representation(); 6156 return access_.representation();
6159 } 6157 }
6160 6158
6161 Unique<Map> map() const { return map_; }
6162
6163 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { return false; } 6159 virtual bool HasEscapingOperandAt(int index) V8_OVERRIDE { return false; }
6164 virtual bool HasOutOfBoundsAccess(int size) V8_OVERRIDE { 6160 virtual bool HasOutOfBoundsAccess(int size) V8_OVERRIDE {
6165 return !access().IsInobject() || access().offset() >= size; 6161 return !access().IsInobject() || access().offset() >= size;
6166 } 6162 }
6167 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 6163 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
6168 if (index == 0 && access().IsExternalMemory()) { 6164 if (index == 0 && access().IsExternalMemory()) {
6169 // object must be external in case of external memory access 6165 // object must be external in case of external memory access
6170 return Representation::External(); 6166 return Representation::External();
6171 } 6167 }
6172 return Representation::Tagged(); 6168 return Representation::Tagged();
6173 } 6169 }
6174 virtual Range* InferRange(Zone* zone) V8_OVERRIDE; 6170 virtual Range* InferRange(Zone* zone) V8_OVERRIDE;
6175 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 6171 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
6176 6172
6177 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField) 6173 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField)
6178 6174
6179 protected: 6175 protected:
6180 virtual bool DataEquals(HValue* other) V8_OVERRIDE { 6176 virtual bool DataEquals(HValue* other) V8_OVERRIDE {
6181 HLoadNamedField* b = HLoadNamedField::cast(other); 6177 HLoadNamedField* b = HLoadNamedField::cast(other);
6182 return access_.Equals(b->access_) && map_ == b->map_; 6178 return access_.Equals(b->access_);
6183 } 6179 }
6184 6180
6185 private: 6181 private:
6186 HLoadNamedField(HValue* object, 6182 HLoadNamedField(HValue* object,
6187 HValue* dependency, 6183 HValue* dependency,
6188 HObjectAccess access, 6184 HObjectAccess access) : access_(access) {
6189 Handle<Map> map = Handle<Map>::null())
6190 : access_(access), map_(map) {
6191 ASSERT(object != NULL); 6185 ASSERT(object != NULL);
6192 SetOperandAt(0, object); 6186 SetOperandAt(0, object);
6193 SetOperandAt(1, dependency != NULL ? dependency : object); 6187 SetOperandAt(1, dependency != NULL ? dependency : object);
6194 6188
6195 Representation representation = access.representation(); 6189 Representation representation = access.representation();
6196 if (representation.IsInteger8() || 6190 if (representation.IsInteger8() ||
6197 representation.IsUInteger8() || 6191 representation.IsUInteger8() ||
6198 representation.IsInteger16() || 6192 representation.IsInteger16() ||
6199 representation.IsUInteger16()) { 6193 representation.IsUInteger16()) {
6200 set_representation(Representation::Integer32()); 6194 set_representation(Representation::Integer32());
(...skipping 13 matching lines...) Expand all
6214 set_representation(Representation::Tagged()); 6208 set_representation(Representation::Tagged());
6215 } else { 6209 } else {
6216 set_representation(Representation::Tagged()); 6210 set_representation(Representation::Tagged());
6217 } 6211 }
6218 access.SetGVNFlags(this, LOAD); 6212 access.SetGVNFlags(this, LOAD);
6219 } 6213 }
6220 6214
6221 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 6215 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
6222 6216
6223 HObjectAccess access_; 6217 HObjectAccess access_;
6224 Unique<Map> map_;
6225 }; 6218 };
6226 6219
6227 6220
6228 class HLoadNamedGeneric V8_FINAL : public HTemplateInstruction<2> { 6221 class HLoadNamedGeneric V8_FINAL : public HTemplateInstruction<2> {
6229 public: 6222 public:
6230 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*, 6223 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HLoadNamedGeneric, HValue*,
6231 Handle<Object>); 6224 Handle<Object>);
6232 6225
6233 HValue* context() { return OperandAt(0); } 6226 HValue* context() { return OperandAt(0); }
6234 HValue* object() { return OperandAt(1); } 6227 HValue* object() { return OperandAt(1); }
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after
7546 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7539 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7547 }; 7540 };
7548 7541
7549 7542
7550 #undef DECLARE_INSTRUCTION 7543 #undef DECLARE_INSTRUCTION
7551 #undef DECLARE_CONCRETE_INSTRUCTION 7544 #undef DECLARE_CONCRETE_INSTRUCTION
7552 7545
7553 } } // namespace v8::internal 7546 } } // namespace v8::internal
7554 7547
7555 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7548 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen-check-elimination.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698