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()->Map(), | 533 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK); |
534 miss_label, DO_SMI_CHECK); | |
535 } else { | 534 } else { |
536 ASSERT(HeapType::Any()->Is(field_type)); | 535 ASSERT(HeapType::Any()->Is(field_type)); |
537 __ JumpIfSmi(value_reg, miss_label); | 536 __ JumpIfSmi(value_reg, miss_label); |
538 } | 537 } |
539 } else if (representation.IsDouble()) { | 538 } else if (representation.IsDouble()) { |
540 Label do_store, heap_number; | 539 Label do_store, heap_number; |
541 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); | 540 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); |
542 | 541 |
543 __ JumpIfNotSmi(value_reg, &heap_number); | 542 __ JumpIfNotSmi(value_reg, &heap_number); |
544 __ SmiUntag(value_reg); | 543 __ SmiUntag(value_reg); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 // object and the number of in-object properties is not going to change. | 699 // object and the number of in-object properties is not going to change. |
701 index -= object->map()->inobject_properties(); | 700 index -= object->map()->inobject_properties(); |
702 | 701 |
703 Representation representation = lookup->representation(); | 702 Representation representation = lookup->representation(); |
704 ASSERT(!representation.IsNone()); | 703 ASSERT(!representation.IsNone()); |
705 if (representation.IsSmi()) { | 704 if (representation.IsSmi()) { |
706 __ JumpIfNotSmi(value_reg, miss_label); | 705 __ JumpIfNotSmi(value_reg, miss_label); |
707 } else if (representation.IsHeapObject()) { | 706 } else if (representation.IsHeapObject()) { |
708 HeapType* field_type = lookup->GetFieldType(); | 707 HeapType* field_type = lookup->GetFieldType(); |
709 if (field_type->IsClass()) { | 708 if (field_type->IsClass()) { |
710 __ CheckMap(value_reg, field_type->AsClass()->Map(), | 709 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK); |
711 miss_label, DO_SMI_CHECK); | |
712 } else { | 710 } else { |
713 ASSERT(HeapType::Any()->Is(field_type)); | 711 ASSERT(HeapType::Any()->Is(field_type)); |
714 __ JumpIfSmi(value_reg, miss_label); | 712 __ JumpIfSmi(value_reg, miss_label); |
715 } | 713 } |
716 } else if (representation.IsDouble()) { | 714 } else if (representation.IsDouble()) { |
717 // Load the double storage. | 715 // Load the double storage. |
718 if (index < 0) { | 716 if (index < 0) { |
719 int offset = object->map()->instance_size() + (index * kPointerSize); | 717 int offset = object->map()->instance_size() + (index * kPointerSize); |
720 __ mov(scratch1, FieldOperand(receiver_reg, offset)); | 718 __ mov(scratch1, FieldOperand(receiver_reg, offset)); |
721 } else { | 719 } else { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 // Make sure there's no overlap between holder and object registers. | 829 // Make sure there's no overlap between holder and object registers. |
832 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); | 830 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); |
833 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) | 831 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) |
834 && !scratch2.is(scratch1)); | 832 && !scratch2.is(scratch1)); |
835 | 833 |
836 // Keep track of the current object in register reg. | 834 // Keep track of the current object in register reg. |
837 Register reg = object_reg; | 835 Register reg = object_reg; |
838 int depth = 0; | 836 int depth = 0; |
839 | 837 |
840 Handle<JSObject> current = Handle<JSObject>::null(); | 838 Handle<JSObject> current = Handle<JSObject>::null(); |
841 if (type->IsConstant()) current = | 839 if (type->IsConstant()) current = Handle<JSObject>::cast(type->AsConstant()); |
842 Handle<JSObject>::cast(type->AsConstant()->Value()); | |
843 Handle<JSObject> prototype = Handle<JSObject>::null(); | 840 Handle<JSObject> prototype = Handle<JSObject>::null(); |
844 Handle<Map> current_map = receiver_map; | 841 Handle<Map> current_map = receiver_map; |
845 Handle<Map> holder_map(holder->map()); | 842 Handle<Map> holder_map(holder->map()); |
846 // Traverse the prototype chain and check the maps in the prototype chain for | 843 // Traverse the prototype chain and check the maps in the prototype chain for |
847 // fast and global objects or do negative lookup for normal objects. | 844 // fast and global objects or do negative lookup for normal objects. |
848 while (!current_map.is_identical_to(holder_map)) { | 845 while (!current_map.is_identical_to(holder_map)) { |
849 ++depth; | 846 ++depth; |
850 | 847 |
851 // Only global objects and objects that do not require access | 848 // Only global objects and objects that do not require access |
852 // checks are allowed in stubs. | 849 // checks are allowed in stubs. |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1550 // ----------------------------------- | 1547 // ----------------------------------- |
1551 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1548 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1552 } | 1549 } |
1553 | 1550 |
1554 | 1551 |
1555 #undef __ | 1552 #undef __ |
1556 | 1553 |
1557 } } // namespace v8::internal | 1554 } } // namespace v8::internal |
1558 | 1555 |
1559 #endif // V8_TARGET_ARCH_IA32 | 1556 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |