Commit 83c66d82 authored by verwaest's avatar verwaest Committed by Commit bot

[TypeFeedbackVector/Crankshaft] Fix private symbol feedback.

This reduces runtime of https://github.com/kpdecker/six-speed/blob/master/tests/for-of-array/for-of-array.es6 by 40%.

BUG=

Review URL: https://codereview.chromium.org/1681143003

Cr-Commit-Position: refs/heads/master@{#33868}
parent 9ad61e6d
......@@ -6407,6 +6407,10 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::LoadFieldMaps(
bool HOptimizedGraphBuilder::PropertyAccessInfo::LookupInPrototypes() {
Handle<Map> map = this->map();
if (name_->IsPrivate()) {
NotFound();
return !map->has_hidden_prototype();
}
while (map->prototype()->IsJSObject()) {
holder_ = handle(JSObject::cast(map->prototype()));
......
......@@ -15,8 +15,13 @@ namespace internal {
static bool IsPropertyNameFeedback(Object* feedback) {
return feedback->IsString() ||
(feedback->IsSymbol() && !Symbol::cast(feedback)->is_private());
if (feedback->IsString()) return true;
if (!feedback->IsSymbol()) return false;
Symbol* symbol = Symbol::cast(feedback);
Heap* heap = symbol->GetHeap();
return symbol != heap->uninitialized_symbol() &&
symbol != heap->premonomorphic_symbol() &&
symbol != heap->megamorphic_symbol();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment