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

Side by Side Diff: src/typing.cc

Issue 95163002: Move more logic from AST to oracle, pt 2 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/type-info.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 } 386 }
387 387
388 388
389 void AstTyper::VisitAssignment(Assignment* expr) { 389 void AstTyper::VisitAssignment(Assignment* expr) {
390 // TODO(rossberg): Can we clean this up? 390 // TODO(rossberg): Can we clean this up?
391 if (expr->is_compound()) { 391 if (expr->is_compound()) {
392 // Collect type feedback. 392 // Collect type feedback.
393 Expression* target = expr->target(); 393 Expression* target = expr->target();
394 Property* prop = target->AsProperty(); 394 Property* prop = target->AsProperty();
395 if (prop != NULL) { 395 if (prop != NULL) {
396 prop->RecordTypeFeedback(oracle(), zone()); 396 RECURSE(Visit(expr->target()));
397 expr->RecordTypeFeedback(oracle(), zone()); 397 expr->RecordTypeFeedback(oracle(), zone());
398 } 398 }
399 399
400 RECURSE(Visit(expr->binary_operation())); 400 RECURSE(Visit(expr->binary_operation()));
401 401
402 NarrowType(expr, expr->binary_operation()->bounds()); 402 NarrowType(expr, expr->binary_operation()->bounds());
403 } else { 403 } else {
404 // Collect type feedback. 404 // Collect type feedback.
405 if (expr->target()->IsProperty()) { 405 if (expr->target()->IsProperty()) {
406 expr->RecordTypeFeedback(oracle(), zone()); 406 expr->RecordTypeFeedback(oracle(), zone());
(...skipping 23 matching lines...) Expand all
430 void AstTyper::VisitThrow(Throw* expr) { 430 void AstTyper::VisitThrow(Throw* expr) {
431 RECURSE(Visit(expr->exception())); 431 RECURSE(Visit(expr->exception()));
432 // TODO(rossberg): is it worth having a non-termination effect? 432 // TODO(rossberg): is it worth having a non-termination effect?
433 433
434 NarrowType(expr, Bounds(Type::None(), isolate_)); 434 NarrowType(expr, Bounds(Type::None(), isolate_));
435 } 435 }
436 436
437 437
438 void AstTyper::VisitProperty(Property* expr) { 438 void AstTyper::VisitProperty(Property* expr) {
439 // Collect type feedback. 439 // Collect type feedback.
440 expr->RecordTypeFeedback(oracle(), zone()); 440 TypeFeedbackId id = expr->PropertyFeedbackId();
441 expr->set_is_uninitialized(oracle()->LoadIsUninitialized(id));
442 if (!expr->IsUninitialized()) {
443 expr->set_is_pre_monomorphic(oracle()->LoadIsPreMonomorphic(id));
444 expr->set_is_monomorphic(oracle()->LoadIsMonomorphicNormal(id));
445 ASSERT(!expr->IsPreMonomorphic() || !expr->IsMonomorphic());
446 if (expr->key()->IsPropertyName()) {
447 Literal* lit_key = expr->key()->AsLiteral();
448 ASSERT(lit_key != NULL && lit_key->value()->IsString());
449 Handle<String> name = Handle<String>::cast(lit_key->value());
450 bool is_prototype;
451 oracle()->PropertyReceiverTypes(
452 id, name, expr->GetReceiverTypes(), &is_prototype);
453 expr->set_is_function_prototype(is_prototype);
454 } else {
455 bool is_string;
456 oracle()->KeyedPropertyReceiverTypes(
457 id, expr->GetReceiverTypes(), &is_string);
458 expr->set_is_string_access(is_string);
459 }
460 }
441 461
442 RECURSE(Visit(expr->obj())); 462 RECURSE(Visit(expr->obj()));
443 RECURSE(Visit(expr->key())); 463 RECURSE(Visit(expr->key()));
444 464
445 // We don't know anything about the result type. 465 // We don't know anything about the result type.
446 } 466 }
447 467
448 468
449 void AstTyper::VisitCall(Call* expr) { 469 void AstTyper::VisitCall(Call* expr) {
450 // Collect type feedback. 470 // Collect type feedback.
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 void AstTyper::VisitModuleUrl(ModuleUrl* module) { 731 void AstTyper::VisitModuleUrl(ModuleUrl* module) {
712 } 732 }
713 733
714 734
715 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { 735 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) {
716 RECURSE(Visit(stmt->body())); 736 RECURSE(Visit(stmt->body()));
717 } 737 }
718 738
719 739
720 } } // namespace v8::internal 740 } } // namespace v8::internal
OLDNEW
« 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