OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 | 523 |
524 if (details.type() == CONSTANT) { | 524 if (details.type() == CONSTANT) { |
525 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); | 525 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); |
526 __ CmpObject(value_reg, constant); | 526 __ CmpObject(value_reg, constant); |
527 __ j(not_equal, miss_label); | 527 __ j(not_equal, miss_label); |
528 } else if (representation.IsSmi()) { | 528 } else if (representation.IsSmi()) { |
529 __ JumpIfNotSmi(value_reg, miss_label); | 529 __ JumpIfNotSmi(value_reg, miss_label); |
530 } else if (representation.IsHeapObject()) { | 530 } else if (representation.IsHeapObject()) { |
531 HeapType* field_type = descriptors->GetFieldType(descriptor); | 531 HeapType* field_type = descriptors->GetFieldType(descriptor); |
532 if (field_type->IsClass()) { | 532 if (field_type->IsClass()) { |
533 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK); | 533 __ CheckMap(value_reg, field_type->AsClass()->Map(), |
| 534 miss_label, DO_SMI_CHECK); |
534 } else { | 535 } else { |
535 ASSERT(HeapType::Any()->Is(field_type)); | 536 ASSERT(HeapType::Any()->Is(field_type)); |
536 __ JumpIfSmi(value_reg, miss_label); | 537 __ JumpIfSmi(value_reg, miss_label); |
537 } | 538 } |
538 } else if (representation.IsDouble()) { | 539 } else if (representation.IsDouble()) { |
539 Label do_store, heap_number; | 540 Label do_store, heap_number; |
540 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); | 541 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); |
541 | 542 |
542 __ JumpIfNotSmi(value_reg, &heap_number); | 543 __ JumpIfNotSmi(value_reg, &heap_number); |
543 __ SmiUntag(value_reg); | 544 __ SmiUntag(value_reg); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 // object and the number of in-object properties is not going to change. | 700 // object and the number of in-object properties is not going to change. |
700 index -= object->map()->inobject_properties(); | 701 index -= object->map()->inobject_properties(); |
701 | 702 |
702 Representation representation = lookup->representation(); | 703 Representation representation = lookup->representation(); |
703 ASSERT(!representation.IsNone()); | 704 ASSERT(!representation.IsNone()); |
704 if (representation.IsSmi()) { | 705 if (representation.IsSmi()) { |
705 __ JumpIfNotSmi(value_reg, miss_label); | 706 __ JumpIfNotSmi(value_reg, miss_label); |
706 } else if (representation.IsHeapObject()) { | 707 } else if (representation.IsHeapObject()) { |
707 HeapType* field_type = lookup->GetFieldType(); | 708 HeapType* field_type = lookup->GetFieldType(); |
708 if (field_type->IsClass()) { | 709 if (field_type->IsClass()) { |
709 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK); | 710 __ CheckMap(value_reg, field_type->AsClass()->Map(), |
| 711 miss_label, DO_SMI_CHECK); |
710 } else { | 712 } else { |
711 ASSERT(HeapType::Any()->Is(field_type)); | 713 ASSERT(HeapType::Any()->Is(field_type)); |
712 __ JumpIfSmi(value_reg, miss_label); | 714 __ JumpIfSmi(value_reg, miss_label); |
713 } | 715 } |
714 } else if (representation.IsDouble()) { | 716 } else if (representation.IsDouble()) { |
715 // Load the double storage. | 717 // Load the double storage. |
716 if (index < 0) { | 718 if (index < 0) { |
717 int offset = object->map()->instance_size() + (index * kPointerSize); | 719 int offset = object->map()->instance_size() + (index * kPointerSize); |
718 __ mov(scratch1, FieldOperand(receiver_reg, offset)); | 720 __ mov(scratch1, FieldOperand(receiver_reg, offset)); |
719 } else { | 721 } else { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 // Make sure there's no overlap between holder and object registers. | 831 // Make sure there's no overlap between holder and object registers. |
830 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); | 832 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); |
831 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) | 833 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) |
832 && !scratch2.is(scratch1)); | 834 && !scratch2.is(scratch1)); |
833 | 835 |
834 // Keep track of the current object in register reg. | 836 // Keep track of the current object in register reg. |
835 Register reg = object_reg; | 837 Register reg = object_reg; |
836 int depth = 0; | 838 int depth = 0; |
837 | 839 |
838 Handle<JSObject> current = Handle<JSObject>::null(); | 840 Handle<JSObject> current = Handle<JSObject>::null(); |
839 if (type->IsConstant()) current = Handle<JSObject>::cast(type->AsConstant()); | 841 if (type->IsConstant()) current = |
| 842 Handle<JSObject>::cast(type->AsConstant()->Value()); |
840 Handle<JSObject> prototype = Handle<JSObject>::null(); | 843 Handle<JSObject> prototype = Handle<JSObject>::null(); |
841 Handle<Map> current_map = receiver_map; | 844 Handle<Map> current_map = receiver_map; |
842 Handle<Map> holder_map(holder->map()); | 845 Handle<Map> holder_map(holder->map()); |
843 // Traverse the prototype chain and check the maps in the prototype chain for | 846 // Traverse the prototype chain and check the maps in the prototype chain for |
844 // fast and global objects or do negative lookup for normal objects. | 847 // fast and global objects or do negative lookup for normal objects. |
845 while (!current_map.is_identical_to(holder_map)) { | 848 while (!current_map.is_identical_to(holder_map)) { |
846 ++depth; | 849 ++depth; |
847 | 850 |
848 // Only global objects and objects that do not require access | 851 // Only global objects and objects that do not require access |
849 // checks are allowed in stubs. | 852 // checks are allowed in stubs. |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 // ----------------------------------- | 1550 // ----------------------------------- |
1548 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1551 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1549 } | 1552 } |
1550 | 1553 |
1551 | 1554 |
1552 #undef __ | 1555 #undef __ |
1553 | 1556 |
1554 } } // namespace v8::internal | 1557 } } // namespace v8::internal |
1555 | 1558 |
1556 #endif // V8_TARGET_ARCH_IA32 | 1559 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |