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

Side by Side Diff: src/typing.cc

Issue 955243002: Remove RecordTypeFeedback() methods from some AST classes and move into typing.cc. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months 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
« no previous file with comments | « src/ast.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/typing.h" 5 #include "src/typing.h"
6 6
7 #include "src/frames.h" 7 #include "src/frames.h"
8 #include "src/frames-inl.h" 8 #include "src/frames-inl.h"
9 #include "src/ostreams.h" 9 #include "src/ostreams.h"
10 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move 10 #include "src/parser.h" // for CompileTimeValue; TODO(rossberg): should move
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 for (int i = 0; i < properties->length(); ++i) { 403 for (int i = 0; i < properties->length(); ++i) {
404 ObjectLiteral::Property* prop = properties->at(i); 404 ObjectLiteral::Property* prop = properties->at(i);
405 405
406 // Collect type feedback. 406 // Collect type feedback.
407 if ((prop->kind() == ObjectLiteral::Property::MATERIALIZED_LITERAL && 407 if ((prop->kind() == ObjectLiteral::Property::MATERIALIZED_LITERAL &&
408 !CompileTimeValue::IsCompileTimeValue(prop->value())) || 408 !CompileTimeValue::IsCompileTimeValue(prop->value())) ||
409 prop->kind() == ObjectLiteral::Property::COMPUTED) { 409 prop->kind() == ObjectLiteral::Property::COMPUTED) {
410 if (!prop->is_computed_name() && 410 if (!prop->is_computed_name() &&
411 prop->key()->AsLiteral()->value()->IsInternalizedString() && 411 prop->key()->AsLiteral()->value()->IsInternalizedString() &&
412 prop->emit_store()) { 412 prop->emit_store()) {
413 prop->RecordTypeFeedback(oracle()); 413 // Record type feed back for the property.
414 TypeFeedbackId id = prop->key()->AsLiteral()->LiteralFeedbackId();
415 SmallMapList maps;
416 oracle()->CollectReceiverTypes(id, &maps);
417 prop->set_receiver_type(maps.length() == 1 ? maps.at(0)
418 : Handle<Map>::null());
414 } 419 }
415 } 420 }
416 421
417 RECURSE(Visit(prop->value())); 422 RECURSE(Visit(prop->value()));
418 } 423 }
419 424
420 NarrowType(expr, Bounds(Type::Object(zone()))); 425 NarrowType(expr, Bounds(Type::Object(zone())));
421 } 426 }
422 427
423 428
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 if (proxy != NULL && proxy->var()->is_possibly_eval(isolate())) { 560 if (proxy != NULL && proxy->var()->is_possibly_eval(isolate())) {
556 store_.Forget(); // Eval could do whatever to local variables. 561 store_.Forget(); // Eval could do whatever to local variables.
557 } 562 }
558 563
559 // We don't know anything about the result type. 564 // We don't know anything about the result type.
560 } 565 }
561 566
562 567
563 void AstTyper::VisitCallNew(CallNew* expr) { 568 void AstTyper::VisitCallNew(CallNew* expr) {
564 // Collect type feedback. 569 // Collect type feedback.
565 expr->RecordTypeFeedback(oracle()); 570 FeedbackVectorSlot allocation_site_feedback_slot =
571 FLAG_pretenuring_call_new ? expr->AllocationSiteFeedbackSlot()
572 : expr->CallNewFeedbackSlot();
573 expr->set_allocation_site(
574 oracle()->GetCallNewAllocationSite(allocation_site_feedback_slot));
575 bool monomorphic =
576 oracle()->CallNewIsMonomorphic(expr->CallNewFeedbackSlot());
577 expr->set_is_monomorphic(monomorphic);
578 if (monomorphic) {
579 expr->set_target(oracle()->GetCallNewTarget(expr->CallNewFeedbackSlot()));
580 }
566 581
567 RECURSE(Visit(expr->expression())); 582 RECURSE(Visit(expr->expression()));
568 ZoneList<Expression*>* args = expr->arguments(); 583 ZoneList<Expression*>* args = expr->arguments();
569 for (int i = 0; i < args->length(); ++i) { 584 for (int i = 0; i < args->length(); ++i) {
570 Expression* arg = args->at(i); 585 Expression* arg = args->at(i);
571 RECURSE(Visit(arg)); 586 RECURSE(Visit(arg));
572 } 587 }
573 588
574 NarrowType(expr, Bounds(Type::None(zone()), Type::Receiver(zone()))); 589 NarrowType(expr, Bounds(Type::None(zone()), Type::Receiver(zone())));
575 } 590 }
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 void AstTyper::VisitModuleUrl(ModuleUrl* module) { 820 void AstTyper::VisitModuleUrl(ModuleUrl* module) {
806 } 821 }
807 822
808 823
809 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { 824 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) {
810 RECURSE(Visit(stmt->body())); 825 RECURSE(Visit(stmt->body()));
811 } 826 }
812 827
813 828
814 } } // namespace v8::internal 829 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698