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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 HeapType* field_type = descriptors->GetFieldType(descriptor); | 418 HeapType* field_type = descriptors->GetFieldType(descriptor); |
419 if (field_type->IsClass()) { | 419 if (field_type->IsClass()) { |
420 __ CheckMap(value_reg, scratch1, field_type->AsClass(), | 420 __ CheckMap(value_reg, scratch1, field_type->AsClass()->Map(), |
421 miss_label, DO_SMI_CHECK); | 421 miss_label, DO_SMI_CHECK); |
422 } else { | 422 } else { |
423 ASSERT(HeapType::Any()->Is(field_type)); | 423 ASSERT(HeapType::Any()->Is(field_type)); |
424 __ JumpIfSmi(value_reg, miss_label); | 424 __ JumpIfSmi(value_reg, miss_label); |
425 } | 425 } |
426 } else if (representation.IsDouble()) { | 426 } else if (representation.IsDouble()) { |
427 Label do_store, heap_number; | 427 Label do_store, heap_number; |
428 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); | 428 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); |
429 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); | 429 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); |
430 | 430 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 // object and the number of in-object properties is not going to change. | 580 // object and the number of in-object properties is not going to change. |
581 index -= object->map()->inobject_properties(); | 581 index -= object->map()->inobject_properties(); |
582 | 582 |
583 Representation representation = lookup->representation(); | 583 Representation representation = lookup->representation(); |
584 ASSERT(!representation.IsNone()); | 584 ASSERT(!representation.IsNone()); |
585 if (representation.IsSmi()) { | 585 if (representation.IsSmi()) { |
586 __ JumpIfNotSmi(value_reg, miss_label); | 586 __ JumpIfNotSmi(value_reg, miss_label); |
587 } else if (representation.IsHeapObject()) { | 587 } else if (representation.IsHeapObject()) { |
588 HeapType* field_type = lookup->GetFieldType(); | 588 HeapType* field_type = lookup->GetFieldType(); |
589 if (field_type->IsClass()) { | 589 if (field_type->IsClass()) { |
590 __ CheckMap(value_reg, scratch1, field_type->AsClass(), | 590 __ CheckMap(value_reg, scratch1, field_type->AsClass()->Map(), |
591 miss_label, DO_SMI_CHECK); | 591 miss_label, DO_SMI_CHECK); |
592 } else { | 592 } else { |
593 ASSERT(HeapType::Any()->Is(field_type)); | 593 ASSERT(HeapType::Any()->Is(field_type)); |
594 __ JumpIfSmi(value_reg, miss_label); | 594 __ JumpIfSmi(value_reg, miss_label); |
595 } | 595 } |
596 } else if (representation.IsDouble()) { | 596 } else if (representation.IsDouble()) { |
597 // Load the double storage. | 597 // Load the double storage. |
598 if (index < 0) { | 598 if (index < 0) { |
599 int offset = object->map()->instance_size() + (index * kPointerSize); | 599 int offset = object->map()->instance_size() + (index * kPointerSize); |
600 __ lw(scratch1, FieldMemOperand(receiver_reg, offset)); | 600 __ lw(scratch1, FieldMemOperand(receiver_reg, offset)); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 // Make sure there's no overlap between holder and object registers. | 831 // Make sure there's no overlap between holder and object registers. |
832 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); | 832 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); |
833 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) | 833 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) |
834 && !scratch2.is(scratch1)); | 834 && !scratch2.is(scratch1)); |
835 | 835 |
836 // Keep track of the current object in register reg. | 836 // Keep track of the current object in register reg. |
837 Register reg = object_reg; | 837 Register reg = object_reg; |
838 int depth = 0; | 838 int depth = 0; |
839 | 839 |
840 Handle<JSObject> current = Handle<JSObject>::null(); | 840 Handle<JSObject> current = Handle<JSObject>::null(); |
841 if (type->IsConstant()) current = Handle<JSObject>::cast(type->AsConstant()); | 841 if (type->IsConstant()) { |
| 842 current = Handle<JSObject>::cast(type->AsConstant()->Value()); |
| 843 } |
842 Handle<JSObject> prototype = Handle<JSObject>::null(); | 844 Handle<JSObject> prototype = Handle<JSObject>::null(); |
843 Handle<Map> current_map = receiver_map; | 845 Handle<Map> current_map = receiver_map; |
844 Handle<Map> holder_map(holder->map()); | 846 Handle<Map> holder_map(holder->map()); |
845 // Traverse the prototype chain and check the maps in the prototype chain for | 847 // Traverse the prototype chain and check the maps in the prototype chain for |
846 // fast and global objects or do negative lookup for normal objects. | 848 // fast and global objects or do negative lookup for normal objects. |
847 while (!current_map.is_identical_to(holder_map)) { | 849 while (!current_map.is_identical_to(holder_map)) { |
848 ++depth; | 850 ++depth; |
849 | 851 |
850 // Only global objects and objects that do not require access | 852 // Only global objects and objects that do not require access |
851 // checks are allowed in stubs. | 853 // checks are allowed in stubs. |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 // ----------------------------------- | 1525 // ----------------------------------- |
1524 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1526 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1525 } | 1527 } |
1526 | 1528 |
1527 | 1529 |
1528 #undef __ | 1530 #undef __ |
1529 | 1531 |
1530 } } // namespace v8::internal | 1532 } } // namespace v8::internal |
1531 | 1533 |
1532 #endif // V8_TARGET_ARCH_MIPS | 1534 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |