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 3550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3561 // Make sure the function is the Array() function | 3561 // Make sure the function is the Array() function |
3562 __ LoadArrayFunction(rcx); | 3562 __ LoadArrayFunction(rcx); |
3563 __ cmpq(rdi, rcx); | 3563 __ cmpq(rdi, rcx); |
3564 __ j(not_equal, ¬_array_function); | 3564 __ j(not_equal, ¬_array_function); |
3565 | 3565 |
3566 // The target function is the Array constructor, | 3566 // The target function is the Array constructor, |
3567 // Create an AllocationSite if we don't already have it, store it in the cell | 3567 // Create an AllocationSite if we don't already have it, store it in the cell |
3568 { | 3568 { |
3569 FrameScope scope(masm, StackFrame::INTERNAL); | 3569 FrameScope scope(masm, StackFrame::INTERNAL); |
3570 | 3570 |
| 3571 __ Integer32ToSmi(rax, rax); |
3571 __ push(rax); | 3572 __ push(rax); |
3572 __ push(rdi); | 3573 __ push(rdi); |
3573 __ push(rbx); | 3574 __ push(rbx); |
3574 | 3575 |
3575 CreateAllocationSiteStub create_stub; | 3576 CreateAllocationSiteStub create_stub; |
3576 __ CallStub(&create_stub); | 3577 __ CallStub(&create_stub); |
3577 | 3578 |
3578 __ pop(rbx); | 3579 __ pop(rbx); |
3579 __ pop(rdi); | 3580 __ pop(rdi); |
3580 __ pop(rax); | 3581 __ pop(rax); |
| 3582 __ SmiToInteger32(rax, rax); |
3581 } | 3583 } |
3582 __ jmp(&done); | 3584 __ jmp(&done); |
3583 | 3585 |
3584 __ bind(¬_array_function); | 3586 __ bind(¬_array_function); |
3585 __ movq(FieldOperand(rbx, Cell::kValueOffset), rdi); | 3587 __ movq(FieldOperand(rbx, Cell::kValueOffset), rdi); |
3586 // No need for a write barrier here - cells are rescanned. | 3588 // No need for a write barrier here - cells are rescanned. |
3587 | 3589 |
3588 __ bind(&done); | 3590 __ bind(&done); |
3589 } | 3591 } |
3590 | 3592 |
(...skipping 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6800 __ bind(&fast_elements_case); | 6802 __ bind(&fast_elements_case); |
6801 GenerateCase(masm, FAST_ELEMENTS); | 6803 GenerateCase(masm, FAST_ELEMENTS); |
6802 } | 6804 } |
6803 | 6805 |
6804 | 6806 |
6805 #undef __ | 6807 #undef __ |
6806 | 6808 |
6807 } } // namespace v8::internal | 6809 } } // namespace v8::internal |
6808 | 6810 |
6809 #endif // V8_TARGET_ARCH_X64 | 6811 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |