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

Side by Side Diff: src/ic/x64/handler-compiler-x64.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/s390/handler-compiler-s390.cc ('k') | src/ic/x87/handler-compiler-x87.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_X64 5 #if V8_TARGET_ARCH_X64
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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 __ JumpIfSmi(value_reg, miss_label); 394 __ JumpIfSmi(value_reg, miss_label);
395 if (field_type->IsClass()) { 395 if (field_type->IsClass()) {
396 Label do_store; 396 Label do_store;
397 __ movp(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); 397 __ movp(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset));
398 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), 398 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()),
399 scratch); 399 scratch);
400 __ j(not_equal, miss_label); 400 __ j(not_equal, miss_label);
401 } 401 }
402 } 402 }
403 403
404 void PropertyHandlerCompiler::GenerateAccessCheck(
405 Handle<WeakCell> native_context_cell, Register scratch1, Register scratch2,
406 Label* miss, bool compare_native_contexts_only) {
407 Label done;
408 // Load current native context.
409 __ movp(scratch1, NativeContextOperand());
410 // Load expected native context.
411 __ LoadWeakValue(scratch2, native_context_cell, miss);
412 __ cmpp(scratch1, scratch2);
413
414 if (!compare_native_contexts_only) {
415 __ j(equal, &done);
416
417 // Compare security tokens of current and expected native contexts.
418 __ movp(scratch1, ContextOperand(scratch1, Context::SECURITY_TOKEN_INDEX));
419 __ movp(scratch2, ContextOperand(scratch2, Context::SECURITY_TOKEN_INDEX));
420 __ cmpp(scratch1, scratch2);
421 }
422 __ j(not_equal, miss);
423
424 __ bind(&done);
425 }
426
404 Register PropertyHandlerCompiler::CheckPrototypes( 427 Register PropertyHandlerCompiler::CheckPrototypes(
405 Register object_reg, Register holder_reg, Register scratch1, 428 Register object_reg, Register holder_reg, Register scratch1,
406 Register scratch2, Handle<Name> name, Label* miss, 429 Register scratch2, Handle<Name> name, Label* miss,
407 ReturnHolder return_what) { 430 ReturnHolder return_what) {
408 Handle<Map> receiver_map = map(); 431 Handle<Map> receiver_map = map();
409 432
410 // Make sure there's no overlap between holder and object registers. 433 // Make sure there's no overlap between holder and object registers.
411 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); 434 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
412 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) && 435 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) &&
413 !scratch2.is(scratch1)); 436 !scratch2.is(scratch1));
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 // Return the generated code. 687 // Return the generated code.
665 return GetCode(kind(), name); 688 return GetCode(kind(), name);
666 } 689 }
667 690
668 691
669 #undef __ 692 #undef __
670 } // namespace internal 693 } // namespace internal
671 } // namespace v8 694 } // namespace v8
672 695
673 #endif // V8_TARGET_ARCH_X64 696 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/s390/handler-compiler-s390.cc ('k') | src/ic/x87/handler-compiler-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698