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

Side by Side Diff: src/ic/s390/handler-compiler-s390.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/ppc/handler-compiler-ppc.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('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 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 #if V8_TARGET_ARCH_S390 5 #if V8_TARGET_ARCH_S390
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 } 416 }
417 417
418 // Keep track of the current object in register reg. 418 // Keep track of the current object in register reg.
419 Register reg = object_reg; 419 Register reg = object_reg;
420 int depth = 0; 420 int depth = 0;
421 421
422 Handle<JSObject> current = Handle<JSObject>::null(); 422 Handle<JSObject> current = Handle<JSObject>::null();
423 if (receiver_map->IsJSGlobalObjectMap()) { 423 if (receiver_map->IsJSGlobalObjectMap()) {
424 current = isolate()->global_object(); 424 current = isolate()->global_object();
425 } 425 }
426 // Check access rights to the global object. This has to happen after
427 // the map check so that we know that the object is actually a global
428 // object.
429 // This allows us to install generated handlers for accesses to the
430 // global proxy (as opposed to using slow ICs). See corresponding code
431 // in LookupForRead().
432 if (receiver_map->IsJSGlobalProxyMap()) {
433 __ CheckAccessGlobalProxy(reg, scratch2, miss);
434 }
435 426
436 Handle<JSObject> prototype = Handle<JSObject>::null(); 427 Handle<JSObject> prototype = Handle<JSObject>::null();
437 Handle<Map> current_map = receiver_map; 428 Handle<Map> current_map = receiver_map;
438 Handle<Map> holder_map(holder()->map()); 429 Handle<Map> holder_map(holder()->map());
439 // Traverse the prototype chain and check the maps in the prototype chain for 430 // Traverse the prototype chain and check the maps in the prototype chain for
440 // fast and global objects or do negative lookup for normal objects. 431 // fast and global objects or do negative lookup for normal objects.
441 while (!current_map.is_identical_to(holder_map)) { 432 while (!current_map.is_identical_to(holder_map)) {
442 ++depth; 433 ++depth;
443 434
444 // Only global objects and objects that do not require access
445 // checks are allowed in stubs.
446 DCHECK(current_map->IsJSGlobalProxyMap() ||
447 !current_map->is_access_check_needed());
448
449 prototype = handle(JSObject::cast(current_map->prototype())); 435 prototype = handle(JSObject::cast(current_map->prototype()));
450 if (current_map->IsJSGlobalObjectMap()) { 436 if (current_map->IsJSGlobalObjectMap()) {
451 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), 437 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current),
452 name, scratch2, miss); 438 name, scratch2, miss);
453 } else if (current_map->is_dictionary_map()) { 439 } else if (current_map->is_dictionary_map()) {
454 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast. 440 DCHECK(!current_map->IsJSGlobalProxyMap()); // Proxy maps are fast.
455 DCHECK(name->IsUniqueName()); 441 DCHECK(name->IsUniqueName());
456 DCHECK(current.is_null() || 442 DCHECK(current.is_null() ||
457 current->property_dictionary()->FindEntry(name) == 443 current->property_dictionary()->FindEntry(name) ==
458 NameDictionary::kNotFound); 444 NameDictionary::kNotFound);
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 639
654 // Return the generated code. 640 // Return the generated code.
655 return GetCode(kind(), name); 641 return GetCode(kind(), name);
656 } 642 }
657 643
658 #undef __ 644 #undef __
659 } // namespace internal 645 } // namespace internal
660 } // namespace v8 646 } // namespace v8
661 647
662 #endif // V8_TARGET_ARCH_ARM 648 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ic/ppc/handler-compiler-ppc.cc ('k') | src/ic/x64/handler-compiler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698