OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 5972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5983 __ pop(rdi); // Pop return address and remember to put back later for tail | 5983 __ pop(rdi); // Pop return address and remember to put back later for tail |
5984 // call. | 5984 // call. |
5985 __ push(rbx); | 5985 __ push(rbx); |
5986 __ push(rcx); | 5986 __ push(rcx); |
5987 __ push(rax); | 5987 __ push(rax); |
5988 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 5988 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
5989 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); | 5989 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); |
5990 __ push(rdx); | 5990 __ push(rdx); |
5991 __ push(rdi); // Return return address so that tail call returns to right | 5991 __ push(rdi); // Return return address so that tail call returns to right |
5992 // place. | 5992 // place. |
5993 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); | 5993 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 0); |
5994 | 5994 |
5995 if (!FLAG_trace_elements_transitions) { | 5995 if (!FLAG_trace_elements_transitions) { |
5996 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. | 5996 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. |
5997 __ bind(&double_elements); | 5997 __ bind(&double_elements); |
5998 | 5998 |
5999 __ movq(r9, FieldOperand(rbx, JSObject::kElementsOffset)); | 5999 __ movq(r9, FieldOperand(rbx, JSObject::kElementsOffset)); |
6000 __ SmiToInteger32(r10, rcx); | 6000 __ SmiToInteger32(r11, rcx); |
6001 __ StoreNumberToDoubleElements(rax, | 6001 __ StoreNumberToDoubleElements(rax, |
6002 r9, | 6002 r9, |
6003 r10, | 6003 r11, |
6004 xmm0, | 6004 xmm0, |
6005 &slow_elements); | 6005 &slow_elements); |
6006 __ jmp(&element_done); | 6006 __ jmp(&element_done); |
6007 | 6007 |
6008 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. | 6008 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. |
6009 __ bind(&fast_elements); | 6009 __ bind(&fast_elements); |
6010 __ SmiToInteger32(r10, rcx); | 6010 __ SmiToInteger32(kScratchRegister, rcx); |
6011 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); | 6011 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); |
6012 __ lea(rcx, FieldOperand(rbx, r10, times_pointer_size, | 6012 __ lea(rcx, FieldOperand(rbx, kScratchRegister, times_pointer_size, |
6013 FixedArrayBase::kHeaderSize)); | 6013 FixedArrayBase::kHeaderSize)); |
6014 __ movq(Operand(rcx, 0), rax); | 6014 __ movq(Operand(rcx, 0), rax); |
6015 // Update the write barrier for the array store. | 6015 // Update the write barrier for the array store. |
6016 __ RecordWrite(rbx, rcx, rax, | 6016 __ RecordWrite(rbx, rcx, rax, |
6017 kDontSaveFPRegs, | 6017 kDontSaveFPRegs, |
6018 EMIT_REMEMBERED_SET, | 6018 EMIT_REMEMBERED_SET, |
6019 OMIT_SMI_CHECK); | 6019 OMIT_SMI_CHECK); |
6020 __ jmp(&element_done); | 6020 __ jmp(&element_done); |
6021 | 6021 |
6022 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or | 6022 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or |
6023 // FAST_ELEMENTS, and value is Smi. | 6023 // FAST_ELEMENTS, and value is Smi. |
6024 __ bind(&smi_element); | 6024 __ bind(&smi_element); |
6025 __ SmiToInteger32(r10, rcx); | 6025 __ SmiToInteger32(kScratchRegister, rcx); |
6026 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); | 6026 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); |
6027 __ movq(FieldOperand(rbx, r10, times_pointer_size, | 6027 __ movq(FieldOperand(rbx, kScratchRegister, times_pointer_size, |
6028 FixedArrayBase::kHeaderSize), rax); | 6028 FixedArrayBase::kHeaderSize), rax); |
6029 // Fall through | 6029 // Fall through |
6030 __ bind(&element_done); | 6030 __ bind(&element_done); |
6031 __ ret(0); | 6031 __ ret(0); |
6032 } | 6032 } |
6033 } | 6033 } |
6034 | 6034 |
6035 #undef __ | 6035 #undef __ |
6036 | 6036 |
6037 } } // namespace v8::internal | 6037 } } // namespace v8::internal |
6038 | 6038 |
6039 #endif // V8_TARGET_ARCH_X64 | 6039 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |