Revision: 14766
Author: [email protected]
Date: Thu May 23 02:17:01 2013
Log: Avoid creating duplicate entries for a value when merging
HSimulates
[email protected]
Review URL: https://codereview.chromium.org/15660003
http://code.google.com/p/v8/source/detail?r=14766
Modified:
/branches/bleeding_edge/src/code-stubs-hydrogen.cc
/branches/bleeding_edge/src/hydrogen-instructions.cc
/branches/bleeding_edge/src/hydrogen-instructions.h
/branches/bleeding_edge/src/hydrogen.cc
=======================================
--- /branches/bleeding_edge/src/code-stubs-hydrogen.cc Thu May 23 01:17:03
2013
+++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Thu May 23 02:17:01
2013
@@ -148,7 +148,7 @@
HParameter::REGISTER_PARAMETER,
Representation::Integer32());
stack_parameter_count->set_type(HType::Smi());
- // it's essential to bind this value to the environment in case of
deopt
+ // It's essential to bind this value to the environment in case of
deopt.
AddInstruction(stack_parameter_count);
start_environment->Bind(param_count, stack_parameter_count);
arguments_length_ = stack_parameter_count;
@@ -169,7 +169,7 @@
HValue* return_value = BuildCodeStub();
// We might have extra expressions to pop from the stack in addition to
the
- // arguments above
+ // arguments above.
HInstruction* stack_pop_count = stack_parameter_count;
if (descriptor_->function_mode_ == JS_FUNCTION_STUB_MODE) {
if (!stack_parameter_count->IsConstant() &&
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.cc Thu May 23
01:32:07 2013
+++ /branches/bleeding_edge/src/hydrogen-instructions.cc Thu May 23
02:17:01 2013
@@ -2016,8 +2016,9 @@
ZoneList<HValue*>* from_values = &from->values_;
for (int i = 0; i < from_values->length(); ++i) {
if (from->HasAssignedIndexAt(i)) {
- AddAssignedValue(from->GetAssignedIndexAt(i),
- from_values->at(i));
+ int index = from->GetAssignedIndexAt(i);
+ if (HasValueForIndex(index)) continue;
+ AddAssignedValue(index, from_values->at(i));
} else {
if (pop_count_ > 0) {
pop_count_--;
@@ -2038,13 +2039,13 @@
if (values_.length() > 0) {
if (pop_count_ > 0) stream->Add(" /");
for (int i = values_.length() - 1; i >= 0; --i) {
- if (i > 0) stream->Add(",");
if (HasAssignedIndexAt(i)) {
stream->Add(" var[%d] = ", GetAssignedIndexAt(i));
} else {
stream->Add(" push ");
}
values_[i]->PrintNameTo(stream);
+ if (i > 0) stream->Add(",");
}
}
}
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Thu May 23 01:32:07
2013
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Thu May 23 02:17:01
2013
@@ -1858,6 +1858,12 @@
// use lists are correctly updated.
SetOperandAt(values_.length() - 1, value);
}
+ bool HasValueForIndex(int index) {
+ for (int i = 0; i < assigned_indexes_.length(); ++i) {
+ if (assigned_indexes_[i] == index) return true;
+ }
+ return false;
+ }
BailoutId ast_id_;
int pop_count_;
ZoneList<HValue*> values_;
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Thu May 23 01:32:07 2013
+++ /branches/bleeding_edge/src/hydrogen.cc Thu May 23 02:17:01 2013
@@ -157,7 +157,7 @@
HSimulate* instr =
new(zone()) HSimulate(ast_id, pop_count, zone(), removable);
// Order of pushed values: newest (top of stack) first. This allows
- // HSimulate::MergeInto() to easily append additional pushed values
+ // HSimulate::MergeWith() to easily append additional pushed values
// that are older (from further down the stack).
for (int i = 0; i < push_count; ++i) {
instr->AddPushedValue(environment->ExpressionStackAt(i));
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.