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

Side by Side Diff: src/ic/x87/handler-compiler-x87.cc

Issue 2455953002: [ic] Remove unnecessary access rights checks from the IC handlers. (Closed)
Patch Set: Addressing comments and rebasing Created 4 years, 1 month 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
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_X87 5 #if V8_TARGET_ARCH_X87
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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 446
447 // Keep track of the current object in register reg. 447 // Keep track of the current object in register reg.
448 Register reg = object_reg; 448 Register reg = object_reg;
449 int depth = 0; 449 int depth = 0;
450 450
451 Handle<JSObject> current = Handle<JSObject>::null(); 451 Handle<JSObject> current = Handle<JSObject>::null();
452 if (receiver_map->IsJSGlobalObjectMap()) { 452 if (receiver_map->IsJSGlobalObjectMap()) {
453 current = isolate()->global_object(); 453 current = isolate()->global_object();
454 } 454 }
455 455
456 // Check access rights to the global object. This has to happen after
457 // the map check so that we know that the object is actually a global
458 // object.
459 // This allows us to install generated handlers for accesses to the
460 // global proxy (as opposed to using slow ICs). See corresponding code
461 // in LookupForRead().
462 if (receiver_map->IsJSGlobalProxyMap()) {
463 __ CheckAccessGlobalProxy(reg, scratch1, scratch2, miss);
464 }
465
466 Handle<JSObject> prototype = Handle<JSObject>::null(); 456 Handle<JSObject> prototype = Handle<JSObject>::null();
467 Handle<Map> current_map = receiver_map; 457 Handle<Map> current_map = receiver_map;
468 Handle<Map> holder_map(holder()->map()); 458 Handle<Map> holder_map(holder()->map());
469 // Traverse the prototype chain and check the maps in the prototype chain for 459 // Traverse the prototype chain and check the maps in the prototype chain for
470 // fast and global objects or do negative lookup for normal objects. 460 // fast and global objects or do negative lookup for normal objects.
471 while (!current_map.is_identical_to(holder_map)) { 461 while (!current_map.is_identical_to(holder_map)) {
472 ++depth; 462 ++depth;
473 463
474 // Only global objects and objects that do not require access
475 // checks are allowed in stubs.
476 DCHECK(current_map->IsJSGlobalProxyMap() ||
477 !current_map->is_access_check_needed());
478
479 prototype = handle(JSObject::cast(current_map->prototype())); 464 prototype = handle(JSObject::cast(current_map->prototype()));
480 if (current_map->IsJSGlobalObjectMap()) { 465 if (current_map->IsJSGlobalObjectMap()) {
481 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), 466 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current),
482 name, scratch2, miss); 467 name, scratch2, miss);
483 } else if (current_map->is_dictionary_map()) { 468 } else if (current_map->is_dictionary_map()) {
484 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. 469 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast.
485 DCHECK(name->IsUniqueName()); 470 DCHECK(name->IsUniqueName());
486 DCHECK(current.is_null() || 471 DCHECK(current.is_null() ||
487 current->property_dictionary()->FindEntry(name) == 472 current->property_dictionary()->FindEntry(name) ==
488 NameDictionary::kNotFound); 473 NameDictionary::kNotFound);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 // Return the generated code. 701 // Return the generated code.
717 return GetCode(kind(), name); 702 return GetCode(kind(), name);
718 } 703 }
719 704
720 705
721 #undef __ 706 #undef __
722 } // namespace internal 707 } // namespace internal
723 } // namespace v8 708 } // namespace v8
724 709
725 #endif // V8_TARGET_ARCH_X87 710 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/ic/x64/handler-compiler-x64.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698