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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 #undef __ | 384 #undef __ |
385 | 385 |
386 // ------------------------------------------------------------------------- | 386 // ------------------------------------------------------------------------- |
387 // Code generators | 387 // Code generators |
388 | 388 |
389 #define __ ACCESS_MASM(masm) | 389 #define __ ACCESS_MASM(masm) |
390 | 390 |
391 | 391 |
392 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( | 392 void ElementsTransitionGenerator::GenerateMapChangeElementsTransition( |
393 MacroAssembler* masm) { | 393 MacroAssembler* masm, AllocationSiteMode mode, |
| 394 Label* allocation_site_info_found) { |
394 // ----------- S t a t e ------------- | 395 // ----------- S t a t e ------------- |
395 // -- eax : value | 396 // -- eax : value |
396 // -- ebx : target map | 397 // -- ebx : target map |
397 // -- ecx : key | 398 // -- ecx : key |
398 // -- edx : receiver | 399 // -- edx : receiver |
399 // -- esp[0] : return address | 400 // -- esp[0] : return address |
400 // ----------------------------------- | 401 // ----------------------------------- |
| 402 if (mode == TRACK_ALLOCATION_SITE) { |
| 403 ASSERT(allocation_site_info_found != NULL); |
| 404 masm->TestJSArrayForAllocationSiteInfo(edx, edi, |
| 405 allocation_site_info_found); |
| 406 } |
| 407 |
401 // Set transitioned map. | 408 // Set transitioned map. |
402 __ mov(FieldOperand(edx, HeapObject::kMapOffset), ebx); | 409 __ mov(FieldOperand(edx, HeapObject::kMapOffset), ebx); |
403 __ RecordWriteField(edx, | 410 __ RecordWriteField(edx, |
404 HeapObject::kMapOffset, | 411 HeapObject::kMapOffset, |
405 ebx, | 412 ebx, |
406 edi, | 413 edi, |
407 kDontSaveFPRegs, | 414 kDontSaveFPRegs, |
408 EMIT_REMEMBERED_SET, | 415 EMIT_REMEMBERED_SET, |
409 OMIT_SMI_CHECK); | 416 OMIT_SMI_CHECK); |
410 } | 417 } |
411 | 418 |
412 | 419 |
413 void ElementsTransitionGenerator::GenerateSmiToDouble( | 420 void ElementsTransitionGenerator::GenerateSmiToDouble( |
414 MacroAssembler* masm, Label* fail) { | 421 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { |
415 // ----------- S t a t e ------------- | 422 // ----------- S t a t e ------------- |
416 // -- eax : value | 423 // -- eax : value |
417 // -- ebx : target map | 424 // -- ebx : target map |
418 // -- ecx : key | 425 // -- ecx : key |
419 // -- edx : receiver | 426 // -- edx : receiver |
420 // -- esp[0] : return address | 427 // -- esp[0] : return address |
421 // ----------------------------------- | 428 // ----------------------------------- |
422 Label loop, entry, convert_hole, gc_required, only_change_map; | 429 Label loop, entry, convert_hole, gc_required, only_change_map; |
423 | 430 |
424 if (FLAG_track_allocation_sites) { | 431 if (mode == TRACK_ALLOCATION_SITE) { |
425 masm->TestJSArrayForAllocationSiteInfo(edx, edi, fail); | 432 masm->TestJSArrayForAllocationSiteInfo(edx, edi, fail); |
426 } | 433 } |
427 | 434 |
428 // Check for empty arrays, which only require a map transition and no changes | 435 // Check for empty arrays, which only require a map transition and no changes |
429 // to the backing store. | 436 // to the backing store. |
430 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 437 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
431 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); | 438 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); |
432 __ j(equal, &only_change_map); | 439 __ j(equal, &only_change_map); |
433 | 440 |
434 __ push(eax); | 441 __ push(eax); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 HeapObject::kMapOffset, | 550 HeapObject::kMapOffset, |
544 ebx, | 551 ebx, |
545 edi, | 552 edi, |
546 kDontSaveFPRegs, | 553 kDontSaveFPRegs, |
547 OMIT_REMEMBERED_SET, | 554 OMIT_REMEMBERED_SET, |
548 OMIT_SMI_CHECK); | 555 OMIT_SMI_CHECK); |
549 } | 556 } |
550 | 557 |
551 | 558 |
552 void ElementsTransitionGenerator::GenerateDoubleToObject( | 559 void ElementsTransitionGenerator::GenerateDoubleToObject( |
553 MacroAssembler* masm, Label* fail) { | 560 MacroAssembler* masm, AllocationSiteMode mode, Label* fail) { |
554 // ----------- S t a t e ------------- | 561 // ----------- S t a t e ------------- |
555 // -- eax : value | 562 // -- eax : value |
556 // -- ebx : target map | 563 // -- ebx : target map |
557 // -- ecx : key | 564 // -- ecx : key |
558 // -- edx : receiver | 565 // -- edx : receiver |
559 // -- esp[0] : return address | 566 // -- esp[0] : return address |
560 // ----------------------------------- | 567 // ----------------------------------- |
561 Label loop, entry, convert_hole, gc_required, only_change_map, success; | 568 Label loop, entry, convert_hole, gc_required, only_change_map, success; |
562 | 569 |
| 570 if (mode == TRACK_ALLOCATION_SITE) { |
| 571 masm->TestJSArrayForAllocationSiteInfo(edx, edi, fail); |
| 572 } |
| 573 |
563 // Check for empty arrays, which only require a map transition and no changes | 574 // Check for empty arrays, which only require a map transition and no changes |
564 // to the backing store. | 575 // to the backing store. |
565 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 576 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
566 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); | 577 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); |
567 __ j(equal, &only_change_map); | 578 __ j(equal, &only_change_map); |
568 | 579 |
569 __ push(eax); | 580 __ push(eax); |
570 __ push(edx); | 581 __ push(edx); |
571 __ push(ebx); | 582 __ push(ebx); |
572 | 583 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 Code* stub = GetCodeAgeStub(age, parity); | 955 Code* stub = GetCodeAgeStub(age, parity); |
945 CodePatcher patcher(sequence, young_length); | 956 CodePatcher patcher(sequence, young_length); |
946 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); | 957 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); |
947 } | 958 } |
948 } | 959 } |
949 | 960 |
950 | 961 |
951 } } // namespace v8::internal | 962 } } // namespace v8::internal |
952 | 963 |
953 #endif // V8_TARGET_ARCH_IA32 | 964 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |