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 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 // Check if we could survive without allocation. | 1544 // Check if we could survive without allocation. |
1545 __ cmpl(rax, rcx); | 1545 __ cmpl(rax, rcx); |
1546 __ j(greater, &call_builtin); | 1546 __ j(greater, &call_builtin); |
1547 | 1547 |
1548 __ movq(rcx, Operand(rsp, argc * kPointerSize)); | 1548 __ movq(rcx, Operand(rsp, argc * kPointerSize)); |
1549 __ StoreNumberToDoubleElements( | 1549 __ StoreNumberToDoubleElements( |
1550 rcx, rdi, rax, xmm0, &call_builtin, argc * kDoubleSize); | 1550 rcx, rdi, rax, xmm0, &call_builtin, argc * kDoubleSize); |
1551 | 1551 |
1552 // Save new length. | 1552 // Save new length. |
1553 __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax); | 1553 __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax); |
| 1554 __ Integer32ToSmi(rax, rax); // Return new length as smi. |
1554 __ ret((argc + 1) * kPointerSize); | 1555 __ ret((argc + 1) * kPointerSize); |
1555 | 1556 |
1556 __ bind(&with_write_barrier); | 1557 __ bind(&with_write_barrier); |
1557 | 1558 |
1558 __ movq(rbx, FieldOperand(rdx, HeapObject::kMapOffset)); | 1559 __ movq(rbx, FieldOperand(rdx, HeapObject::kMapOffset)); |
1559 | 1560 |
1560 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) { | 1561 if (FLAG_smi_only_arrays && !FLAG_trace_elements_transitions) { |
1561 Label fast_object, not_fast_object; | 1562 Label fast_object, not_fast_object; |
1562 __ CheckFastObjectElements(rbx, ¬_fast_object, Label::kNear); | 1563 __ CheckFastObjectElements(rbx, ¬_fast_object, Label::kNear); |
1563 __ jmp(&fast_object); | 1564 __ jmp(&fast_object); |
(...skipping 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4135 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4136 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
4136 } | 4137 } |
4137 } | 4138 } |
4138 | 4139 |
4139 | 4140 |
4140 #undef __ | 4141 #undef __ |
4141 | 4142 |
4142 } } // namespace v8::internal | 4143 } } // namespace v8::internal |
4143 | 4144 |
4144 #endif // V8_TARGET_ARCH_X64 | 4145 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |