OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 DCHECK(!value_reg.is(scratch)); | 376 DCHECK(!value_reg.is(scratch)); |
377 __ JumpIfSmi(value_reg, miss_label); | 377 __ JumpIfSmi(value_reg, miss_label); |
378 if (field_type->IsClass()) { | 378 if (field_type->IsClass()) { |
379 __ LoadP(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); | 379 __ LoadP(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
380 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), | 380 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), |
381 scratch); | 381 scratch); |
382 __ bne(miss_label); | 382 __ bne(miss_label); |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
| 386 void PropertyHandlerCompiler::GenerateAccessCheck( |
| 387 Handle<WeakCell> native_context_cell, Register scratch1, Register scratch2, |
| 388 Label* miss, bool compare_native_contexts_only) { |
| 389 Label done; |
| 390 // Load current native context. |
| 391 __ LoadP(scratch1, NativeContextMemOperand()); |
| 392 // Load expected native context. |
| 393 __ LoadWeakValue(scratch2, native_context_cell, miss); |
| 394 __ CmpP(scratch1, scratch2); |
| 395 |
| 396 if (!compare_native_contexts_only) { |
| 397 __ beq(&done); |
| 398 |
| 399 // Compare security tokens of current and expected native contexts. |
| 400 __ LoadP(scratch1, |
| 401 ContextMemOperand(scratch1, Context::SECURITY_TOKEN_INDEX)); |
| 402 __ LoadP(scratch2, |
| 403 ContextMemOperand(scratch2, Context::SECURITY_TOKEN_INDEX)); |
| 404 __ CmpP(scratch1, scratch2); |
| 405 } |
| 406 __ bne(miss); |
| 407 |
| 408 __ bind(&done); |
| 409 } |
| 410 |
386 Register PropertyHandlerCompiler::CheckPrototypes( | 411 Register PropertyHandlerCompiler::CheckPrototypes( |
387 Register object_reg, Register holder_reg, Register scratch1, | 412 Register object_reg, Register holder_reg, Register scratch1, |
388 Register scratch2, Handle<Name> name, Label* miss, | 413 Register scratch2, Handle<Name> name, Label* miss, |
389 ReturnHolder return_what) { | 414 ReturnHolder return_what) { |
390 Handle<Map> receiver_map = map(); | 415 Handle<Map> receiver_map = map(); |
391 | 416 |
392 // Make sure there's no overlap between holder and object registers. | 417 // Make sure there's no overlap between holder and object registers. |
393 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); | 418 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); |
394 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) && | 419 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) && |
395 !scratch2.is(scratch1)); | 420 !scratch2.is(scratch1)); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 | 652 |
628 // Return the generated code. | 653 // Return the generated code. |
629 return GetCode(kind(), name); | 654 return GetCode(kind(), name); |
630 } | 655 } |
631 | 656 |
632 #undef __ | 657 #undef __ |
633 } // namespace internal | 658 } // namespace internal |
634 } // namespace v8 | 659 } // namespace v8 |
635 | 660 |
636 #endif // V8_TARGET_ARCH_ARM | 661 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |