OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 | 8 |
9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 | 442 |
443 // Keep track of the current object in register reg. | 443 // Keep track of the current object in register reg. |
444 Register reg = object_reg; | 444 Register reg = object_reg; |
445 int depth = 0; | 445 int depth = 0; |
446 | 446 |
447 Handle<JSObject> current = Handle<JSObject>::null(); | 447 Handle<JSObject> current = Handle<JSObject>::null(); |
448 if (receiver_map->IsJSGlobalObjectMap()) { | 448 if (receiver_map->IsJSGlobalObjectMap()) { |
449 current = isolate()->global_object(); | 449 current = isolate()->global_object(); |
450 } | 450 } |
451 | 451 |
452 // Check access rights to the global object. This has to happen after | |
453 // the map check so that we know that the object is actually a global | |
454 // object. | |
455 // This allows us to install generated handlers for accesses to the | |
456 // global proxy (as opposed to using slow ICs). See corresponding code | |
457 // in LookupForRead(). | |
458 if (receiver_map->IsJSGlobalProxyMap()) { | |
459 __ CheckAccessGlobalProxy(reg, scratch2, miss); | |
460 } | |
461 | |
462 Handle<JSObject> prototype = Handle<JSObject>::null(); | 452 Handle<JSObject> prototype = Handle<JSObject>::null(); |
463 Handle<Map> current_map = receiver_map; | 453 Handle<Map> current_map = receiver_map; |
464 Handle<Map> holder_map(holder()->map()); | 454 Handle<Map> holder_map(holder()->map()); |
465 // Traverse the prototype chain and check the maps in the prototype chain for | 455 // Traverse the prototype chain and check the maps in the prototype chain for |
466 // fast and global objects or do negative lookup for normal objects. | 456 // fast and global objects or do negative lookup for normal objects. |
467 while (!current_map.is_identical_to(holder_map)) { | 457 while (!current_map.is_identical_to(holder_map)) { |
468 ++depth; | 458 ++depth; |
469 | 459 |
470 // Only global objects and objects that do not require access | |
471 // checks are allowed in stubs. | |
472 DCHECK(current_map->IsJSGlobalProxyMap() || | |
473 !current_map->is_access_check_needed()); | |
474 | |
475 prototype = handle(JSObject::cast(current_map->prototype())); | 460 prototype = handle(JSObject::cast(current_map->prototype())); |
476 if (current_map->IsJSGlobalObjectMap()) { | 461 if (current_map->IsJSGlobalObjectMap()) { |
477 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), | 462 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), |
478 name, scratch2, miss); | 463 name, scratch2, miss); |
479 } else if (current_map->is_dictionary_map()) { | 464 } else if (current_map->is_dictionary_map()) { |
480 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. | 465 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. |
481 DCHECK(name->IsUniqueName()); | 466 DCHECK(name->IsUniqueName()); |
482 DCHECK(current.is_null() || | 467 DCHECK(current.is_null() || |
483 current->property_dictionary()->FindEntry(name) == | 468 current->property_dictionary()->FindEntry(name) == |
484 NameDictionary::kNotFound); | 469 NameDictionary::kNotFound); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 // Return the generated code. | 674 // Return the generated code. |
690 return GetCode(kind(), name); | 675 return GetCode(kind(), name); |
691 } | 676 } |
692 | 677 |
693 | 678 |
694 #undef __ | 679 #undef __ |
695 } // namespace internal | 680 } // namespace internal |
696 } // namespace v8 | 681 } // namespace v8 |
697 | 682 |
698 #endif // V8_TARGET_ARCH_ARM | 683 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |