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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 428 |
429 // Keep track of the current object in register reg. | 429 // Keep track of the current object in register reg. |
430 Register reg = object_reg; | 430 Register reg = object_reg; |
431 int depth = 0; | 431 int depth = 0; |
432 | 432 |
433 Handle<JSObject> current = Handle<JSObject>::null(); | 433 Handle<JSObject> current = Handle<JSObject>::null(); |
434 if (receiver_map->IsJSGlobalObjectMap()) { | 434 if (receiver_map->IsJSGlobalObjectMap()) { |
435 current = isolate()->global_object(); | 435 current = isolate()->global_object(); |
436 } | 436 } |
437 | 437 |
438 // Check access rights to the global object. This has to happen after | |
439 // the map check so that we know that the object is actually a global | |
440 // object. | |
441 // This allows us to install generated handlers for accesses to the | |
442 // global proxy (as opposed to using slow ICs). See corresponding code | |
443 // in LookupForRead(). | |
444 if (receiver_map->IsJSGlobalProxyMap()) { | |
445 __ CheckAccessGlobalProxy(reg, scratch2, miss); | |
446 } | |
447 | |
448 Handle<JSObject> prototype = Handle<JSObject>::null(); | 438 Handle<JSObject> prototype = Handle<JSObject>::null(); |
449 Handle<Map> current_map = receiver_map; | 439 Handle<Map> current_map = receiver_map; |
450 Handle<Map> holder_map(holder()->map()); | 440 Handle<Map> holder_map(holder()->map()); |
451 // Traverse the prototype chain and check the maps in the prototype chain for | 441 // Traverse the prototype chain and check the maps in the prototype chain for |
452 // fast and global objects or do negative lookup for normal objects. | 442 // fast and global objects or do negative lookup for normal objects. |
453 while (!current_map.is_identical_to(holder_map)) { | 443 while (!current_map.is_identical_to(holder_map)) { |
454 ++depth; | 444 ++depth; |
455 | 445 |
456 // Only global objects and objects that do not require access | |
457 // checks are allowed in stubs. | |
458 DCHECK(current_map->IsJSGlobalProxyMap() || | |
459 !current_map->is_access_check_needed()); | |
460 | |
461 prototype = handle(JSObject::cast(current_map->prototype())); | 446 prototype = handle(JSObject::cast(current_map->prototype())); |
462 if (current_map->IsJSGlobalObjectMap()) { | 447 if (current_map->IsJSGlobalObjectMap()) { |
463 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), | 448 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), |
464 name, scratch2, miss); | 449 name, scratch2, miss); |
465 } else if (current_map->is_dictionary_map()) { | 450 } else if (current_map->is_dictionary_map()) { |
466 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. | 451 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. |
467 DCHECK(name->IsUniqueName()); | 452 DCHECK(name->IsUniqueName()); |
468 DCHECK(current.is_null() || | 453 DCHECK(current.is_null() || |
469 current->property_dictionary()->FindEntry(name) == | 454 current->property_dictionary()->FindEntry(name) == |
470 NameDictionary::kNotFound); | 455 NameDictionary::kNotFound); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 // Return the generated code. | 659 // Return the generated code. |
675 return GetCode(kind(), name); | 660 return GetCode(kind(), name); |
676 } | 661 } |
677 | 662 |
678 | 663 |
679 #undef __ | 664 #undef __ |
680 } // namespace internal | 665 } // namespace internal |
681 } // namespace v8 | 666 } // namespace v8 |
682 | 667 |
683 #endif // V8_TARGET_ARCH_MIPS64 | 668 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |