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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2405213002: V8 support for cached accessors. (Closed)
Patch Set: Toon's feedback. Created 4 years, 1 month 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/api.cc ('k') | src/ic/ic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index d97461b1a9582d103736bd6902b6d6f9d82d7c0b..5735fc28501c845d5b9980602941d5e8b1c1db58 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -5340,6 +5340,7 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
}
LookupIterator it(global, variable->name(), LookupIterator::OWN);
+ it.TryLookupCachedProperty();
if (CanInlineGlobalPropertyAccess(variable, &it, LOAD)) {
InlineGlobalPropertyLoad(&it, expr->id());
return;
@@ -6151,6 +6152,18 @@ HValue* HOptimizedGraphBuilder::BuildMonomorphicAccess(
}
if (info->IsAccessorConstant()) {
+ MaybeHandle<Name> maybe_name =
+ FunctionTemplateInfo::TryGetCachedPropertyName(isolate(),
+ info->accessor());
+ if (!maybe_name.is_null()) {
+ Handle<Name> name = maybe_name.ToHandleChecked();
+ PropertyAccessInfo cache_info(this, LOAD, info->map(), name);
+ // Load new target.
+ if (cache_info.CanAccessMonomorphic()) {
+ return BuildLoadNamedField(&cache_info, checked_object);
+ }
+ }
+
Push(checked_object);
int argument_count = 1;
if (!info->IsLoad()) {
« no previous file with comments | « src/api.cc ('k') | src/ic/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698