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

Side by Side Diff: src/compiler/access-info.cc

Issue 2619773002: [turbofan] Use feedback from StoreDataPropertyInLiteral. (Closed)
Patch Set: Delete comment. Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <ostream> 5 #include <ostream>
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/compilation-dependencies.h" 8 #include "src/compilation-dependencies.h"
9 #include "src/compiler/access-info.h" 9 #include "src/compiler/access-info.h"
10 #include "src/compiler/type-cache.h" 10 #include "src/compiler/type-cache.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 } // namespace 46 } // namespace
47 47
48 48
49 std::ostream& operator<<(std::ostream& os, AccessMode access_mode) { 49 std::ostream& operator<<(std::ostream& os, AccessMode access_mode) {
50 switch (access_mode) { 50 switch (access_mode) {
51 case AccessMode::kLoad: 51 case AccessMode::kLoad:
52 return os << "Load"; 52 return os << "Load";
53 case AccessMode::kStore: 53 case AccessMode::kStore:
54 return os << "Store"; 54 return os << "Store";
55 case AccessMode::kStoreInLiteral:
56 return os << "StoreInLiteral";
55 } 57 }
56 UNREACHABLE(); 58 UNREACHABLE();
57 return os; 59 return os;
58 } 60 }
59 61
60 ElementAccessInfo::ElementAccessInfo() {} 62 ElementAccessInfo::ElementAccessInfo() {}
61 63
62 ElementAccessInfo::ElementAccessInfo(MapList const& receiver_maps, 64 ElementAccessInfo::ElementAccessInfo(MapList const& receiver_maps,
63 ElementsKind elements_kind) 65 ElementsKind elements_kind)
64 : elements_kind_(elements_kind), receiver_maps_(receiver_maps) {} 66 : elements_kind_(elements_kind), receiver_maps_(receiver_maps) {}
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 return true; 277 return true;
276 } 278 }
277 279
278 MaybeHandle<JSObject> holder; 280 MaybeHandle<JSObject> holder;
279 do { 281 do {
280 // Lookup the named property on the {map}. 282 // Lookup the named property on the {map}.
281 Handle<DescriptorArray> descriptors(map->instance_descriptors(), isolate()); 283 Handle<DescriptorArray> descriptors(map->instance_descriptors(), isolate());
282 int const number = descriptors->SearchWithCache(isolate(), *name, *map); 284 int const number = descriptors->SearchWithCache(isolate(), *name, *map);
283 if (number != DescriptorArray::kNotFound) { 285 if (number != DescriptorArray::kNotFound) {
284 PropertyDetails const details = descriptors->GetDetails(number); 286 PropertyDetails const details = descriptors->GetDetails(number);
285 if (access_mode == AccessMode::kStore) { 287 if (access_mode == AccessMode::kStore ||
288 access_mode == AccessMode::kStoreInLiteral) {
286 // Don't bother optimizing stores to read-only properties. 289 // Don't bother optimizing stores to read-only properties.
287 if (details.IsReadOnly()) { 290 if (details.IsReadOnly()) {
288 return false; 291 return false;
289 } 292 }
290 // Check for store to data property on a prototype. 293 // Check for store to data property on a prototype.
291 if (details.kind() == kData && !holder.is_null()) { 294 if (details.kind() == kData && !holder.is_null()) {
292 // Store to property not found on the receiver but on a prototype, we 295 // Store to property not found on the receiver but on a prototype, we
293 // need to transition to a new data property. 296 // need to transition to a new data property.
294 // Implemented according to ES6 section 9.1.9 [[Set]] (P, V, Receiver) 297 // Implemented according to ES6 section 9.1.9 [[Set]] (P, V, Receiver)
295 return LookupTransition(receiver_map, name, holder, access_info); 298 return LookupTransition(receiver_map, name, holder, access_info);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 return false; 378 return false;
376 } 379 }
377 380
378 // Don't search on the prototype chain for special indices in case of 381 // Don't search on the prototype chain for special indices in case of
379 // integer indexed exotic objects (see ES6 section 9.4.5). 382 // integer indexed exotic objects (see ES6 section 9.4.5).
380 if (map->IsJSTypedArrayMap() && name->IsString() && 383 if (map->IsJSTypedArrayMap() && name->IsString() &&
381 IsSpecialIndex(isolate()->unicode_cache(), String::cast(*name))) { 384 IsSpecialIndex(isolate()->unicode_cache(), String::cast(*name))) {
382 return false; 385 return false;
383 } 386 }
384 387
388 // Don't search on the prototype when storing in literals
389 if (access_mode == AccessMode::kStoreInLiteral) {
390 return false;
391 }
392
385 // Don't lookup private symbols on the prototype chain. 393 // Don't lookup private symbols on the prototype chain.
386 if (name->IsPrivate()) return false; 394 if (name->IsPrivate()) return false;
387 395
388 // Walk up the prototype chain. 396 // Walk up the prototype chain.
389 if (!map->prototype()->IsJSObject()) { 397 if (!map->prototype()->IsJSObject()) {
390 // Perform the implicit ToObject for primitives here. 398 // Perform the implicit ToObject for primitives here.
391 // Implemented according to ES6 section 7.3.2 GetV (V, P). 399 // Implemented according to ES6 section 7.3.2 GetV (V, P).
392 Handle<JSFunction> constructor; 400 Handle<JSFunction> constructor;
393 if (Map::GetConstructorFunction(map, native_context()) 401 if (Map::GetConstructorFunction(map, native_context())
394 .ToHandle(&constructor)) { 402 .ToHandle(&constructor)) {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 554 }
547 return false; 555 return false;
548 } 556 }
549 557
550 558
551 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } 559 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); }
552 560
553 } // namespace compiler 561 } // namespace compiler
554 } // namespace internal 562 } // namespace internal
555 } // namespace v8 563 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698