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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 DCHECK(!value_reg.is(scratch)); | 404 DCHECK(!value_reg.is(scratch)); |
405 __ JumpIfSmi(value_reg, miss_label); | 405 __ JumpIfSmi(value_reg, miss_label); |
406 if (field_type->IsClass()) { | 406 if (field_type->IsClass()) { |
407 __ mov(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); | 407 __ mov(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); |
408 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), | 408 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), |
409 scratch); | 409 scratch); |
410 __ j(not_equal, miss_label); | 410 __ j(not_equal, miss_label); |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
| 414 void PropertyHandlerCompiler::GenerateAccessCheck( |
| 415 Handle<WeakCell> native_context_cell, Register scratch1, Register scratch2, |
| 416 Label* miss, bool compare_native_contexts_only) { |
| 417 Label done; |
| 418 // Load current native context. |
| 419 __ mov(scratch1, NativeContextOperand()); |
| 420 // Load expected native context. |
| 421 __ LoadWeakValue(scratch2, native_context_cell, miss); |
| 422 __ cmp(scratch1, scratch2); |
| 423 |
| 424 if (!compare_native_contexts_only) { |
| 425 __ j(equal, &done); |
| 426 |
| 427 // Compare security tokens of current and expected native contexts. |
| 428 __ mov(scratch1, ContextOperand(scratch1, Context::SECURITY_TOKEN_INDEX)); |
| 429 __ mov(scratch2, ContextOperand(scratch2, Context::SECURITY_TOKEN_INDEX)); |
| 430 __ cmp(scratch1, scratch2); |
| 431 } |
| 432 __ j(not_equal, miss); |
| 433 |
| 434 __ bind(&done); |
| 435 } |
| 436 |
414 Register PropertyHandlerCompiler::CheckPrototypes( | 437 Register PropertyHandlerCompiler::CheckPrototypes( |
415 Register object_reg, Register holder_reg, Register scratch1, | 438 Register object_reg, Register holder_reg, Register scratch1, |
416 Register scratch2, Handle<Name> name, Label* miss, | 439 Register scratch2, Handle<Name> name, Label* miss, |
417 ReturnHolder return_what) { | 440 ReturnHolder return_what) { |
418 Handle<Map> receiver_map = map(); | 441 Handle<Map> receiver_map = map(); |
419 | 442 |
420 // Make sure there's no overlap between holder and object registers. | 443 // Make sure there's no overlap between holder and object registers. |
421 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); | 444 DCHECK(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); |
422 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) && | 445 DCHECK(!scratch2.is(object_reg) && !scratch2.is(holder_reg) && |
423 !scratch2.is(scratch1)); | 446 !scratch2.is(scratch1)); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 // Return the generated code. | 711 // Return the generated code. |
689 return GetCode(kind(), name); | 712 return GetCode(kind(), name); |
690 } | 713 } |
691 | 714 |
692 | 715 |
693 #undef __ | 716 #undef __ |
694 } // namespace internal | 717 } // namespace internal |
695 } // namespace v8 | 718 } // namespace v8 |
696 | 719 |
697 #endif // V8_TARGET_ARCH_IA32 | 720 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |