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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 Loading... |
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 __ ld(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); | 389 __ ld(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 __ ld(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 __ ld(scratch1, ContextMemOperand(scratch1, Context::SECURITY_TOKEN_INDEX)); |
| 410 __ ld(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 Loading... |
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_MIPS64 | 676 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |