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

Unified Diff: src/ic.cc

Issue 408193002: Move function prototype handling into a special handler rather than IC (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Don't ensure that the IC state is monomorphic, but rather that the stubcache only contains handlers Created 6 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/ia32/lithium-codegen-ia32.cc ('k') | src/stub-cache.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 829db7d9e65627b089b7a07034eac63603ede41b..d3223055c31cd49f7fe45f9e56145f6dbef4f433 100644
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -558,31 +558,6 @@ MaybeHandle<Object> LoadIC::Load(Handle<Object> object, Handle<String> name) {
return TypeError("non_object_property_load", object, name);
}
- if (FLAG_use_ic) {
- // Use specialized code for getting prototype of functions.
- if (object->IsJSFunction() &&
- String::Equals(isolate()->factory()->prototype_string(), name) &&
- Handle<JSFunction>::cast(object)->should_have_prototype()) {
- Handle<Code> stub;
- if (state() == UNINITIALIZED) {
- stub = pre_monomorphic_stub();
- } else if (state() == PREMONOMORPHIC) {
- FunctionPrototypeStub function_prototype_stub(isolate(), kind());
- stub = function_prototype_stub.GetCode();
- } else if (!FLAG_compiled_keyed_generic_loads && state() != MEGAMORPHIC) {
- ASSERT(state() != GENERIC);
- stub = megamorphic_stub();
- } else if (FLAG_compiled_keyed_generic_loads && state() != GENERIC) {
- stub = generic_stub();
- }
- if (!stub.is_null()) {
- set_target(*stub);
- if (FLAG_trace_ic) PrintF("[LoadIC : +#prototype /function]\n");
- }
- return Accessors::FunctionGetPrototype(Handle<JSFunction>::cast(object));
- }
- }
-
// Check if the name is trivially convertible to an index and get
// the element or char if so.
uint32_t index;
@@ -959,6 +934,16 @@ Handle<Code> LoadIC::CompileHandler(LookupResult* lookup, Handle<Object> object,
}
}
+ // Use specialized code for getting prototype of functions.
+ if (object->IsJSFunction() &&
+ String::Equals(isolate()->factory()->prototype_string(), name) &&
+ Handle<JSFunction>::cast(object)->should_have_prototype()) {
+ Handle<Code> stub;
+ FunctionPrototypeStub function_prototype_stub(isolate(), kind());
+ return function_prototype_stub.GetCode();
+ }
+
+
Handle<HeapType> type = receiver_type();
Handle<JSObject> holder(lookup->holder());
bool receiver_is_holder = object.is_identical_to(holder);
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698