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

Unified Diff: src/ic.cc

Issue 443903002: Version 3.27.34.12 (merged r22693) (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.27
Patch Set: Created 6 years, 4 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/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
diff --git a/src/ic.cc b/src/ic.cc
index cd92af11852c0f77c7140804cf6500e767087474..c764720501c0a7ddf1e2b8051832c220be569c5f 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -1855,8 +1855,13 @@ bool CallIC::DoCustomHandler(Handle<Object> receiver,
isolate()->context()->native_context()->array_function(), isolate());
if (array_function.is_identical_to(Handle<JSFunction>::cast(function))) {
// Alter the slot.
- Handle<AllocationSite> new_site = isolate()->factory()->NewAllocationSite();
- vector->set(slot->value(), *new_site);
+ Object* feedback = vector->get(slot->value());
+ if (!feedback->IsAllocationSite()) {
+ Handle<AllocationSite> new_site =
+ isolate()->factory()->NewAllocationSite();
+ vector->set(slot->value(), *new_site);
+ }
+
CallIC_ArrayStub stub(isolate(), state);
set_target(*stub.GetCode());
Handle<String> name;
@@ -1896,6 +1901,9 @@ void CallIC::HandleMiss(Handle<Object> receiver,
State state(target()->extra_ic_state());
Object* feedback = vector->get(slot->value());
+ // Hand-coded MISS handling is easier if CallIC slots don't contain smis.
+ ASSERT(!feedback->IsSmi());
+
if (feedback->IsJSFunction() || !function->IsJSFunction()) {
// We are going generic.
vector->set(slot->value(),
@@ -1904,9 +1912,14 @@ void CallIC::HandleMiss(Handle<Object> receiver,
TRACE_GENERIC_IC(isolate(), "CallIC", "megamorphic");
} else {
- // If we came here feedback must be the uninitialized sentinel,
- // and we are going monomorphic.
- ASSERT(feedback == *TypeFeedbackInfo::UninitializedSentinel(isolate()));
+ // The feedback is either uninitialized or an allocation site.
+ // It might be an allocation site because if we re-compile the full code
+ // to add deoptimization support, we call with the default call-ic, and
+ // merely need to patch the target to match the feedback.
+ // TODO(mvstanton): the better approach is to dispense with patching
+ // altogether, which is in progress.
+ ASSERT(feedback == *TypeFeedbackInfo::UninitializedSentinel(isolate()) ||
+ feedback->IsAllocationSite());
// Do we want to install a custom handler?
if (FLAG_use_ic &&
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698