Index: src/type-info.cc |
diff --git a/src/type-info.cc b/src/type-info.cc |
index 35beb1808a6a8d4319237d3a31f66aa034b03466..99b1b3d899ecf4cf9e46f893356b8192ca8a7b7b 100644 |
--- a/src/type-info.cc |
+++ b/src/type-info.cc |
@@ -120,13 +120,17 @@ bool TypeFeedbackOracle::StoreIsKeyedPolymorphic(TypeFeedbackId ast_id) { |
bool TypeFeedbackOracle::CallIsMonomorphic(int slot) { |
Handle<Object> value = GetInfo(slot); |
- return value->IsAllocationSite() || value->IsJSFunction(); |
+ return FLAG_pretenuring_call_new |
+ ? value->IsJSFunction() |
+ : value->IsAllocationSite() || value->IsJSFunction(); |
} |
bool TypeFeedbackOracle::CallNewIsMonomorphic(int slot) { |
Handle<Object> info = GetInfo(slot); |
- return info->IsAllocationSite() || info->IsJSFunction(); |
+ return FLAG_pretenuring_call_new |
+ ? info->IsJSFunction() |
+ : info->IsAllocationSite() || info->IsJSFunction(); |
} |
@@ -153,27 +157,29 @@ KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode( |
Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(int slot) { |
Handle<Object> info = GetInfo(slot); |
- if (info->IsAllocationSite()) { |
- return Handle<JSFunction>(isolate()->native_context()->array_function()); |
- } else { |
+ if (FLAG_pretenuring_call_new || info->IsJSFunction()) { |
return Handle<JSFunction>::cast(info); |
} |
+ |
+ ASSERT(info->IsAllocationSite()); |
+ return Handle<JSFunction>(isolate()->native_context()->array_function()); |
} |
Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget(int slot) { |
Handle<Object> info = GetInfo(slot); |
- if (info->IsAllocationSite()) { |
- return Handle<JSFunction>(isolate()->native_context()->array_function()); |
- } else { |
+ if (FLAG_pretenuring_call_new || info->IsJSFunction()) { |
return Handle<JSFunction>::cast(info); |
} |
+ |
+ ASSERT(info->IsAllocationSite()); |
+ return Handle<JSFunction>(isolate()->native_context()->array_function()); |
} |
Handle<AllocationSite> TypeFeedbackOracle::GetCallNewAllocationSite(int slot) { |
Handle<Object> info = GetInfo(slot); |
- if (info->IsAllocationSite()) { |
+ if (FLAG_pretenuring_call_new || info->IsAllocationSite()) { |
return Handle<AllocationSite>::cast(info); |
} |
return Handle<AllocationSite>::null(); |