| Index: src/typing.cc
|
| diff --git a/src/typing.cc b/src/typing.cc
|
| index d9420adb8ca2af8c20056cb7036d33fdfa2bd0a6..8487c05eb4af9fe472509c5afc34ae0eb1916053 100644
|
| --- a/src/typing.cc
|
| +++ b/src/typing.cc
|
| @@ -387,31 +387,35 @@ void AstTyper::VisitArrayLiteral(ArrayLiteral* expr) {
|
|
|
|
|
| void AstTyper::VisitAssignment(Assignment* expr) {
|
| - // TODO(rossberg): Can we clean this up?
|
| - if (expr->is_compound()) {
|
| - // Collect type feedback.
|
| - Expression* target = expr->target();
|
| - Property* prop = target->AsProperty();
|
| - if (prop != NULL) {
|
| - RECURSE(Visit(expr->target()));
|
| - expr->RecordTypeFeedback(oracle(), zone());
|
| - }
|
| -
|
| - RECURSE(Visit(expr->binary_operation()));
|
| -
|
| - NarrowType(expr, expr->binary_operation()->bounds());
|
| - } else {
|
| - // Collect type feedback.
|
| - if (expr->target()->IsProperty()) {
|
| - expr->RecordTypeFeedback(oracle(), zone());
|
| + // Collect type feedback.
|
| + Property* prop = expr->target()->AsProperty();
|
| + if (prop != NULL) {
|
| + TypeFeedbackId id = expr->AssignmentFeedbackId();
|
| + expr->set_is_uninitialized(oracle()->StoreIsUninitialized(id));
|
| + if (!expr->IsUninitialized()) {
|
| + expr->set_is_pre_monomorphic(oracle()->StoreIsPreMonomorphic(id));
|
| + expr->set_is_monomorphic(oracle()->StoreIsMonomorphicNormal(id));
|
| + ASSERT(!expr->IsPreMonomorphic() || !expr->IsMonomorphic());
|
| + if (prop->key()->IsPropertyName()) {
|
| + Literal* lit_key = prop->key()->AsLiteral();
|
| + ASSERT(lit_key != NULL && lit_key->value()->IsString());
|
| + Handle<String> name = Handle<String>::cast(lit_key->value());
|
| + oracle()->AssignmentReceiverTypes(id, name, expr->GetReceiverTypes());
|
| + } else {
|
| + KeyedAccessStoreMode store_mode;
|
| + oracle()->KeyedAssignmentReceiverTypes(
|
| + id, expr->GetReceiverTypes(), &store_mode);
|
| + expr->set_store_mode(store_mode);
|
| + }
|
| }
|
| -
|
| - RECURSE(Visit(expr->target()));
|
| - RECURSE(Visit(expr->value()));
|
| -
|
| - NarrowType(expr, expr->value()->bounds());
|
| }
|
|
|
| + Expression* rhs =
|
| + expr->is_compound() ? expr->binary_operation() : expr->value();
|
| + RECURSE(Visit(expr->target()));
|
| + RECURSE(Visit(rhs));
|
| + NarrowType(expr, rhs->bounds());
|
| +
|
| VariableProxy* proxy = expr->target()->AsVariableProxy();
|
| if (proxy != NULL && proxy->var()->IsStackAllocated()) {
|
| store_.Seq(variable_index(proxy->var()), Effect(expr->bounds()));
|
|
|