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); |