Make sure polymorphic element access creates non-replaying phis.

R=danno@chromium.org
BUG=v8:2815

Review URL: https://codereview.chromium.org/22589005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16136 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent cc3b7a00
...@@ -815,11 +815,7 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { ...@@ -815,11 +815,7 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
HEnvironment* last_environment = pred->last_environment(); HEnvironment* last_environment = pred->last_environment();
for (int i = 0; i < block->phis()->length(); ++i) { for (int i = 0; i < block->phis()->length(); ++i) {
HPhi* phi = block->phis()->at(i); HPhi* phi = block->phis()->at(i);
// TODO(mstarzinger): The length check below should actually not if (phi->HasMergedIndex()) {
// be necessary, but some array stubs already rely on it. This
// should be investigated and fixed.
if (phi->HasMergedIndex() &&
phi->merged_index() < last_environment->length()) {
last_environment->SetValueAt(phi->merged_index(), phi); last_environment->SetValueAt(phi->merged_index(), phi);
} }
} }
......
...@@ -5701,6 +5701,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess( ...@@ -5701,6 +5701,7 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess(
if (!is_store) { if (!is_store) {
Push(access); Push(access);
} }
NoObservableSideEffectsScope scope(this);
current_block()->GotoNoSimulate(join); current_block()->GotoNoSimulate(join);
set_current_block(other_map); set_current_block(other_map);
} }
......
...@@ -870,11 +870,7 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { ...@@ -870,11 +870,7 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
HEnvironment* last_environment = pred->last_environment(); HEnvironment* last_environment = pred->last_environment();
for (int i = 0; i < block->phis()->length(); ++i) { for (int i = 0; i < block->phis()->length(); ++i) {
HPhi* phi = block->phis()->at(i); HPhi* phi = block->phis()->at(i);
// TODO(mstarzinger): The length check below should actually not if (phi->HasMergedIndex()) {
// be necessary, but some array stubs already rely on it. This
// should be investigated and fixed.
if (phi->HasMergedIndex() &&
phi->merged_index() < last_environment->length()) {
last_environment->SetValueAt(phi->merged_index(), phi); last_environment->SetValueAt(phi->merged_index(), phi);
} }
} }
......
...@@ -820,11 +820,7 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { ...@@ -820,11 +820,7 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
HEnvironment* last_environment = pred->last_environment(); HEnvironment* last_environment = pred->last_environment();
for (int i = 0; i < block->phis()->length(); ++i) { for (int i = 0; i < block->phis()->length(); ++i) {
HPhi* phi = block->phis()->at(i); HPhi* phi = block->phis()->at(i);
// TODO(mstarzinger): The length check below should actually not if (phi->HasMergedIndex()) {
// be necessary, but some array stubs already rely on it. This
// should be investigated and fixed.
if (phi->HasMergedIndex() &&
phi->merged_index() < last_environment->length()) {
last_environment->SetValueAt(phi->merged_index(), phi); last_environment->SetValueAt(phi->merged_index(), phi);
} }
} }
......
...@@ -814,11 +814,7 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { ...@@ -814,11 +814,7 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
HEnvironment* last_environment = pred->last_environment(); HEnvironment* last_environment = pred->last_environment();
for (int i = 0; i < block->phis()->length(); ++i) { for (int i = 0; i < block->phis()->length(); ++i) {
HPhi* phi = block->phis()->at(i); HPhi* phi = block->phis()->at(i);
// TODO(mstarzinger): The length check below should actually not if (phi->HasMergedIndex()) {
// be necessary, but some array stubs already rely on it. This
// should be investigated and fixed.
if (phi->HasMergedIndex() &&
phi->merged_index() < last_environment->length()) {
last_environment->SetValueAt(phi->merged_index(), phi); last_environment->SetValueAt(phi->merged_index(), phi);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment