 Chromium Code Reviews
 Chromium Code Reviews Issue 2811333002:
  [builtins] HasOwnProperty: handle non-internalized string keys  (Closed)
    
  
    Issue 2811333002:
  [builtins] HasOwnProperty: handle non-internalized string keys  (Closed) 
  | Index: src/ic/accessor-assembler.cc | 
| diff --git a/src/ic/accessor-assembler.cc b/src/ic/accessor-assembler.cc | 
| index eb3971c54fcbc85bc806454c265055228534d248..0b2e0743d38ec9c267a7cb7d58916eb25b7b0ad9 100644 | 
| --- a/src/ic/accessor-assembler.cc | 
| +++ b/src/ic/accessor-assembler.cc | 
| @@ -2112,6 +2112,35 @@ void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) { | 
| var_unique.value(), p, &slow); | 
| } | 
| + // TODO(jkummerow): The code below internalizes strings on the fly, but | 
| + // it currently adds too much load on the stub cache. Find a solution | 
| + // for stub cache overload issues and enable this! | 
| + /* { | 
| 
Igor Sheludko
2017/04/13 11:38:54
I'd suggest to add a read-only bool option and do
 
Jakob Kummerow
2017/04/13 14:01:52
Done.
 | 
| + Node* function = ExternalConstant( | 
| + ExternalReference::try_internalize_string_function(isolate())); | 
| + Node* result = CallCFunction1(MachineType::AnyTagged(), | 
| + MachineType::AnyTagged(), function, p->name); | 
| + // If internalization failed, then the string did not exist in the string | 
| + // table yet, which implies that no existing object has a property with | 
| + // that name. | 
| + Label internalized(this), not_found(this); | 
| + GotoIf(TaggedIsNotSmi(result), &internalized); | 
| + Node* int_result = SmiUntag(result); | 
| 
Igor Sheludko
2017/04/13 11:38:53
s/int_result/word_result/ ?
 
Jakob Kummerow
2017/04/13 14:01:52
Done.
 | 
| + GotoIf(WordEqual(int_result, IntPtrConstant(ResultSentinel::kNotFound)), | 
| + ¬_found); | 
| + GotoIf(WordEqual(int_result, IntPtrConstant(ResultSentinel::kUnsupported)), | 
| + &slow); | 
| + var_index.Bind(int_result); | 
| + Goto(&if_index); | 
| + | 
| + BIND(&internalized); | 
| + var_unique.Bind(result); | 
| + Goto(&if_unique_name); | 
| + | 
| + BIND(¬_found); | 
| + Return(UndefinedConstant()); | 
| + } */ | 
| + | 
| BIND(&slow); | 
| { | 
| Comment("KeyedLoadGeneric_slow"); |