| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 ASSERT(!representation.IsNone()); | 385 ASSERT(!representation.IsNone()); |
| 386 | 386 |
| 387 if (details.type() == CONSTANT) { | 387 if (details.type() == CONSTANT) { |
| 388 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); | 388 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); |
| 389 __ LoadObject(scratch1, constant); | 389 __ LoadObject(scratch1, constant); |
| 390 __ Cmp(value_reg, scratch1); | 390 __ Cmp(value_reg, scratch1); |
| 391 __ B(ne, miss_label); | 391 __ B(ne, miss_label); |
| 392 } else if (representation.IsSmi()) { | 392 } else if (representation.IsSmi()) { |
| 393 __ JumpIfNotSmi(value_reg, miss_label); | 393 __ JumpIfNotSmi(value_reg, miss_label); |
| 394 } else if (representation.IsHeapObject()) { | 394 } else if (representation.IsHeapObject()) { |
| 395 __ JumpIfSmi(value_reg, miss_label); | 395 HeapType* field_type = descriptors->GetFieldType(descriptor); |
| 396 if (field_type->IsClass()) { |
| 397 __ CheckMap(value_reg, scratch1, field_type->AsClass(), |
| 398 miss_label, DO_SMI_CHECK); |
| 399 } else { |
| 400 __ JumpIfSmi(value_reg, miss_label); |
| 401 } |
| 396 } else if (representation.IsDouble()) { | 402 } else if (representation.IsDouble()) { |
| 397 Label do_store, heap_number; | 403 Label do_store, heap_number; |
| 398 __ AllocateHeapNumber(storage_reg, slow, scratch1, scratch2); | 404 __ AllocateHeapNumber(storage_reg, slow, scratch1, scratch2); |
| 399 | 405 |
| 400 // TODO(jbramley): Is fp_scratch the most appropriate FP scratch register? | 406 // TODO(jbramley): Is fp_scratch the most appropriate FP scratch register? |
| 401 // It's only used in Fcmp, but it's not really safe to use it like this. | 407 // It's only used in Fcmp, but it's not really safe to use it like this. |
| 402 __ JumpIfNotSmi(value_reg, &heap_number); | 408 __ JumpIfNotSmi(value_reg, &heap_number); |
| 403 __ SmiUntagToDouble(fp_scratch, value_reg); | 409 __ SmiUntagToDouble(fp_scratch, value_reg); |
| 404 __ B(&do_store); | 410 __ B(&do_store); |
| 405 | 411 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // Adjust for the number of properties stored in the object. Even in the | 552 // Adjust for the number of properties stored in the object. Even in the |
| 547 // face of a transition we can use the old map here because the size of the | 553 // face of a transition we can use the old map here because the size of the |
| 548 // object and the number of in-object properties is not going to change. | 554 // object and the number of in-object properties is not going to change. |
| 549 index -= object->map()->inobject_properties(); | 555 index -= object->map()->inobject_properties(); |
| 550 | 556 |
| 551 Representation representation = lookup->representation(); | 557 Representation representation = lookup->representation(); |
| 552 ASSERT(!representation.IsNone()); | 558 ASSERT(!representation.IsNone()); |
| 553 if (representation.IsSmi()) { | 559 if (representation.IsSmi()) { |
| 554 __ JumpIfNotSmi(value_reg, miss_label); | 560 __ JumpIfNotSmi(value_reg, miss_label); |
| 555 } else if (representation.IsHeapObject()) { | 561 } else if (representation.IsHeapObject()) { |
| 556 __ JumpIfSmi(value_reg, miss_label); | 562 HeapType* field_type = lookup->GetFieldType(); |
| 563 if (field_type->IsClass()) { |
| 564 __ CheckMap(value_reg, scratch1, field_type->AsClass(), |
| 565 miss_label, DO_SMI_CHECK); |
| 566 } else { |
| 567 __ JumpIfSmi(value_reg, miss_label); |
| 568 } |
| 557 } else if (representation.IsDouble()) { | 569 } else if (representation.IsDouble()) { |
| 558 // Load the double storage. | 570 // Load the double storage. |
| 559 if (index < 0) { | 571 if (index < 0) { |
| 560 int offset = (index * kPointerSize) + object->map()->instance_size(); | 572 int offset = (index * kPointerSize) + object->map()->instance_size(); |
| 561 __ Ldr(scratch1, FieldMemOperand(receiver_reg, offset)); | 573 __ Ldr(scratch1, FieldMemOperand(receiver_reg, offset)); |
| 562 } else { | 574 } else { |
| 563 int offset = (index * kPointerSize) + FixedArray::kHeaderSize; | 575 int offset = (index * kPointerSize) + FixedArray::kHeaderSize; |
| 564 __ Ldr(scratch1, | 576 __ Ldr(scratch1, |
| 565 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); | 577 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); |
| 566 __ Ldr(scratch1, FieldMemOperand(scratch1, offset)); | 578 __ Ldr(scratch1, FieldMemOperand(scratch1, offset)); |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 | 1511 |
| 1500 // Miss case, call the runtime. | 1512 // Miss case, call the runtime. |
| 1501 __ Bind(&miss); | 1513 __ Bind(&miss); |
| 1502 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1514 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1503 } | 1515 } |
| 1504 | 1516 |
| 1505 | 1517 |
| 1506 } } // namespace v8::internal | 1518 } } // namespace v8::internal |
| 1507 | 1519 |
| 1508 #endif // V8_TARGET_ARCH_A64 | 1520 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |