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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 384 } |
385 | 385 |
386 | 386 |
387 // ------------------------------------------------------------------------- | 387 // ------------------------------------------------------------------------- |
388 // Code generators | 388 // Code generators |
389 | 389 |
390 #define __ ACCESS_MASM(masm) | 390 #define __ ACCESS_MASM(masm) |
391 | 391 |
392 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( | 392 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( |
393 MacroAssembler* masm, AllocationSiteMode mode, | 393 MacroAssembler* masm, AllocationSiteMode mode, |
394 Label* allocation_site_info_found) { | 394 Label* allocation_memento_found) { |
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_site_info_found != NULL); | 404 ASSERT(allocation_memento_found != NULL); |
405 __ TestJSArrayForAllocationSiteInfo(r2, r4); | 405 __ TestJSArrayForAllocationMemento(r2, r4); |
406 __ b(eq, allocation_site_info_found); | 406 __ b(eq, allocation_memento_found); |
407 } | 407 } |
408 | 408 |
409 // Set transitioned map. | 409 // Set transitioned map. |
410 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); | 410 __ str(r3, FieldMemOperand(r2, HeapObject::kMapOffset)); |
411 __ RecordWriteField(r2, | 411 __ RecordWriteField(r2, |
412 HeapObject::kMapOffset, | 412 HeapObject::kMapOffset, |
413 r3, | 413 r3, |
414 r9, | 414 r9, |
415 kLRHasNotBeenSaved, | 415 kLRHasNotBeenSaved, |
416 kDontSaveFPRegs, | 416 kDontSaveFPRegs, |
417 EMIT_REMEMBERED_SET, | 417 EMIT_REMEMBERED_SET, |
418 OMIT_SMI_CHECK); | 418 OMIT_SMI_CHECK); |
419 } | 419 } |
420 | 420 |
421 | 421 |
422 void ElementsTransitionGenerator::GenerateSmiToDouble( | 422 void ElementsTransitionGenerator::GenerateSmiToDouble( |
423 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { | 423 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { |
424 // ----------- S t a t e ------------- | 424 // ----------- S t a t e ------------- |
425 // -- r0 : value | 425 // -- r0 : value |
426 // -- r1 : key | 426 // -- r1 : key |
427 // -- r2 : receiver | 427 // -- r2 : receiver |
428 // -- lr : return address | 428 // -- lr : return address |
429 // -- r3 : target map, scratch for subsequent call | 429 // -- r3 : target map, scratch for subsequent call |
430 // -- r4 : scratch (elements) | 430 // -- r4 : scratch (elements) |
431 // ----------------------------------- | 431 // ----------------------------------- |
432 Label loop, entry, convert_hole, gc_required, only_change_map, done; | 432 Label loop, entry, convert_hole, gc_required, only_change_map, done; |
433 | 433 |
434 if (mode == TRACK_ALLOCATION_SITE) { | 434 if (mode == TRACK_ALLOCATION_SITE) { |
435 __ TestJSArrayForAllocationSiteInfo(r2, r4); | 435 __ TestJSArrayForAllocationMemento(r2, r4); |
436 __ b(eq, fail); | 436 __ b(eq, fail); |
437 } | 437 } |
438 | 438 |
439 // Check for empty arrays, which only require a map transition and no changes | 439 // Check for empty arrays, which only require a map transition and no changes |
440 // to the backing store. | 440 // to the backing store. |
441 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); | 441 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); |
442 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); | 442 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
443 __ b(eq, &only_change_map); | 443 __ b(eq, &only_change_map); |
444 | 444 |
445 __ push(lr); | 445 __ push(lr); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 // -- r0 : value | 551 // -- r0 : value |
552 // -- r1 : key | 552 // -- r1 : key |
553 // -- r2 : receiver | 553 // -- r2 : receiver |
554 // -- lr : return address | 554 // -- lr : return address |
555 // -- r3 : target map, scratch for subsequent call | 555 // -- r3 : target map, scratch for subsequent call |
556 // -- r4 : scratch (elements) | 556 // -- r4 : scratch (elements) |
557 // ----------------------------------- | 557 // ----------------------------------- |
558 Label entry, loop, convert_hole, gc_required, only_change_map; | 558 Label entry, loop, convert_hole, gc_required, only_change_map; |
559 | 559 |
560 if (mode == TRACK_ALLOCATION_SITE) { | 560 if (mode == TRACK_ALLOCATION_SITE) { |
561 __ TestJSArrayForAllocationSiteInfo(r2, r4); | 561 __ TestJSArrayForAllocationMemento(r2, r4); |
562 __ b(eq, fail); | 562 __ b(eq, fail); |
563 } | 563 } |
564 | 564 |
565 // Check for empty arrays, which only require a map transition and no changes | 565 // Check for empty arrays, which only require a map transition and no changes |
566 // to the backing store. | 566 // to the backing store. |
567 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); | 567 __ ldr(r4, FieldMemOperand(r2, JSObject::kElementsOffset)); |
568 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); | 568 __ CompareRoot(r4, Heap::kEmptyFixedArrayRootIndex); |
569 __ b(eq, &only_change_map); | 569 __ b(eq, &only_change_map); |
570 | 570 |
571 __ push(lr); | 571 __ push(lr); |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 patcher.masm()->add(r0, pc, Operand(-8)); | 884 patcher.masm()->add(r0, pc, Operand(-8)); |
885 patcher.masm()->ldr(pc, MemOperand(pc, -4)); | 885 patcher.masm()->ldr(pc, MemOperand(pc, -4)); |
886 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); | 886 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); |
887 } | 887 } |
888 } | 888 } |
889 | 889 |
890 | 890 |
891 } } // namespace v8::internal | 891 } } // namespace v8::internal |
892 | 892 |
893 #endif // V8_TARGET_ARCH_ARM | 893 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |