Index: src/type-info.cc |
diff --git a/src/type-info.cc b/src/type-info.cc |
index 80d3434c97fe40b37eb22baa41ec459902a71a5c..237c8d7658d8615e203e7bad38f1d1fb5c528bb6 100644 |
--- a/src/type-info.cc |
+++ b/src/type-info.cc |
@@ -163,8 +163,13 @@ bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { |
bool TypeFeedbackOracle::CallNewIsMonomorphic(CallNew* expr) { |
- Handle<Object> value = GetInfo(expr->CallNewFeedbackId()); |
- return value->IsJSFunction(); |
+ Handle<Object> info = GetInfo(expr->CallNewFeedbackId()); |
+ if (info->IsSmi()) { |
+ ASSERT(static_cast<ElementsKind>(Smi::cast(*info)->value()) <= |
+ LAST_FAST_ELEMENTS_KIND); |
+ return Isolate::Current()->global_context()->array_function(); |
+ } |
+ return info->IsJSFunction(); |
} |
@@ -288,10 +293,27 @@ Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(Call* expr) { |
Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget(CallNew* expr) { |
- return Handle<JSFunction>::cast(GetInfo(expr->CallNewFeedbackId())); |
+ Handle<Object> info = GetInfo(expr->CallNewFeedbackId()); |
+ if (info->IsSmi()) { |
+ ASSERT(static_cast<ElementsKind>(Smi::cast(*info)->value()) <= |
+ LAST_FAST_ELEMENTS_KIND); |
+ return Handle<JSFunction>(Isolate::Current()->global_context()-> |
+ array_function()); |
+ } else { |
+ return Handle<JSFunction>::cast(info); |
+ } |
} |
+ElementsKind TypeFeedbackOracle::GetCallNewElementsKind(CallNew* expr) { |
+ Handle<Object> info = GetInfo(expr->CallNewFeedbackId()); |
+ if (info->IsSmi()) { |
+ return static_cast<ElementsKind>(Smi::cast(*info)->value()); |
+ } else { |
+ return GetInitialFastElementsKind(); |
+ } |
+} |
+ |
Handle<Map> TypeFeedbackOracle::GetObjectLiteralStoreMap( |
ObjectLiteral::Property* prop) { |
ASSERT(ObjectLiteralStoreIsMonomorphic(prop)); |