Unify handling of bailout IDs for property loads.

Renamed Property::ReturnId to Property::LoadId, which describes its use more
accurately. Compound assignments and CountOperations now consistently use
Property::LoadId() instead of their own CompoundLoadId/CountId.

Review URL: https://chromiumcodereview.appspot.com/10832157

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b4fd9de1
......@@ -1837,11 +1837,11 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
break;
case NAMED_PROPERTY:
EmitNamedPropertyLoad(property);
PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
PrepareForBailoutForId(property->LoadId(), TOS_REG);
break;
case KEYED_PROPERTY:
EmitKeyedPropertyLoad(property);
PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
PrepareForBailoutForId(property->LoadId(), TOS_REG);
break;
}
}
......@@ -2277,7 +2277,7 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
EmitNamedPropertyLoad(expr);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(r0);
} else {
VisitForStackValue(expr->obj());
......@@ -4063,7 +4063,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
if (assign_type == VARIABLE) {
PrepareForBailout(expr->expression(), TOS_REG);
} else {
PrepareForBailoutForId(expr->CountId(), TOS_REG);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
}
// Call ToNumber only if operand is not a smi.
......
......@@ -125,7 +125,6 @@ Assignment::Assignment(Isolate* isolate,
value_(value),
pos_(pos),
binary_operation_(NULL),
compound_load_id_(GetNextId(isolate)),
assignment_id_(GetNextId(isolate)),
block_start_(false),
block_end_(false),
......
......@@ -1513,7 +1513,7 @@ class Property: public Expression {
Expression* key() const { return key_; }
virtual int position() const { return pos_; }
BailoutId ReturnId() const { return return_id_; }
BailoutId LoadId() const { return load_id_; }
bool IsStringLength() const { return is_string_length_; }
bool IsStringAccess() const { return is_string_access_; }
......@@ -1538,7 +1538,7 @@ class Property: public Expression {
obj_(obj),
key_(key),
pos_(pos),
return_id_(GetNextId(isolate)),
load_id_(GetNextId(isolate)),
is_monomorphic_(false),
is_uninitialized_(false),
is_array_length_(false),
......@@ -1550,7 +1550,7 @@ class Property: public Expression {
Expression* obj_;
Expression* key_;
int pos_;
const BailoutId return_id_;
const BailoutId load_id_;
SmallMapList receiver_types_;
bool is_monomorphic_ : 1;
......@@ -1810,12 +1810,10 @@ class CountOperation: public Expression {
virtual SmallMapList* GetReceiverTypes() { return &receiver_types_; }
BailoutId AssignmentId() const { return assignment_id_; }
BailoutId CountId() const { return count_id_; }
TypeFeedbackId CountBinOpFeedbackId() const { return reuse(CountId()); }
TypeFeedbackId CountBinOpFeedbackId() const { return count_id_; }
TypeFeedbackId CountStoreFeedbackId() const { return reuse(id()); }
protected:
template<class> friend class AstNodeFactory;
......@@ -1839,7 +1837,7 @@ class CountOperation: public Expression {
Expression* expression_;
int pos_;
const BailoutId assignment_id_;
const BailoutId count_id_;
const TypeFeedbackId count_id_;
SmallMapList receiver_types_;
};
......@@ -1961,7 +1959,6 @@ class Assignment: public Expression {
void mark_block_start() { block_start_ = true; }
void mark_block_end() { block_end_ = true; }
BailoutId CompoundLoadId() const { return compound_load_id_; }
BailoutId AssignmentId() const { return assignment_id_; }
// Type feedback information.
......@@ -1994,7 +1991,6 @@ class Assignment: public Expression {
Expression* value_;
int pos_;
BinaryOperation* binary_operation_;
const BailoutId compound_load_id_;
const BailoutId assignment_id_;
bool block_start_;
......
......@@ -5421,7 +5421,7 @@ void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
load = BuildLoadNamedGeneric(object, name, prop);
}
PushAndAdd(load);
if (load->HasObservableSideEffects()) AddSimulate(expr->CompoundLoadId());
if (load->HasObservableSideEffects()) AddSimulate(prop->LoadId());
CHECK_ALIVE(VisitForValue(expr->value()));
HValue* right = Pop();
......@@ -5465,11 +5465,11 @@ void HGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
bool has_side_effects = false;
HValue* load = HandleKeyedElementAccess(
obj, key, NULL, prop, expr->CompoundLoadId(), RelocInfo::kNoPosition,
obj, key, NULL, prop, prop->LoadId(), RelocInfo::kNoPosition,
false, // is_store
&has_side_effects);
Push(load);
if (has_side_effects) AddSimulate(expr->CompoundLoadId());
if (has_side_effects) AddSimulate(prop->LoadId());
CHECK_ALIVE(VisitForValue(expr->value()));
......@@ -6956,7 +6956,7 @@ bool HGraphBuilder::TryInlineGetter(Handle<JSFunction> getter,
0,
NULL,
prop->id(),
prop->ReturnId(),
prop->LoadId(),
NORMAL_RETURN);
}
......@@ -7832,7 +7832,7 @@ void HGraphBuilder::VisitCountOperation(CountOperation* expr) {
load = BuildLoadNamedGeneric(object, name, prop);
}
PushAndAdd(load);
if (load->HasObservableSideEffects()) AddSimulate(expr->CountId());
if (load->HasObservableSideEffects()) AddSimulate(prop->LoadId());
after = BuildIncrement(returns_original_input, expr);
input = Pop();
......@@ -7875,11 +7875,11 @@ void HGraphBuilder::VisitCountOperation(CountOperation* expr) {
bool has_side_effects = false;
HValue* load = HandleKeyedElementAccess(
obj, key, NULL, prop, expr->CountId(), RelocInfo::kNoPosition,
obj, key, NULL, prop, prop->LoadId(), RelocInfo::kNoPosition,
false, // is_store
&has_side_effects);
Push(load);
if (has_side_effects) AddSimulate(expr->CountId());
if (has_side_effects) AddSimulate(prop->LoadId());
after = BuildIncrement(returns_original_input, expr);
input = Pop();
......
......@@ -1791,11 +1791,11 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
break;
case NAMED_PROPERTY:
EmitNamedPropertyLoad(property);
PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
PrepareForBailoutForId(property->LoadId(), TOS_REG);
break;
case KEYED_PROPERTY:
EmitKeyedPropertyLoad(property);
PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
PrepareForBailoutForId(property->LoadId(), TOS_REG);
break;
}
}
......@@ -2216,7 +2216,7 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
VisitForAccumulatorValue(expr->obj());
__ mov(edx, result_register());
EmitNamedPropertyLoad(expr);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(eax);
} else {
VisitForStackValue(expr->obj());
......@@ -4033,7 +4033,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
if (assign_type == VARIABLE) {
PrepareForBailout(expr->expression(), TOS_REG);
} else {
PrepareForBailoutForId(expr->CountId(), TOS_REG);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
}
// Call ToNumber only if operand is not a smi.
......
......@@ -1850,11 +1850,11 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
break;
case NAMED_PROPERTY:
EmitNamedPropertyLoad(property);
PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
PrepareForBailoutForId(property->LoadId(), TOS_REG);
break;
case KEYED_PROPERTY:
EmitKeyedPropertyLoad(property);
PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
PrepareForBailoutForId(property->LoadId(), TOS_REG);
break;
}
}
......@@ -2301,7 +2301,7 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
EmitNamedPropertyLoad(expr);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(v0);
} else {
VisitForStackValue(expr->obj());
......@@ -4105,7 +4105,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
if (assign_type == VARIABLE) {
PrepareForBailout(expr->expression(), TOS_REG);
} else {
PrepareForBailoutForId(expr->CountId(), TOS_REG);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
}
// Call ToNumber only if operand is not a smi.
......
......@@ -1809,11 +1809,11 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
break;
case NAMED_PROPERTY:
EmitNamedPropertyLoad(property);
PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
PrepareForBailoutForId(property->LoadId(), TOS_REG);
break;
case KEYED_PROPERTY:
EmitKeyedPropertyLoad(property);
PrepareForBailoutForId(expr->CompoundLoadId(), TOS_REG);
PrepareForBailoutForId(property->LoadId(), TOS_REG);
break;
}
}
......@@ -2190,7 +2190,7 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
EmitNamedPropertyLoad(expr);
PrepareForBailoutForId(expr->ReturnId(), TOS_REG);
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(rax);
} else {
VisitForStackValue(expr->obj());
......@@ -4023,7 +4023,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
if (assign_type == VARIABLE) {
PrepareForBailout(expr->expression(), TOS_REG);
} else {
PrepareForBailoutForId(expr->CountId(), TOS_REG);
PrepareForBailoutForId(prop->LoadId(), TOS_REG);
}
// Call ToNumber only if operand is not a smi.
......
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