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

Unified Diff: src/compiler/access-info.cc

Issue 2517913002: [turbofan] Introduce LoadFunctionPrototype simplified operator. (Closed)
Patch Set: 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/compiler/access-info.h ('k') | src/compiler/effect-control-linearizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/access-info.cc
diff --git a/src/compiler/access-info.cc b/src/compiler/access-info.cc
index 866b06086a2042df0f6a811e25c7fa8a1f36ce62..b09f3fa42560585ba942d47cd391fca73e32cd7d 100644
--- a/src/compiler/access-info.cc
+++ b/src/compiler/access-info.cc
@@ -95,6 +95,13 @@ PropertyAccessInfo PropertyAccessInfo::AccessorConstant(
}
// static
+PropertyAccessInfo PropertyAccessInfo::FunctionPrototype(
+ MapList const& receiver_maps) {
+ return PropertyAccessInfo(kFunctionPrototype, MaybeHandle<JSObject>(),
+ Handle<Object>(), receiver_maps);
+}
+
+// static
PropertyAccessInfo PropertyAccessInfo::Generic(MapList const& receiver_maps) {
return PropertyAccessInfo(kGeneric, MaybeHandle<JSObject>(), Handle<Object>(),
receiver_maps);
@@ -144,9 +151,6 @@ bool PropertyAccessInfo::Merge(PropertyAccessInfo const* that) {
case kInvalid:
break;
- case kNotFound:
- return true;
-
case kDataField: {
// Check if we actually access the same field.
if (this->transition_map_.address() == that->transition_map_.address() &&
@@ -173,6 +177,9 @@ bool PropertyAccessInfo::Merge(PropertyAccessInfo const* that) {
}
return false;
}
+
+ case kNotFound:
+ case kFunctionPrototype:
case kGeneric: {
this->receiver_maps_.insert(this->receiver_maps_.end(),
that->receiver_maps_.begin(),
@@ -449,6 +456,13 @@ bool AccessInfoFactory::ComputePropertyAccessInfos(
bool AccessInfoFactory::LookupSpecialFieldAccessor(
Handle<Map> map, Handle<Name> name, PropertyAccessInfo* access_info) {
+ // Check for Function::prototype accessor.
+ if (map->IsJSFunctionMap() && map->is_constructor() &&
+ name.is_identical_to(factory()->prototype_string())) {
+ DCHECK(!map->has_non_instance_prototype());
+ *access_info = PropertyAccessInfo::FunctionPrototype(MapList{map});
+ return true;
+ }
// Check for special JSObject field accessors.
int offset;
if (Accessors::IsJSObjectFieldAccessor(map, name, &offset)) {
« no previous file with comments | « src/compiler/access-info.h ('k') | src/compiler/effect-control-linearizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698