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

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

Issue 137883008: Use PropertyAccessType for keyed accesses rather than "bool is_store" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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.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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 LChunkBuilder* builder) V8_FINAL V8_OVERRIDE; \ 217 LChunkBuilder* builder) V8_FINAL V8_OVERRIDE; \
218 static H##type* cast(HValue* value) { \ 218 static H##type* cast(HValue* value) { \
219 ASSERT(value->Is##type()); \ 219 ASSERT(value->Is##type()); \
220 return reinterpret_cast<H##type*>(value); \ 220 return reinterpret_cast<H##type*>(value); \
221 } \ 221 } \
222 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ 222 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \
223 return HValue::k##type; \ 223 return HValue::k##type; \
224 } 224 }
225 225
226 226
227 enum PropertyAccessType { LOAD, STORE };
228
229
227 class Range V8_FINAL : public ZoneObject { 230 class Range V8_FINAL : public ZoneObject {
228 public: 231 public:
229 Range() 232 Range()
230 : lower_(kMinInt), 233 : lower_(kMinInt),
231 upper_(kMaxInt), 234 upper_(kMaxInt),
232 next_(NULL), 235 next_(NULL),
233 can_be_minus_zero_(false) { } 236 can_be_minus_zero_(false) { }
234 237
235 Range(int32_t lower, int32_t upper) 238 Range(int32_t lower, int32_t upper)
236 : lower_(lower), 239 : lower_(lower),
(...skipping 5728 matching lines...) Expand 10 before | Expand all | Expand 10 after
5965 return HObjectAccess(kInobject, GlobalObject::kNativeContextOffset); 5968 return HObjectAccess(kInobject, GlobalObject::kNativeContextOffset);
5966 } 5969 }
5967 5970
5968 void PrintTo(StringStream* stream); 5971 void PrintTo(StringStream* stream);
5969 5972
5970 inline bool Equals(HObjectAccess that) const { 5973 inline bool Equals(HObjectAccess that) const {
5971 return value_ == that.value_; // portion and offset must match 5974 return value_ == that.value_; // portion and offset must match
5972 } 5975 }
5973 5976
5974 protected: 5977 protected:
5975 void SetGVNFlags(HValue *instr, bool is_store); 5978 void SetGVNFlags(HValue *instr, PropertyAccessType access_type);
5976 5979
5977 private: 5980 private:
5978 // internal use only; different parts of an object or array 5981 // internal use only; different parts of an object or array
5979 enum Portion { 5982 enum Portion {
5980 kMaps, // map of an object 5983 kMaps, // map of an object
5981 kArrayLengths, // the length of an array 5984 kArrayLengths, // the length of an array
5982 kStringLengths, // the length of a string 5985 kStringLengths, // the length of a string
5983 kElementsPointer, // elements pointer 5986 kElementsPointer, // elements pointer
5984 kBackingStore, // some field in the backing store 5987 kBackingStore, // some field in the backing store
5985 kDouble, // some double field 5988 kDouble, // some double field
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
6089 representation.IsExternal() || 6092 representation.IsExternal() ||
6090 representation.IsInteger32()) { 6093 representation.IsInteger32()) {
6091 set_representation(representation); 6094 set_representation(representation);
6092 } else if (FLAG_track_heap_object_fields && 6095 } else if (FLAG_track_heap_object_fields &&
6093 representation.IsHeapObject()) { 6096 representation.IsHeapObject()) {
6094 set_type(HType::NonPrimitive()); 6097 set_type(HType::NonPrimitive());
6095 set_representation(Representation::Tagged()); 6098 set_representation(Representation::Tagged());
6096 } else { 6099 } else {
6097 set_representation(Representation::Tagged()); 6100 set_representation(Representation::Tagged());
6098 } 6101 }
6099 access.SetGVNFlags(this, false); 6102 access.SetGVNFlags(this, LOAD);
6100 } 6103 }
6101 6104
6102 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 6105 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
6103 6106
6104 HObjectAccess access_; 6107 HObjectAccess access_;
6105 }; 6108 };
6106 6109
6107 6110
6108 class HLoadNamedGeneric V8_FINAL : public HTemplateInstruction<2> { 6111 class HLoadNamedGeneric V8_FINAL : public HTemplateInstruction<2> {
6109 public: 6112 public:
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
6524 has_transition_(false), 6527 has_transition_(false),
6525 store_mode_(store_mode) { 6528 store_mode_(store_mode) {
6526 if (!FLAG_smi_x64_store_opt) store_mode_ = INITIALIZING_STORE; 6529 if (!FLAG_smi_x64_store_opt) store_mode_ = INITIALIZING_STORE;
6527 // Stores to a non existing in-object property are allowed only to the 6530 // Stores to a non existing in-object property are allowed only to the
6528 // newly allocated objects (via HAllocate or HInnerAllocatedObject). 6531 // newly allocated objects (via HAllocate or HInnerAllocatedObject).
6529 ASSERT(!access.IsInobject() || access.existing_inobject_property() || 6532 ASSERT(!access.IsInobject() || access.existing_inobject_property() ||
6530 obj->IsAllocate() || obj->IsInnerAllocatedObject()); 6533 obj->IsAllocate() || obj->IsInnerAllocatedObject());
6531 SetOperandAt(0, obj); 6534 SetOperandAt(0, obj);
6532 SetOperandAt(1, val); 6535 SetOperandAt(1, val);
6533 SetOperandAt(2, obj); 6536 SetOperandAt(2, obj);
6534 access.SetGVNFlags(this, true); 6537 access.SetGVNFlags(this, STORE);
6535 } 6538 }
6536 6539
6537 HObjectAccess access_; 6540 HObjectAccess access_;
6538 HValue* new_space_dominator_; 6541 HValue* new_space_dominator_;
6539 WriteBarrierMode write_barrier_mode_ : 1; 6542 WriteBarrierMode write_barrier_mode_ : 1;
6540 bool has_transition_ : 1; 6543 bool has_transition_ : 1;
6541 StoreFieldOrKeyedMode store_mode_ : 1; 6544 StoreFieldOrKeyedMode store_mode_ : 1;
6542 }; 6545 };
6543 6546
6544 6547
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
7425 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7428 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7426 }; 7429 };
7427 7430
7428 7431
7429 #undef DECLARE_INSTRUCTION 7432 #undef DECLARE_INSTRUCTION
7430 #undef DECLARE_CONCRETE_INSTRUCTION 7433 #undef DECLARE_CONCRETE_INSTRUCTION
7431 7434
7432 } } // namespace v8::internal 7435 } } // namespace v8::internal
7433 7436
7434 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7437 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698