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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 DCHECK(!value_reg.is(scratch)); | 395 DCHECK(!value_reg.is(scratch)); |
396 __ JumpIfSmi(value_reg, miss_label); | 396 __ JumpIfSmi(value_reg, miss_label); |
397 if (field_type->IsClass()) { | 397 if (field_type->IsClass()) { |
398 __ LoadP(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); | 398 __ LoadP(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
399 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), | 399 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), |
400 scratch); | 400 scratch); |
401 __ bne(miss_label); | 401 __ bne(miss_label); |
402 } | 402 } |
403 } | 403 } |
404 | 404 |
| 405 void PropertyHandlerCompiler::GenerateAccessCheck( |
| 406 Handle<WeakCell> native_context_cell, Register scratch1, Register scratch2, |
| 407 Label* miss, bool compare_native_contexts_only) { |
| 408 Label done; |
| 409 // Load current native context. |
| 410 __ LoadP(scratch1, NativeContextMemOperand()); |
| 411 // Load expected native context. |
| 412 __ LoadWeakValue(scratch2, native_context_cell, miss); |
| 413 __ cmp(scratch1, scratch2); |
| 414 |
| 415 if (!compare_native_contexts_only) { |
| 416 __ beq(&done); |
| 417 |
| 418 // Compare security tokens of current and expected native contexts. |
| 419 __ LoadP(scratch1, |
| 420 ContextMemOperand(scratch1, Context::SECURITY_TOKEN_INDEX)); |
| 421 __ LoadP(scratch2, |
| 422 ContextMemOperand(scratch2, Context::SECURITY_TOKEN_INDEX)); |
| 423 __ cmp(scratch1, scratch2); |
| 424 } |
| 425 __ bne(miss); |
| 426 |
| 427 __ bind(&done); |
| 428 } |
| 429 |
405 Register PropertyHandlerCompiler::CheckPrototypes( | 430 Register PropertyHandlerCompiler::CheckPrototypes( |
406 Register object_reg, Register holder_reg, Register scratch1, | 431 Register object_reg, Register holder_reg, Register scratch1, |
407 Register scratch2, Handle<Name> name, Label* miss, | 432 Register scratch2, Handle<Name> name, Label* miss, |
408 ReturnHolder return_what) { | 433 ReturnHolder return_what) { |
409 Handle<Map> receiver_map = map(); | 434 Handle<Map> receiver_map = map(); |
410 | 435 |
411 // Make sure there's no overlap between holder and object registers. | 436 // Make sure there's no overlap between holder and object registers. |
412 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); | 437 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); |
413 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) && | 438 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) && |
414 !scratch2.is(scratch1)); | 439 !scratch2.is(scratch1)); |
(...skipping 246 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 |