| 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 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 // ----------- S t a t e ------------- | 395 // ----------- S t a t e ------------- |
| 396 // -- r0 : value | 396 // -- r0 : value |
| 397 // -- r1 : key | 397 // -- r1 : key |
| 398 // -- r2 : receiver | 398 // -- r2 : receiver |
| 399 // -- lr : return address | 399 // -- lr : return address |
| 400 // -- r3 : target map, scratch for subsequent call | 400 // -- r3 : target map, scratch for subsequent call |
| 401 // -- r4 : scratch (elements) | 401 // -- r4 : scratch (elements) |
| 402 // ----------------------------------- | 402 // ----------------------------------- |
| 403 if (mode == TRACK_ALLOCATION_SITE) { | 403 if (mode == TRACK_ALLOCATION_SITE) { |
| 404 ASSERT(allocation_memento_found != NULL); | 404 ASSERT(allocation_memento_found != NULL); |
| 405 __ TestJSArrayForAllocationMemento(r2, r4); | 405 __ JumpIfJSArrayHasAllocationMemento(r2, r4, allocation_memento_found); |
| 406 __ b(eq, allocation_memento_found); | |
| 407 } | 406 } |
| 408 | 407 |
| 409 // Set transitioned map. | 408 // Set transitioned map. |
| 410 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); | 409 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); |
| 411 __ RecordWriteField(r2, | 410 __ RecordWriteField(r2, |
| 412 HeapObject::kMapOffset, | 411 HeapObject::kMapOffset, |
| 413 r3, | 412 r3, |
| 414 r9, | 413 r9, |
| 415 kLRHasNotBeenSaved, | 414 kLRHasNotBeenSaved, |
| 416 kDontSaveFPRegs, | 415 kDontSaveFPRegs, |
| 417 EMIT_REMEMBERED_SET, | 416 EMIT_REMEMBERED_SET, |
| 418 OMIT_SMI_CHECK); | 417 OMIT_SMI_CHECK); |
| 419 } | 418 } |
| 420 | 419 |
| 421 | 420 |
| 422 void ElementsTransitionGenerator::GenerateSmiToDouble( | 421 void ElementsTransitionGenerator::GenerateSmiToDouble( |
| 423 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { | 422 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { |
| 424 // ----------- S t a t e ------------- | 423 // ----------- S t a t e ------------- |
| 425 // -- r0 : value | 424 // -- r0 : value |
| 426 // -- r1 : key | 425 // -- r1 : key |
| 427 // -- r2 : receiver | 426 // -- r2 : receiver |
| 428 // -- lr : return address | 427 // -- lr : return address |
| 429 // -- r3 : target map, scratch for subsequent call | 428 // -- r3 : target map, scratch for subsequent call |
| 430 // -- r4 : scratch (elements) | 429 // -- r4 : scratch (elements) |
| 431 // ----------------------------------- | 430 // ----------------------------------- |
| 432 Label loop, entry, convert_hole, gc_required, only_change_map, done; | 431 Label loop, entry, convert_hole, gc_required, only_change_map, done; |
| 433 | 432 |
| 434 if (mode == TRACK_ALLOCATION_SITE) { | 433 if (mode == TRACK_ALLOCATION_SITE) { |
| 435 __ TestJSArrayForAllocationMemento(r2, r4); | 434 __ JumpIfJSArrayHasAllocationMemento(r2, r4, fail); |
| 436 __ b(eq, fail); | |
| 437 } | 435 } |
| 438 | 436 |
| 439 // Check for empty arrays, which only require a map transition and no changes | 437 // Check for empty arrays, which only require a map transition and no changes |
| 440 // to the backing store. | 438 // to the backing store. |
| 441 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); | 439 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); |
| 442 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); | 440 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
| 443 __ b(eq, &only_change_map); | 441 __ b(eq, &only_change_map); |
| 444 | 442 |
| 445 __ push(lr); | 443 __ push(lr); |
| 446 __ ldr(r5, FieldMemOperand(r4, FixedArray::kLengthOffset)); | 444 __ ldr(r5, FieldMemOperand(r4, FixedArray::kLengthOffset)); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 // -- r0 : value | 550 // -- r0 : value |
| 553 // -- r1 : key | 551 // -- r1 : key |
| 554 // -- r2 : receiver | 552 // -- r2 : receiver |
| 555 // -- lr : return address | 553 // -- lr : return address |
| 556 // -- r3 : target map, scratch for subsequent call | 554 // -- r3 : target map, scratch for subsequent call |
| 557 // -- r4 : scratch (elements) | 555 // -- r4 : scratch (elements) |
| 558 // ----------------------------------- | 556 // ----------------------------------- |
| 559 Label entry, loop, convert_hole, gc_required, only_change_map; | 557 Label entry, loop, convert_hole, gc_required, only_change_map; |
| 560 | 558 |
| 561 if (mode == TRACK_ALLOCATION_SITE) { | 559 if (mode == TRACK_ALLOCATION_SITE) { |
| 562 __ TestJSArrayForAllocationMemento(r2, r4); | 560 __ JumpIfJSArrayHasAllocationMemento(r2, r4, fail); |
| 563 __ b(eq, fail); | |
| 564 } | 561 } |
| 565 | 562 |
| 566 // Check for empty arrays, which only require a map transition and no changes | 563 // Check for empty arrays, which only require a map transition and no changes |
| 567 // to the backing store. | 564 // to the backing store. |
| 568 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); | 565 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); |
| 569 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); | 566 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
| 570 __ b(eq, &only_change_map); | 567 __ b(eq, &only_change_map); |
| 571 | 568 |
| 572 __ push(lr); | 569 __ push(lr); |
| 573 __ Push(r3, r2, r1, r0); | 570 __ Push(r3, r2, r1, r0); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 patcher.masm()->add(r0, pc, Operand(-8)); | 897 patcher.masm()->add(r0, pc, Operand(-8)); |
| 901 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 898 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
| 902 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); | 899 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
| 903 } | 900 } |
| 904 } | 901 } |
| 905 | 902 |
| 906 | 903 |
| 907 } } // namespace v8::internal | 904 } } // namespace v8::internal |
| 908 | 905 |
| 909 #endif // V8_TARGET_ARCH_ARM | 906 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |