Index: src/ic/handler-compiler.cc |
diff --git a/src/ic/handler-compiler.cc b/src/ic/handler-compiler.cc |
index a1d1467ab1f3600d1994d7d62c4380db4408ccf2..b6b81def540278a1a2fa89c337d6f2dc1c1c1396 100644 |
--- a/src/ic/handler-compiler.cc |
+++ b/src/ic/handler-compiler.cc |
@@ -6,6 +6,7 @@ |
#include "src/field-type.h" |
#include "src/ic/call-optimization.h" |
+#include "src/ic/handler-configuration.h" |
#include "src/ic/ic-inl.h" |
#include "src/ic/ic.h" |
#include "src/isolate-inl.h" |
@@ -577,7 +578,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 +611,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) | |
+ LoadHandlerTypeBit::encode(kLoadICHandlerForElements); |
+ 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( |