Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: src/type-feedback-vector.cc

Issue 1415333003: Alternative approach to using type feedback for Symbol-keyed properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | test/mjsunit/keyed-load-with-symbol-key.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-feedback-vector.cc
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc
index b860d12e84f42a741783b8ef1c0c7b9b5f22e3e3..9fb03bb67391b28e275c87faf194ef88d1e82a5e 100644
--- a/src/type-feedback-vector.cc
+++ b/src/type-feedback-vector.cc
@@ -13,6 +13,13 @@
namespace v8 {
namespace internal {
+
+static bool IsPropertyNameFeedback(Object* feedback) {
+ return feedback->IsString() ||
+ (feedback->IsSymbol() && !Symbol::cast(feedback)->is_private());
+}
+
+
std::ostream& operator<<(std::ostream& os, FeedbackVectorSlotKind kind) {
return os << TypeFeedbackMetadata::Kind2String(kind);
}
@@ -650,9 +657,10 @@ void KeyedStoreICNexus::ConfigurePolymorphic(MapHandleList* maps,
int FeedbackNexus::ExtractMaps(MapHandleList* maps) const {
Isolate* isolate = GetIsolate();
Object* feedback = GetFeedback();
- if (feedback->IsFixedArray() || feedback->IsString()) {
+ bool is_named_feedback = IsPropertyNameFeedback(feedback);
+ if (feedback->IsFixedArray() || is_named_feedback) {
int found = 0;
- if (feedback->IsString()) {
+ if (is_named_feedback) {
feedback = GetFeedbackExtra();
}
FixedArray* array = FixedArray::cast(feedback);
@@ -687,8 +695,9 @@ int FeedbackNexus::ExtractMaps(MapHandleList* maps) const {
MaybeHandle<Code> FeedbackNexus::FindHandlerForMap(Handle<Map> map) const {
Object* feedback = GetFeedback();
- if (feedback->IsFixedArray() || feedback->IsString()) {
- if (feedback->IsString()) {
+ bool is_named_feedback = IsPropertyNameFeedback(feedback);
+ if (feedback->IsFixedArray() || is_named_feedback) {
+ if (is_named_feedback) {
feedback = GetFeedbackExtra();
}
FixedArray* array = FixedArray::cast(feedback);
@@ -725,8 +734,9 @@ MaybeHandle<Code> FeedbackNexus::FindHandlerForMap(Handle<Map> map) const {
bool FeedbackNexus::FindHandlers(CodeHandleList* code_list, int length) const {
Object* feedback = GetFeedback();
int count = 0;
- if (feedback->IsFixedArray() || feedback->IsString()) {
- if (feedback->IsString()) {
+ bool is_named_feedback = IsPropertyNameFeedback(feedback);
+ if (feedback->IsFixedArray() || is_named_feedback) {
+ if (is_named_feedback) {
feedback = GetFeedbackExtra();
}
FixedArray* array = FixedArray::cast(feedback);
@@ -770,7 +780,7 @@ void KeyedLoadICNexus::Clear(Code* host) {
Name* KeyedLoadICNexus::FindFirstName() const {
Object* feedback = GetFeedback();
- if (feedback->IsString()) {
+ if (IsPropertyNameFeedback(feedback)) {
return Name::cast(feedback);
}
return NULL;
@@ -779,7 +789,7 @@ Name* KeyedLoadICNexus::FindFirstName() const {
Name* KeyedStoreICNexus::FindFirstName() const {
Object* feedback = GetFeedback();
- if (feedback->IsString()) {
+ if (IsPropertyNameFeedback(feedback)) {
return Name::cast(feedback);
}
return NULL;
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | test/mjsunit/keyed-load-with-symbol-key.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698