Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index 9c675d0ce61f7d9c96de1b5d92474dab1d000d6e..6a02b79f8fab2ad16a4cbb229707e35dc02c561f 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -56,6 +56,14 @@ static MaybeHandle<Object> KeyedGetObjectProperty(Isolate* isolate, |
DisallowHeapAllocation no_allocation; |
Handle<JSObject> receiver = Handle<JSObject>::cast(receiver_obj); |
Handle<Name> key = Handle<Name>::cast(key_obj); |
+ // Get to a ThinString's referenced internalized string, but don't |
+ // otherwise force internalization. We assume that internalization |
+ // (which is a dictionary lookup with a non-internalized key) is |
+ // about as expensive as doing the property dictionary lookup with |
+ // the non-internalized key directly. |
+ if (key->IsThinString()) { |
+ key = handle(Handle<ThinString>::cast(key)->actual(), isolate); |
+ } |
if (receiver->IsJSGlobalObject()) { |
// Attempt dictionary lookup. |
GlobalDictionary* dictionary = receiver->global_dictionary(); |