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

Unified Diff: src/hydrogen-gvn.cc

Issue 1016803002: Remove PropertyCell space (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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-gvn.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-gvn.cc
diff --git a/src/hydrogen-gvn.cc b/src/hydrogen-gvn.cc
index da986e34cb8f4e57d03ce5e630637e401bc431ed..2ada8976ef18f8de33cbfbcf3bd456fa0dbae078 100644
--- a/src/hydrogen-gvn.cc
+++ b/src/hydrogen-gvn.cc
@@ -346,17 +346,20 @@ SideEffects SideEffectsTracker::ComputeChanges(HInstruction* instr) {
int index;
SideEffects result(instr->ChangesFlags());
if (result.ContainsFlag(kGlobalVars)) {
- if (instr->IsStoreGlobalCell() &&
- ComputeGlobalVar(HStoreGlobalCell::cast(instr)->cell(), &index)) {
- result.RemoveFlag(kGlobalVars);
- result.AddSpecial(GlobalVar(index));
- } else {
- for (index = 0; index < kNumberOfGlobalVars; ++index) {
+ if (instr->IsStoreNamedField()) {
+ HStoreNamedField* store = HStoreNamedField::cast(instr);
+ HConstant* target = HConstant::cast(store->object());
+ if (ComputeGlobalVar(Unique<PropertyCell>::cast(target->GetUnique()),
+ &index)) {
+ result.RemoveFlag(kGlobalVars);
result.AddSpecial(GlobalVar(index));
+ return result;
}
}
- }
- if (result.ContainsFlag(kInobjectFields)) {
+ for (index = 0; index < kNumberOfGlobalVars; ++index) {
+ result.AddSpecial(GlobalVar(index));
+ }
+ } else if (result.ContainsFlag(kInobjectFields)) {
if (instr->IsStoreNamedField() &&
ComputeInobjectField(HStoreNamedField::cast(instr)->access(), &index)) {
result.RemoveFlag(kInobjectFields);
@@ -375,17 +378,20 @@ SideEffects SideEffectsTracker::ComputeDependsOn(HInstruction* instr) {
int index;
SideEffects result(instr->DependsOnFlags());
if (result.ContainsFlag(kGlobalVars)) {
- if (instr->IsLoadGlobalCell() &&
- ComputeGlobalVar(HLoadGlobalCell::cast(instr)->cell(), &index)) {
- result.RemoveFlag(kGlobalVars);
- result.AddSpecial(GlobalVar(index));
- } else {
- for (index = 0; index < kNumberOfGlobalVars; ++index) {
+ if (instr->IsLoadNamedField()) {
+ HLoadNamedField* load = HLoadNamedField::cast(instr);
+ HConstant* target = HConstant::cast(load->object());
+ if (ComputeGlobalVar(Unique<PropertyCell>::cast(target->GetUnique()),
+ &index)) {
+ result.RemoveFlag(kGlobalVars);
result.AddSpecial(GlobalVar(index));
+ return result;
}
}
- }
- if (result.ContainsFlag(kInobjectFields)) {
+ for (index = 0; index < kNumberOfGlobalVars; ++index) {
+ result.AddSpecial(GlobalVar(index));
+ }
+ } else if (result.ContainsFlag(kInobjectFields)) {
if (instr->IsLoadNamedField() &&
ComputeInobjectField(HLoadNamedField::cast(instr)->access(), &index)) {
result.RemoveFlag(kInobjectFields);
@@ -439,7 +445,8 @@ GVN_UNTRACKED_FLAG_LIST(DECLARE_FLAG)
}
-bool SideEffectsTracker::ComputeGlobalVar(Unique<Cell> cell, int* index) {
+bool SideEffectsTracker::ComputeGlobalVar(Unique<PropertyCell> cell,
+ int* index) {
for (int i = 0; i < num_global_vars_; ++i) {
if (cell == global_vars_[i]) {
*index = i;
« no previous file with comments | « src/hydrogen-gvn.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698