OLD | NEW |
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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 if (!accessor->IsJSFunction()) { | 366 if (!accessor->IsJSFunction()) { |
367 CallOptimization optimization(accessor); | 367 CallOptimization optimization(accessor); |
368 if (!optimization.is_simple_api_call()) { | 368 if (!optimization.is_simple_api_call()) { |
369 return false; | 369 return false; |
370 } | 370 } |
371 if (optimization.api_call_info()->fast_handler()->IsCode()) { | 371 if (optimization.api_call_info()->fast_handler()->IsCode()) { |
372 return false; | 372 return false; |
373 } | 373 } |
374 if (V8_UNLIKELY(FLAG_runtime_stats)) return false; | 374 if (V8_UNLIKELY(FLAG_runtime_stats)) return false; |
375 } | 375 } |
| 376 if (access_mode == AccessMode::kLoad) { |
| 377 Handle<Name> cached_property_name; |
| 378 if (FunctionTemplateInfo::TryGetCachedPropertyName(isolate(), |
| 379 accessor) |
| 380 .ToHandle(&cached_property_name)) { |
| 381 if (ComputePropertyAccessInfo(map, cached_property_name, |
| 382 access_mode, access_info)) { |
| 383 return true; |
| 384 } |
| 385 } |
| 386 } |
376 *access_info = PropertyAccessInfo::AccessorConstant( | 387 *access_info = PropertyAccessInfo::AccessorConstant( |
377 MapList{receiver_map}, accessor, holder); | 388 MapList{receiver_map}, accessor, holder); |
378 return true; | 389 return true; |
379 } | 390 } |
380 } | 391 } |
381 UNREACHABLE(); | 392 UNREACHABLE(); |
382 return false; | 393 return false; |
383 } | 394 } |
384 | 395 |
385 // Don't search on the prototype chain for special indices in case of | 396 // Don't search on the prototype chain for special indices in case of |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 } | 569 } |
559 return false; | 570 return false; |
560 } | 571 } |
561 | 572 |
562 | 573 |
563 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } | 574 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } |
564 | 575 |
565 } // namespace compiler | 576 } // namespace compiler |
566 } // namespace internal | 577 } // namespace internal |
567 } // namespace v8 | 578 } // namespace v8 |
OLD | NEW |