| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 Representation representation = details.representation(); | 408 Representation representation = details.representation(); |
| 409 ASSERT(!representation.IsNone()); | 409 ASSERT(!representation.IsNone()); |
| 410 | 410 |
| 411 if (details.type() == CONSTANT) { | 411 if (details.type() == CONSTANT) { |
| 412 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); | 412 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); |
| 413 __ li(scratch1, constant); | 413 __ li(scratch1, constant); |
| 414 __ Branch(miss_label, ne, value_reg, Operand(scratch1)); | 414 __ Branch(miss_label, ne, value_reg, Operand(scratch1)); |
| 415 } else if (representation.IsSmi()) { | 415 } else if (representation.IsSmi()) { |
| 416 __ JumpIfNotSmi(value_reg, miss_label); | 416 __ JumpIfNotSmi(value_reg, miss_label); |
| 417 } else if (representation.IsHeapObject()) { | 417 } else if (representation.IsHeapObject()) { |
| 418 __ JumpIfSmi(value_reg, miss_label); |
| 418 HeapType* field_type = descriptors->GetFieldType(descriptor); | 419 HeapType* field_type = descriptors->GetFieldType(descriptor); |
| 419 if (field_type->IsClass()) { | 420 HeapType::Iterator<Map> it = field_type->Classes(); |
| 420 __ CheckMap(value_reg, scratch1, field_type->AsClass()->Map(), | 421 Handle<Map> current; |
| 421 miss_label, DO_SMI_CHECK); | 422 if (!it.Done()) { |
| 422 } else { | 423 __ lw(scratch1, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
| 423 ASSERT(HeapType::Any()->Is(field_type)); | 424 Label do_store; |
| 424 __ JumpIfSmi(value_reg, miss_label); | 425 while (true) { |
| 426 // Do the CompareMap() directly within the Branch() functions. |
| 427 current = it.Current(); |
| 428 it.Advance(); |
| 429 if (it.Done()) { |
| 430 __ Branch(miss_label, ne, scratch1, Operand(current)); |
| 431 break; |
| 432 } |
| 433 __ Branch(&do_store, eq, scratch1, Operand(current)); |
| 434 } |
| 435 __ bind(&do_store); |
| 425 } | 436 } |
| 426 } else if (representation.IsDouble()) { | 437 } else if (representation.IsDouble()) { |
| 427 Label do_store, heap_number; | 438 Label do_store, heap_number; |
| 428 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); | 439 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); |
| 429 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); | 440 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); |
| 430 | 441 |
| 431 __ JumpIfNotSmi(value_reg, &heap_number); | 442 __ JumpIfNotSmi(value_reg, &heap_number); |
| 432 __ SmiUntag(scratch1, value_reg); | 443 __ SmiUntag(scratch1, value_reg); |
| 433 __ mtc1(scratch1, f6); | 444 __ mtc1(scratch1, f6); |
| 434 __ cvt_d_w(f4, f6); | 445 __ cvt_d_w(f4, f6); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 // Adjust for the number of properties stored in the object. Even in the | 589 // Adjust for the number of properties stored in the object. Even in the |
| 579 // face of a transition we can use the old map here because the size of the | 590 // face of a transition we can use the old map here because the size of the |
| 580 // object and the number of in-object properties is not going to change. | 591 // object and the number of in-object properties is not going to change. |
| 581 index -= object->map()->inobject_properties(); | 592 index -= object->map()->inobject_properties(); |
| 582 | 593 |
| 583 Representation representation = lookup->representation(); | 594 Representation representation = lookup->representation(); |
| 584 ASSERT(!representation.IsNone()); | 595 ASSERT(!representation.IsNone()); |
| 585 if (representation.IsSmi()) { | 596 if (representation.IsSmi()) { |
| 586 __ JumpIfNotSmi(value_reg, miss_label); | 597 __ JumpIfNotSmi(value_reg, miss_label); |
| 587 } else if (representation.IsHeapObject()) { | 598 } else if (representation.IsHeapObject()) { |
| 599 __ JumpIfSmi(value_reg, miss_label); |
| 588 HeapType* field_type = lookup->GetFieldType(); | 600 HeapType* field_type = lookup->GetFieldType(); |
| 589 if (field_type->IsClass()) { | 601 HeapType::Iterator<Map> it = field_type->Classes(); |
| 590 __ CheckMap(value_reg, scratch1, field_type->AsClass()->Map(), | 602 if (!it.Done()) { |
| 591 miss_label, DO_SMI_CHECK); | 603 __ lw(scratch1, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
| 592 } else { | 604 Label do_store; |
| 593 ASSERT(HeapType::Any()->Is(field_type)); | 605 Handle<Map> current; |
| 594 __ JumpIfSmi(value_reg, miss_label); | 606 while (true) { |
| 607 // Do the CompareMap() directly within the Branch() functions. |
| 608 current = it.Current(); |
| 609 it.Advance(); |
| 610 if (it.Done()) { |
| 611 __ Branch(miss_label, ne, scratch1, Operand(current)); |
| 612 break; |
| 613 } |
| 614 __ Branch(&do_store, eq, scratch1, Operand(current)); |
| 615 } |
| 616 __ bind(&do_store); |
| 595 } | 617 } |
| 596 } else if (representation.IsDouble()) { | 618 } else if (representation.IsDouble()) { |
| 597 // Load the double storage. | 619 // Load the double storage. |
| 598 if (index < 0) { | 620 if (index < 0) { |
| 599 int offset = object->map()->instance_size() + (index * kPointerSize); | 621 int offset = object->map()->instance_size() + (index * kPointerSize); |
| 600 __ lw(scratch1, FieldMemOperand(receiver_reg, offset)); | 622 __ lw(scratch1, FieldMemOperand(receiver_reg, offset)); |
| 601 } else { | 623 } else { |
| 602 __ lw(scratch1, | 624 __ lw(scratch1, |
| 603 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); | 625 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); |
| 604 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 626 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1525 // ----------------------------------- | 1547 // ----------------------------------- |
| 1526 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1548 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1527 } | 1549 } |
| 1528 | 1550 |
| 1529 | 1551 |
| 1530 #undef __ | 1552 #undef __ |
| 1531 | 1553 |
| 1532 } } // namespace v8::internal | 1554 } } // namespace v8::internal |
| 1533 | 1555 |
| 1534 #endif // V8_TARGET_ARCH_MIPS | 1556 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |