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

Unified Diff: src/type-info.cc

Issue 15094018: Create AllocationSite objects, pointed to by AllocationSiteInfo. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comment response Created 7 years, 5 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
« no previous file with comments | « src/runtime.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index e2be3aa66db4c0a7089bc5a072be9446fc59107a..532103b2b251c315dba08733c7c8fcec9e55142e 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -186,13 +186,14 @@ bool TypeFeedbackOracle::StoreIsPolymorphic(TypeFeedbackId ast_id) {
bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) {
Handle<Object> value = GetInfo(expr->CallFeedbackId());
- return value->IsMap() || value->IsSmi() || value->IsJSFunction();
+ return value->IsMap() || value->IsAllocationSite() || value->IsJSFunction() ||
+ value->IsSmi();
}
bool TypeFeedbackOracle::CallNewIsMonomorphic(CallNew* expr) {
Handle<Object> info = GetInfo(expr->CallNewFeedbackId());
- return info->IsSmi() || info->IsJSFunction();
+ return info->IsAllocationSite() || info->IsJSFunction();
}
@@ -302,9 +303,7 @@ CheckType TypeFeedbackOracle::GetCallCheckType(Call* expr) {
Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(Call* expr) {
Handle<Object> info = GetInfo(expr->CallFeedbackId());
- if (info->IsSmi()) {
- ASSERT(static_cast<ElementsKind>(Smi::cast(*info)->value()) <=
- LAST_FAST_ELEMENTS_KIND);
+ if (info->IsAllocationSite()) {
return Handle<JSFunction>(isolate_->global_context()->array_function());
} else {
return Handle<JSFunction>::cast(info);
@@ -314,9 +313,7 @@ Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(Call* expr) {
Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget(CallNew* expr) {
Handle<Object> info = GetInfo(expr->CallNewFeedbackId());
- if (info->IsSmi()) {
- ASSERT(static_cast<ElementsKind>(Smi::cast(*info)->value()) <=
- LAST_FAST_ELEMENTS_KIND);
+ if (info->IsAllocationSite()) {
return Handle<JSFunction>(isolate_->global_context()->array_function());
} else {
return Handle<JSFunction>::cast(info);
@@ -675,6 +672,7 @@ void TypeFeedbackOracle::ProcessTypeFeedbackCells(Handle<Code> code) {
Cell* cell = cache->GetCell(i);
Object* value = cell->value();
if (value->IsSmi() ||
+ value->IsAllocationSite() ||
(value->IsJSFunction() &&
!CanRetainOtherContext(JSFunction::cast(value),
*native_context_))) {
« no previous file with comments | « src/runtime.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698