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

Side by Side Diff: src/ic/ic.cc

Issue 881433002: Use a WeakCell in the CallIC type vector. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Now with fix for Mandreel Regression. Created 5 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 unified diff | Download patch
« no previous file with comments | « src/ia32/interface-descriptors-ia32.cc ('k') | src/interface-descriptors.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 2210
2211 void CallIC::HandleMiss(Handle<Object> receiver, Handle<Object> function) { 2211 void CallIC::HandleMiss(Handle<Object> receiver, Handle<Object> function) {
2212 CallICState callic_state(target()->extra_ic_state()); 2212 CallICState callic_state(target()->extra_ic_state());
2213 Handle<Object> name = isolate()->factory()->empty_string(); 2213 Handle<Object> name = isolate()->factory()->empty_string();
2214 CallICNexus* nexus = casted_nexus<CallICNexus>(); 2214 CallICNexus* nexus = casted_nexus<CallICNexus>();
2215 Object* feedback = nexus->GetFeedback(); 2215 Object* feedback = nexus->GetFeedback();
2216 2216
2217 // Hand-coded MISS handling is easier if CallIC slots don't contain smis. 2217 // Hand-coded MISS handling is easier if CallIC slots don't contain smis.
2218 DCHECK(!feedback->IsSmi()); 2218 DCHECK(!feedback->IsSmi());
2219 2219
2220 if (feedback->IsJSFunction() || !function->IsJSFunction()) { 2220 if (feedback->IsWeakCell() || !function->IsJSFunction()) {
2221 // We are going generic. 2221 // We are going generic.
2222 nexus->ConfigureGeneric(); 2222 nexus->ConfigureGeneric();
2223 } else { 2223 } else {
2224 // The feedback is either uninitialized or an allocation site. 2224 // The feedback is either uninitialized or an allocation site.
2225 // It might be an allocation site because if we re-compile the full code 2225 // It might be an allocation site because if we re-compile the full code
2226 // to add deoptimization support, we call with the default call-ic, and 2226 // to add deoptimization support, we call with the default call-ic, and
2227 // merely need to patch the target to match the feedback. 2227 // merely need to patch the target to match the feedback.
2228 // TODO(mvstanton): the better approach is to dispense with patching 2228 // TODO(mvstanton): the better approach is to dispense with patching
2229 // altogether, which is in progress. 2229 // altogether, which is in progress.
2230 DCHECK(feedback == *TypeFeedbackVector::UninitializedSentinel(isolate()) || 2230 DCHECK(feedback == *TypeFeedbackVector::UninitializedSentinel(isolate()) ||
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
3004 static const Address IC_utilities[] = { 3004 static const Address IC_utilities[] = {
3005 #define ADDR(name) FUNCTION_ADDR(name), 3005 #define ADDR(name) FUNCTION_ADDR(name),
3006 IC_UTIL_LIST(ADDR) NULL 3006 IC_UTIL_LIST(ADDR) NULL
3007 #undef ADDR 3007 #undef ADDR
3008 }; 3008 };
3009 3009
3010 3010
3011 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 3011 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
3012 } 3012 }
3013 } // namespace v8::internal 3013 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/interface-descriptors-ia32.cc ('k') | src/interface-descriptors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698