| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 Representation representation = details.representation(); | 521 Representation representation = details.representation(); |
| 522 ASSERT(!representation.IsNone()); | 522 ASSERT(!representation.IsNone()); |
| 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 __ JumpIfSmi(value_reg, miss_label); |
| 532 if (field_type->IsClass()) { | |
| 533 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK); | |
| 534 } else { | |
| 535 ASSERT(HeapType::Any()->Is(field_type)); | |
| 536 __ JumpIfSmi(value_reg, miss_label); | |
| 537 } | |
| 538 } else if (representation.IsDouble()) { | 532 } else if (representation.IsDouble()) { |
| 539 Label do_store, heap_number; | 533 Label do_store, heap_number; |
| 540 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); | 534 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, slow); |
| 541 | 535 |
| 542 __ JumpIfNotSmi(value_reg, &heap_number); | 536 __ JumpIfNotSmi(value_reg, &heap_number); |
| 543 __ SmiUntag(value_reg); | 537 __ SmiUntag(value_reg); |
| 544 if (CpuFeatures::IsSupported(SSE2)) { | 538 if (CpuFeatures::IsSupported(SSE2)) { |
| 545 CpuFeatureScope use_sse2(masm, SSE2); | 539 CpuFeatureScope use_sse2(masm, SSE2); |
| 546 __ Cvtsi2sd(xmm0, value_reg); | 540 __ Cvtsi2sd(xmm0, value_reg); |
| 547 } else { | 541 } else { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 // Adjust for the number of properties stored in the object. Even in the | 691 // Adjust for the number of properties stored in the object. Even in the |
| 698 // face of a transition we can use the old map here because the size of the | 692 // face of a transition we can use the old map here because the size of the |
| 699 // object and the number of in-object properties is not going to change. | 693 // object and the number of in-object properties is not going to change. |
| 700 index -= object->map()->inobject_properties(); | 694 index -= object->map()->inobject_properties(); |
| 701 | 695 |
| 702 Representation representation = lookup->representation(); | 696 Representation representation = lookup->representation(); |
| 703 ASSERT(!representation.IsNone()); | 697 ASSERT(!representation.IsNone()); |
| 704 if (representation.IsSmi()) { | 698 if (representation.IsSmi()) { |
| 705 __ JumpIfNotSmi(value_reg, miss_label); | 699 __ JumpIfNotSmi(value_reg, miss_label); |
| 706 } else if (representation.IsHeapObject()) { | 700 } else if (representation.IsHeapObject()) { |
| 707 HeapType* field_type = lookup->GetFieldType(); | 701 __ JumpIfSmi(value_reg, miss_label); |
| 708 if (field_type->IsClass()) { | |
| 709 __ CheckMap(value_reg, field_type->AsClass(), miss_label, DO_SMI_CHECK); | |
| 710 } else { | |
| 711 ASSERT(HeapType::Any()->Is(field_type)); | |
| 712 __ JumpIfSmi(value_reg, miss_label); | |
| 713 } | |
| 714 } else if (representation.IsDouble()) { | 702 } else if (representation.IsDouble()) { |
| 715 // Load the double storage. | 703 // Load the double storage. |
| 716 if (index < 0) { | 704 if (index < 0) { |
| 717 int offset = object->map()->instance_size() + (index * kPointerSize); | 705 int offset = object->map()->instance_size() + (index * kPointerSize); |
| 718 __ mov(scratch1, FieldOperand(receiver_reg, offset)); | 706 __ mov(scratch1, FieldOperand(receiver_reg, offset)); |
| 719 } else { | 707 } else { |
| 720 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); | 708 __ mov(scratch1, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); |
| 721 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 709 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
| 722 __ mov(scratch1, FieldOperand(scratch1, offset)); | 710 __ mov(scratch1, FieldOperand(scratch1, offset)); |
| 723 } | 711 } |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1547 // ----------------------------------- | 1535 // ----------------------------------- |
| 1548 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1536 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1549 } | 1537 } |
| 1550 | 1538 |
| 1551 | 1539 |
| 1552 #undef __ | 1540 #undef __ |
| 1553 | 1541 |
| 1554 } } // namespace v8::internal | 1542 } } // namespace v8::internal |
| 1555 | 1543 |
| 1556 #endif // V8_TARGET_ARCH_IA32 | 1544 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |