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

Unified Diff: src/type-info.cc

Issue 11818021: Allocation Info Tracking, continued. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 7 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 side-by-side diff with in-line comments
Download patch
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));
« src/objects.cc ('K') | « src/type-info.h ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698