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

Unified Diff: src/hydrogen-instructions.cc

Issue 14284010: Introduce HObjectAccess, which is used by LoadNamedField and StoreNamedField to denote what parts (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Some small cleanups; add AddLoad to simplify construction of loads Created 7 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 side-by-side diff with in-line comments
Download patch
« src/hydrogen.cc ('K') | « 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 70e2395574747085a8a554cc0a84d00eecd81390..74419470e74cfbf0e46f98f34b1478333b6c1401 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -3653,4 +3653,39 @@ void HCheckFunction::Verify() {
#endif
danno 2013/05/02 14:16:47 nit: 2 lines
titzer 2013/05/03 09:18:41 Done.
+void HObjectAccess::SetGVNFlags(HValue *instr, bool is_store) {
+ // set the appropriate GVN flags for a given load or store instruction
+ if (!is_store) {
danno 2013/05/02 14:16:47 Why not just switch the else and then blocks so it
titzer 2013/05/03 09:18:41 Done.
+ instr->SetFlag(HValue::kUseGVN); // try to GVN loads
+ instr->SetGVNFlag(kDependsOnMaps); // but don't hoist above map changes
+ } else {
+ // track dominating allocations in order to eliminate write barriers
+ instr->SetGVNFlag(kDependsOnNewSpacePromotion);
+ instr->SetFlag(HValue::kTrackSideEffectDominators);
+ }
+
+ switch (portion_) {
+ case kArrayLengths:
danno 2013/05/02 14:16:47 Weird indentation. Elsewhere in the code we use 2-
titzer 2013/05/03 09:18:41 Done.
+ instr->SetGVNFlag(
+ is_store ? kChangesArrayLengths : kDependsOnArrayLengths);
+ break;
+ case kInobject:
+ instr->SetGVNFlag(
+ is_store ? kChangesInobjectFields : kDependsOnInobjectFields);
+ break;
+ case kBackingStore:
+ instr->SetGVNFlag(
+ is_store ? kChangesBackingStoreFields : kDependsOnBackingStoreFields);
+ break;
+ case kElementsPointer:
+ instr->SetGVNFlag(
+ is_store ? kChangesElementsPointer : kDependsOnElementsPointer);
+ break;
+ case kMaps:
+ instr->SetGVNFlag(
+ is_store ? kChangesMaps : kDependsOnMaps);
+ break;
+ }
+}
+
} } // namespace v8::internal
« src/hydrogen.cc ('K') | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698