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

Unified Diff: src/hydrogen-instructions.cc

Issue 23241027: Avoid setting / depending on flags when transitioning, and when fields are known to be constant. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix size. Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index b0045b8751b06258f0a241416e54615924ea910f..d745e5164664c9894c49492854981183f7ee2597 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -3884,13 +3884,16 @@ HObjectAccess HObjectAccess::ForBackingStoreOffset(int offset,
HObjectAccess HObjectAccess::ForField(Handle<Map> map,
- LookupResult *lookup, Handle<String> name) {
+ LookupResult *lookup,
+ Handle<String> name) {
ASSERT(lookup->IsField() || lookup->IsTransitionToField(*map));
int index;
Representation representation;
+ FieldType field_type;
if (lookup->IsField()) {
index = lookup->GetLocalFieldIndexFromMap(*map);
representation = lookup->representation();
+ field_type = MUTABLE;
} else {
Map* transition = lookup->GetTransitionMapFromMap(*map);
int descriptor = transition->LastAdded();
@@ -3899,17 +3902,21 @@ HObjectAccess HObjectAccess::ForField(Handle<Map> map,
PropertyDetails details =
transition->instance_descriptors()->GetDetails(descriptor);
representation = details.representation();
+ field_type = CONSTANT;
}
+ int offset = index * kPointerSize;
+ Portion portion;
if (index < 0) {
- // Negative property indices are in-object properties, indexed
- // from the end of the fixed part of the object.
- int offset = (index * kPointerSize) + map->instance_size();
- return HObjectAccess(kInobject, offset, representation);
+ // Negative property indices are in-object properties, indexed from the end
+ // of the fixed part of the object.
+ offset += map->instance_size();
+ portion = kInobject;
} else {
// Non-negative property indices are in the properties array.
- int offset = (index * kPointerSize) + FixedArray::kHeaderSize;
- return HObjectAccess(kBackingStore, offset, representation, name);
+ offset += FixedArray::kHeaderSize;
+ portion = kBackingStore;
}
+ return HObjectAccess(portion, offset, representation, name, field_type);
}
@@ -3927,11 +3934,11 @@ void HObjectAccess::SetGVNFlags(HValue *instr, bool is_store) {
instr->SetGVNFlag(kDependsOnNewSpacePromotion);
instr->SetFlag(HValue::kTrackSideEffectDominators);
} else {
- // try to GVN loads, but don't hoist above map changes
instr->SetFlag(HValue::kUseGVN);
- instr->SetGVNFlag(kDependsOnMaps);
}
+ if (FieldTypeField::decode(value_) == CONSTANT) return;
titzer 2013/08/26 15:33:47 Mmmm, this is starting to make me feel uncomfortab
+
switch (portion()) {
case kArrayLengths:
instr->SetGVNFlag(is_store
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698