Index: src/ic/handler-compiler.cc |
diff --git a/src/ic/handler-compiler.cc b/src/ic/handler-compiler.cc |
index a1d1467ab1f3600d1994d7d62c4380db4408ccf2..72d945d9865d8f57f3c4091a0e7b02620cb8bd5f 100644 |
--- a/src/ic/handler-compiler.cc |
+++ b/src/ic/handler-compiler.cc |
@@ -577,7 +577,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
#undef __ |
// static |
-Handle<Code> ElementHandlerCompiler::GetKeyedLoadHandler( |
+Handle<Object> ElementHandlerCompiler::GetKeyedLoadHandler( |
Handle<Map> receiver_map, Isolate* isolate) { |
if (receiver_map->has_indexed_interceptor() && |
!receiver_map->GetIndexedInterceptor()->getter()->IsUndefined(isolate) && |
@@ -610,10 +610,18 @@ Handle<Code> ElementHandlerCompiler::GetKeyedLoadHandler( |
bool convert_hole_to_undefined = |
is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && |
*receiver_map == isolate->get_initial_js_array_map(elements_kind); |
- TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadFastElementStub); |
- return LoadFastElementStub(isolate, is_js_array, elements_kind, |
- convert_hole_to_undefined) |
- .GetCode(); |
+ if (FLAG_tf_load_ic_stub) { |
+ int config = KeyedLoadElementsKind::encode(elements_kind) | |
+ KeyedLoadConvertHole::encode(convert_hole_to_undefined) | |
+ KeyedLoadIsJsarray::encode(is_js_array) | |
+ 0; // Element marker (as opposed to property). |
+ return handle(Smi::FromInt(config), isolate); |
+ } else { |
+ TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadFastElementStub); |
+ return LoadFastElementStub(isolate, is_js_array, elements_kind, |
+ convert_hole_to_undefined) |
+ .GetCode(); |
+ } |
} |
void ElementHandlerCompiler::CompileElementHandlers( |