OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/ast.h" | 5 #include "src/ast.h" |
6 | 6 |
7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
8 #include "src/builtins.h" | 8 #include "src/builtins.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/contexts.h" | 10 #include "src/contexts.h" |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 // change and thus prefer the general IC code. | 601 // change and thus prefer the general IC code. |
602 if (!it->isolate()->heap()->InNewSpace(*candidate)) { | 602 if (!it->isolate()->heap()->InNewSpace(*candidate)) { |
603 target_ = candidate; | 603 target_ = candidate; |
604 return true; | 604 return true; |
605 } | 605 } |
606 } | 606 } |
607 return false; | 607 return false; |
608 } | 608 } |
609 | 609 |
610 | 610 |
611 void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | |
612 FeedbackVectorSlot allocation_site_feedback_slot = | |
613 FLAG_pretenuring_call_new ? AllocationSiteFeedbackSlot() | |
614 : CallNewFeedbackSlot(); | |
615 allocation_site_ = | |
616 oracle->GetCallNewAllocationSite(allocation_site_feedback_slot); | |
617 is_monomorphic_ = oracle->CallNewIsMonomorphic(CallNewFeedbackSlot()); | |
618 if (is_monomorphic_) { | |
619 target_ = oracle->GetCallNewTarget(CallNewFeedbackSlot()); | |
620 } | |
621 } | |
622 | |
623 | |
624 void ObjectLiteral::Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) { | |
625 DCHECK(!is_computed_name()); | |
626 TypeFeedbackId id = key()->AsLiteral()->LiteralFeedbackId(); | |
627 SmallMapList maps; | |
628 oracle->CollectReceiverTypes(id, &maps); | |
629 receiver_type_ = maps.length() == 1 ? maps.at(0) | |
630 : Handle<Map>::null(); | |
631 } | |
632 | |
633 | |
634 // ---------------------------------------------------------------------------- | 611 // ---------------------------------------------------------------------------- |
635 // Implementation of AstVisitor | 612 // Implementation of AstVisitor |
636 | 613 |
637 void AstVisitor::VisitDeclarations(ZoneList<Declaration*>* declarations) { | 614 void AstVisitor::VisitDeclarations(ZoneList<Declaration*>* declarations) { |
638 for (int i = 0; i < declarations->length(); i++) { | 615 for (int i = 0; i < declarations->length(); i++) { |
639 Visit(declarations->at(i)); | 616 Visit(declarations->at(i)); |
640 } | 617 } |
641 } | 618 } |
642 | 619 |
643 | 620 |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 // static | 986 // static |
1010 bool Literal::Match(void* literal1, void* literal2) { | 987 bool Literal::Match(void* literal1, void* literal2) { |
1011 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 988 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1012 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 989 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1013 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || | 990 return (x->IsString() && y->IsString() && *x->AsString() == *y->AsString()) || |
1014 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 991 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1015 } | 992 } |
1016 | 993 |
1017 | 994 |
1018 } } // namespace v8::internal | 995 } } // namespace v8::internal |
OLD | NEW |