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

Unified Diff: src/compiler/js-native-context-specialization.cc

Issue 1409273005: [turbofan] Use correct map for special JSObject accessors. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-native-context-specialization.cc
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
index 0bd131960ef34e77c2f8da96d945725b331d6b9a..f7312b31534dc41462e408a463889feed57bece7 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -313,8 +313,7 @@ bool CanInlinePropertyAccess(Handle<Map> map) {
bool JSNativeContextSpecialization::ComputePropertyAccessInfo(
Handle<Map> map, Handle<Name> name, PropertyAccessInfo* access_info) {
MaybeHandle<JSObject> holder;
- Handle<Map> receiver_map = map;
- Type* receiver_type = Type::Class(receiver_map, graph()->zone());
+ Type* receiver_type = Type::Class(map, graph()->zone());
while (CanInlinePropertyAccess(map)) {
// Check for special JSObject field accessors.
int offset;
@@ -322,7 +321,7 @@ bool JSNativeContextSpecialization::ComputePropertyAccessInfo(
FieldIndex field_index = FieldIndex::ForInObjectOffset(offset);
Representation field_representation = Representation::Tagged();
Type* field_type = Type::Tagged();
- if (receiver_type->Is(Type::String())) {
+ if (map->IsStringMap()) {
DCHECK(Name::Equals(factory()->length_string(), name));
// The String::length property is always a smi in the range
// [0, String::kMaxLength].
@@ -330,7 +329,7 @@ bool JSNativeContextSpecialization::ComputePropertyAccessInfo(
field_type = Type::Intersect(
Type::Range(0.0, String::kMaxLength, graph()->zone()),
Type::TaggedSigned(), graph()->zone());
- } else if (receiver_map->IsJSArrayMap()) {
+ } else if (map->IsJSArrayMap()) {
DCHECK(Name::Equals(factory()->length_string(), name));
// The JSArray::length property is a smi in the range
// [0, FixedDoubleArray::kMaxLength] in case of fast double
@@ -338,12 +337,11 @@ bool JSNativeContextSpecialization::ComputePropertyAccessInfo(
// in case of other fast elements, and [0, kMaxUInt32-1] in
// case of other arrays.
double field_type_upper = kMaxUInt32 - 1;
- if (IsFastElementsKind(receiver_map->elements_kind())) {
+ if (IsFastElementsKind(map->elements_kind())) {
field_representation = Representation::Smi();
- field_type_upper =
- IsFastDoubleElementsKind(receiver_map->elements_kind())
- ? FixedDoubleArray::kMaxLength
- : FixedArray::kMaxLength;
+ field_type_upper = IsFastDoubleElementsKind(map->elements_kind())
+ ? FixedDoubleArray::kMaxLength
+ : FixedArray::kMaxLength;
}
field_type =
Type::Intersect(Type::Range(0.0, field_type_upper, graph()->zone()),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698