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

Side by Side Diff: src/ic/mips/handler-compiler-mips.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/ic.cc ('k') | src/ic/mips64/handler-compiler-mips64.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 DCHECK(!value_reg.is(scratch)); 386 DCHECK(!value_reg.is(scratch));
387 __ JumpIfSmi(value_reg, miss_label); 387 __ JumpIfSmi(value_reg, miss_label);
388 if (field_type->IsClass()) { 388 if (field_type->IsClass()) {
389 __ lw(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); 389 __ lw(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset));
390 // Compare map directly within the Branch() functions. 390 // Compare map directly within the Branch() functions.
391 __ GetWeakValue(scratch, Map::WeakCellForMap(field_type->AsClass())); 391 __ GetWeakValue(scratch, Map::WeakCellForMap(field_type->AsClass()));
392 __ Branch(miss_label, ne, map_reg, Operand(scratch)); 392 __ Branch(miss_label, ne, map_reg, Operand(scratch));
393 } 393 }
394 } 394 }
395 395
396 void PropertyHandlerCompiler::GenerateAccessCheck(
397 Handle<WeakCell> native_context_cell, Register scratch1, Register scratch2,
398 Label* miss, bool compare_native_contexts_only) {
399 Label done;
400 // Load current native context.
401 __ lw(scratch1, NativeContextMemOperand());
402 // Load expected native context.
403 __ LoadWeakValue(scratch2, native_context_cell, miss);
404
405 if (!compare_native_contexts_only) {
406 __ Branch(&done, eq, scratch1, Operand(scratch2));
407
408 // Compare security tokens of current and expected native contexts.
409 __ lw(scratch1, ContextMemOperand(scratch1, Context::SECURITY_TOKEN_INDEX));
410 __ lw(scratch2, ContextMemOperand(scratch2, Context::SECURITY_TOKEN_INDEX));
411 }
412 __ Branch(miss, ne, scratch1, Operand(scratch2));
413
414 __ bind(&done);
415 }
416
396 Register PropertyHandlerCompiler::CheckPrototypes( 417 Register PropertyHandlerCompiler::CheckPrototypes(
397 Register object_reg, Register holder_reg, Register scratch1, 418 Register object_reg, Register holder_reg, Register scratch1,
398 Register scratch2, Handle<Name> name, Label* miss, 419 Register scratch2, Handle<Name> name, Label* miss,
399 ReturnHolder return_what) { 420 ReturnHolder return_what) {
400 Handle<Map> receiver_map = map(); 421 Handle<Map> receiver_map = map();
401 422
402 // Make sure there's no overlap between holder and object registers. 423 // Make sure there's no overlap between holder and object registers.
403 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); 424 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg));
404 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) && 425 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) &&
405 !scratch2.is(scratch1)); 426 !scratch2.is(scratch1));
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 // Return the generated code. 667 // Return the generated code.
647 return GetCode(kind(), name); 668 return GetCode(kind(), name);
648 } 669 }
649 670
650 671
651 #undef __ 672 #undef __
652 } // namespace internal 673 } // namespace internal
653 } // namespace v8 674 } // namespace v8
654 675
655 #endif // V8_TARGET_ARCH_MIPS 676 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | src/ic/mips64/handler-compiler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698