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

Side by Side Diff: src/ic/arm/handler-compiler-arm.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/code-stub-assembler.cc ('k') | src/ic/arm64/handler-compiler-arm64.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 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 DCHECK(!value_reg.is(scratch)); 400 DCHECK(!value_reg.is(scratch));
401 __ JumpIfSmi(value_reg, miss_label); 401 __ JumpIfSmi(value_reg, miss_label);
402 if (field_type->IsClass()) { 402 if (field_type->IsClass()) {
403 __ ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); 403 __ ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset));
404 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), 404 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()),
405 scratch); 405 scratch);
406 __ b(ne, miss_label); 406 __ b(ne, miss_label);
407 } 407 }
408 } 408 }
409 409
410 void PropertyHandlerCompiler::GenerateAccessCheck(
411 Handle<WeakCell> native_context_cell, Register scratch1, Register scratch2,
412 Label* miss, bool compare_native_contexts_only) {
413 Label done;
414 // Load current native context.
415 __ ldr(scratch1, NativeContextMemOperand());
416 // Load expected native context.
417 __ LoadWeakValue(scratch2, native_context_cell, miss);
418 __ cmp(scratch1, scratch2);
419
420 if (!compare_native_contexts_only) {
421 __ b(eq, &done);
422
423 // Compare security tokens of current and expected native contexts.
424 __ ldr(scratch1,
425 ContextMemOperand(scratch1, Context::SECURITY_TOKEN_INDEX));
426 __ ldr(scratch2,
427 ContextMemOperand(scratch2, Context::SECURITY_TOKEN_INDEX));
428 __ cmp(scratch1, scratch2);
429 }
430 __ b(ne, miss);
431
432 __ bind(&done);
433 }
434
410 Register PropertyHandlerCompiler::CheckPrototypes( 435 Register PropertyHandlerCompiler::CheckPrototypes(
411 Register object_reg, Register holder_reg, Register scratch1, 436 Register object_reg, Register holder_reg, Register scratch1,
412 Register scratch2, Handle<Name> name, Label* miss, 437 Register scratch2, Handle<Name> name, Label* miss,
413 ReturnHolder return_what) { 438 ReturnHolder return_what) {
414 Handle<Map> receiver_map = map(); 439 Handle<Map> receiver_map = map();
415 440
416 // Make sure there's no overlap between holder and object registers. 441 // Make sure there's no overlap between holder and object registers.
417 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); 442 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
418 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) && 443 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) &&
419 !scratch2.is(scratch1)); 444 !scratch2.is(scratch1));
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 // Return the generated code. 686 // Return the generated code.
662 return GetCode(kind(), name); 687 return GetCode(kind(), name);
663 } 688 }
664 689
665 690
666 #undef __ 691 #undef __
667 } // namespace internal 692 } // namespace internal
668 } // namespace v8 693 } // namespace v8
669 694
670 #endif // V8_TARGET_ARCH_ARM 695 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/ic/arm64/handler-compiler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698