OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |