}
-void CallNew::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- FeedbackVectorSlot allocation_site_feedback_slot =
- FLAG_pretenuring_call_new ? AllocationSiteFeedbackSlot()
- : CallNewFeedbackSlot();
- allocation_site_ =
- oracle->GetCallNewAllocationSite(allocation_site_feedback_slot);
- is_monomorphic_ = oracle->CallNewIsMonomorphic(CallNewFeedbackSlot());
- if (is_monomorphic_) {
- target_ = oracle->GetCallNewTarget(CallNewFeedbackSlot());
- }
-}
-
-
-void ObjectLiteral::Property::RecordTypeFeedback(TypeFeedbackOracle* oracle) {
- DCHECK(!is_computed_name());
- TypeFeedbackId id = key()->AsLiteral()->LiteralFeedbackId();
- SmallMapList maps;
- oracle->CollectReceiverTypes(id, &maps);
- receiver_type_ = maps.length() == 1 ? maps.at(0)
- : Handle<Map>::null();
-}
-
-
// ----------------------------------------------------------------------------
// Implementation of AstVisitor
Kind kind() { return kind_; }
// Type feedback information.
- void RecordTypeFeedback(TypeFeedbackOracle* oracle);
bool IsMonomorphic() { return !receiver_type_.is_null(); }
Handle<Map> GetReceiverType() { return receiver_type_; }
bool is_static() const { return is_static_; }
bool is_computed_name() const { return is_computed_name_; }
+ void set_receiver_type(Handle<Map> map) { receiver_type_ = map; }
+
protected:
friend class AstNodeFactory;
return CallNewFeedbackSlot().next();
}
- void RecordTypeFeedback(TypeFeedbackOracle* oracle);
bool IsMonomorphic() OVERRIDE { return is_monomorphic_; }
Handle<JSFunction> target() const { return target_; }
Handle<AllocationSite> allocation_site() const {
static int feedback_slots() { return 1; }
BailoutId ReturnId() const { return BailoutId(local_id(0)); }
+ void set_allocation_site(Handle<AllocationSite> site) {
+ allocation_site_ = site;
+ }
+ void set_is_monomorphic(bool monomorphic) { is_monomorphic_ = monomorphic; }
+ void set_target(Handle<JSFunction> target) { target_ = target; }
+
protected:
CallNew(Zone* zone, Expression* expression, ZoneList<Expression*>* arguments,
int pos)
if (!prop->is_computed_name() &&
prop->key()->AsLiteral()->value()->IsInternalizedString() &&
prop->emit_store()) {
- prop->RecordTypeFeedback(oracle());
+ // Record type feed back for the property.
+ TypeFeedbackId id = prop->key()->AsLiteral()->LiteralFeedbackId();
+ SmallMapList maps;
+ oracle()->CollectReceiverTypes(id, &maps);
+ prop->set_receiver_type(maps.length() == 1 ? maps.at(0)
+ : Handle<Map>::null());
}
}
void AstTyper::VisitCallNew(CallNew* expr) {
// Collect type feedback.
- expr->RecordTypeFeedback(oracle());
+ FeedbackVectorSlot allocation_site_feedback_slot =
+ FLAG_pretenuring_call_new ? expr->AllocationSiteFeedbackSlot()
+ : expr->CallNewFeedbackSlot();
+ expr->set_allocation_site(
+ oracle()->GetCallNewAllocationSite(allocation_site_feedback_slot));
+ bool monomorphic =
+ oracle()->CallNewIsMonomorphic(expr->CallNewFeedbackSlot());
+ expr->set_is_monomorphic(monomorphic);
+ if (monomorphic) {
+ expr->set_target(oracle()->GetCallNewTarget(expr->CallNewFeedbackSlot()));
+ }
RECURSE(Visit(expr->expression()));
ZoneList<Expression*>* args = expr->arguments();