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

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

Issue 2482913002: [ic] Resurrect access checks for primitive and global proxy receivers. (Closed)
Patch Set: Addressing comments 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/arm/handler-compiler-arm.cc ('k') | src/ic/handler-compiler.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 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 DCHECK(!value_reg.is(scratch)); 430 DCHECK(!value_reg.is(scratch));
431 __ JumpIfSmi(value_reg, miss_label); 431 __ JumpIfSmi(value_reg, miss_label);
432 if (field_type->IsClass()) { 432 if (field_type->IsClass()) {
433 __ Ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); 433 __ Ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset));
434 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), 434 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()),
435 scratch); 435 scratch);
436 __ B(ne, miss_label); 436 __ B(ne, miss_label);
437 } 437 }
438 } 438 }
439 439
440 void PropertyHandlerCompiler::GenerateAccessCheck(
441 Handle<WeakCell> native_context_cell, Register scratch1, Register scratch2,
442 Label* miss, bool compare_native_contexts_only) {
443 Label done;
444 // Load current native context.
445 __ Ldr(scratch1, NativeContextMemOperand());
446 // Load expected native context.
447 __ LoadWeakValue(scratch2, native_context_cell, miss);
448 __ Cmp(scratch1, scratch2);
449
450 if (!compare_native_contexts_only) {
451 __ B(eq, &done);
452
453 // Compare security tokens of current and expected native contexts.
454 __ Ldr(scratch1,
455 ContextMemOperand(scratch1, Context::SECURITY_TOKEN_INDEX));
456 __ Ldr(scratch2,
457 ContextMemOperand(scratch2, Context::SECURITY_TOKEN_INDEX));
458 __ Cmp(scratch1, scratch2);
459 }
460 __ B(ne, miss);
461
462 __ bind(&done);
463 }
464
440 Register PropertyHandlerCompiler::CheckPrototypes( 465 Register PropertyHandlerCompiler::CheckPrototypes(
441 Register object_reg, Register holder_reg, Register scratch1, 466 Register object_reg, Register holder_reg, Register scratch1,
442 Register scratch2, Handle<Name> name, Label* miss, 467 Register scratch2, Handle<Name> name, Label* miss,
443 ReturnHolder return_what) { 468 ReturnHolder return_what) {
444 Handle<Map> receiver_map = map(); 469 Handle<Map> receiver_map = map();
445 470
446 // object_reg and holder_reg registers can alias. 471 // object_reg and holder_reg registers can alias.
447 DCHECK(!AreAliased(object_reg, scratch1, scratch2)); 472 DCHECK(!AreAliased(object_reg, scratch1, scratch2));
448 DCHECK(!AreAliased(holder_reg, scratch1, scratch2)); 473 DCHECK(!AreAliased(holder_reg, scratch1, scratch2));
449 474
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 // Return the generated code. 682 // Return the generated code.
658 return GetCode(kind(), name); 683 return GetCode(kind(), name);
659 } 684 }
660 685
661 686
662 #undef __ 687 #undef __
663 } // namespace internal 688 } // namespace internal
664 } // namespace v8 689 } // namespace v8
665 690
666 #endif // V8_TARGET_ARCH_IA32 691 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/arm/handler-compiler-arm.cc ('k') | src/ic/handler-compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698