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

Unified Diff: src/typing.cc

Issue 95033003: Move more logic from AST to oracle, pt 3 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/type-info.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()));
« no previous file with comments | « src/type-info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698