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 5984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5995 // GenerateStoreField calls the stub with two different permutations of | 5995 // GenerateStoreField calls the stub with two different permutations of |
5996 // registers. This is the second. | 5996 // registers. This is the second. |
5997 { REG(rbx), REG(rcx), REG(rdx), EMIT_REMEMBERED_SET }, | 5997 { REG(rbx), REG(rcx), REG(rdx), EMIT_REMEMBERED_SET }, |
5998 // StoreIC::GenerateNormal via GenerateDictionaryStore. | 5998 // StoreIC::GenerateNormal via GenerateDictionaryStore. |
5999 { REG(rbx), REG(r8), REG(r9), EMIT_REMEMBERED_SET }, | 5999 { REG(rbx), REG(r8), REG(r9), EMIT_REMEMBERED_SET }, |
6000 // KeyedStoreIC::GenerateGeneric. | 6000 // KeyedStoreIC::GenerateGeneric. |
6001 { REG(rbx), REG(rdx), REG(rcx), EMIT_REMEMBERED_SET}, | 6001 { REG(rbx), REG(rdx), REG(rcx), EMIT_REMEMBERED_SET}, |
6002 // KeyedStoreStubCompiler::GenerateStoreFastElement. | 6002 // KeyedStoreStubCompiler::GenerateStoreFastElement. |
6003 { REG(rdi), REG(rbx), REG(rcx), EMIT_REMEMBERED_SET}, | 6003 { REG(rdi), REG(rbx), REG(rcx), EMIT_REMEMBERED_SET}, |
6004 { REG(rdx), REG(rdi), REG(rbx), EMIT_REMEMBERED_SET}, | 6004 { REG(rdx), REG(rdi), REG(rbx), EMIT_REMEMBERED_SET}, |
6005 // ElementsTransitionGenerator::GenerateMapChangeElementTransition | 6005 // ElementsTransitionGenerator::GenerateSmiOnlyToObject |
6006 // and ElementsTransitionGenerator::GenerateSmiToDouble | 6006 // and ElementsTransitionGenerator::GenerateSmiOnlyToObject |
6007 // and ElementsTransitionGenerator::GenerateDoubleToObject | 6007 // and ElementsTransitionGenerator::GenerateDoubleToObject |
6008 { REG(rdx), REG(rbx), REG(rdi), EMIT_REMEMBERED_SET}, | 6008 { REG(rdx), REG(rbx), REG(rdi), EMIT_REMEMBERED_SET}, |
6009 { REG(rdx), REG(rbx), REG(rdi), OMIT_REMEMBERED_SET}, | 6009 { REG(rdx), REG(rbx), REG(rdi), OMIT_REMEMBERED_SET}, |
6010 // ElementsTransitionGenerator::GenerateSmiToDouble | 6010 // ElementsTransitionGenerator::GenerateSmiOnlyToDouble |
6011 // and ElementsTransitionGenerator::GenerateDoubleToObject | 6011 // and ElementsTransitionGenerator::GenerateDoubleToObject |
6012 { REG(rdx), REG(r11), REG(r15), EMIT_REMEMBERED_SET}, | 6012 { REG(rdx), REG(r11), REG(r15), EMIT_REMEMBERED_SET}, |
6013 // ElementsTransitionGenerator::GenerateDoubleToObject | 6013 // ElementsTransitionGenerator::GenerateDoubleToObject |
6014 { REG(r11), REG(rax), REG(r15), EMIT_REMEMBERED_SET}, | 6014 { REG(r11), REG(rax), REG(r15), EMIT_REMEMBERED_SET}, |
6015 // StoreArrayLiteralElementStub::Generate | 6015 // StoreArrayLiteralElementStub::Generate |
6016 { REG(rbx), REG(rax), REG(rcx), EMIT_REMEMBERED_SET}, | 6016 { REG(rbx), REG(rax), REG(rcx), EMIT_REMEMBERED_SET}, |
6017 // Null termination. | 6017 // Null termination. |
6018 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} | 6018 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} |
6019 }; | 6019 }; |
6020 | 6020 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6274 // ----------------------------------- | 6274 // ----------------------------------- |
6275 | 6275 |
6276 Label element_done; | 6276 Label element_done; |
6277 Label double_elements; | 6277 Label double_elements; |
6278 Label smi_element; | 6278 Label smi_element; |
6279 Label slow_elements; | 6279 Label slow_elements; |
6280 Label fast_elements; | 6280 Label fast_elements; |
6281 | 6281 |
6282 __ CheckFastElements(rdi, &double_elements); | 6282 __ CheckFastElements(rdi, &double_elements); |
6283 | 6283 |
6284 // FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS | 6284 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS |
6285 __ JumpIfSmi(rax, &smi_element); | 6285 __ JumpIfSmi(rax, &smi_element); |
6286 __ CheckFastSmiElements(rdi, &fast_elements); | 6286 __ CheckFastSmiOnlyElements(rdi, &fast_elements); |
6287 | 6287 |
6288 // Store into the array literal requires a elements transition. Call into | 6288 // Store into the array literal requires a elements transition. Call into |
6289 // the runtime. | 6289 // the runtime. |
6290 | 6290 |
6291 __ bind(&slow_elements); | 6291 __ bind(&slow_elements); |
6292 __ pop(rdi); // Pop return address and remember to put back later for tail | 6292 __ pop(rdi); // Pop return address and remember to put back later for tail |
6293 // call. | 6293 // call. |
6294 __ push(rbx); | 6294 __ push(rbx); |
6295 __ push(rcx); | 6295 __ push(rcx); |
6296 __ push(rax); | 6296 __ push(rax); |
6297 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 6297 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
6298 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); | 6298 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); |
6299 __ push(rdx); | 6299 __ push(rdx); |
6300 __ push(rdi); // Return return address so that tail call returns to right | 6300 __ push(rdi); // Return return address so that tail call returns to right |
6301 // place. | 6301 // place. |
6302 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); | 6302 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); |
6303 | 6303 |
6304 // Array literal has ElementsKind of FAST_*_ELEMENTS and value is an object. | 6304 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. |
6305 __ bind(&fast_elements); | 6305 __ bind(&fast_elements); |
6306 __ SmiToInteger32(kScratchRegister, rcx); | 6306 __ SmiToInteger32(kScratchRegister, rcx); |
6307 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); | 6307 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); |
6308 __ lea(rcx, FieldOperand(rbx, kScratchRegister, times_pointer_size, | 6308 __ lea(rcx, FieldOperand(rbx, kScratchRegister, times_pointer_size, |
6309 FixedArrayBase::kHeaderSize)); | 6309 FixedArrayBase::kHeaderSize)); |
6310 __ movq(Operand(rcx, 0), rax); | 6310 __ movq(Operand(rcx, 0), rax); |
6311 // Update the write barrier for the array store. | 6311 // Update the write barrier for the array store. |
6312 __ RecordWrite(rbx, rcx, rax, | 6312 __ RecordWrite(rbx, rcx, rax, |
6313 kDontSaveFPRegs, | 6313 kDontSaveFPRegs, |
6314 EMIT_REMEMBERED_SET, | 6314 EMIT_REMEMBERED_SET, |
6315 OMIT_SMI_CHECK); | 6315 OMIT_SMI_CHECK); |
6316 __ ret(0); | 6316 __ ret(0); |
6317 | 6317 |
6318 // Array literal has ElementsKind of FAST_*_SMI_ELEMENTS or | 6318 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or |
6319 // FAST_*_ELEMENTS, and value is Smi. | 6319 // FAST_ELEMENTS, and value is Smi. |
6320 __ bind(&smi_element); | 6320 __ bind(&smi_element); |
6321 __ SmiToInteger32(kScratchRegister, rcx); | 6321 __ SmiToInteger32(kScratchRegister, rcx); |
6322 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); | 6322 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); |
6323 __ movq(FieldOperand(rbx, kScratchRegister, times_pointer_size, | 6323 __ movq(FieldOperand(rbx, kScratchRegister, times_pointer_size, |
6324 FixedArrayBase::kHeaderSize), rax); | 6324 FixedArrayBase::kHeaderSize), rax); |
6325 __ ret(0); | 6325 __ ret(0); |
6326 | 6326 |
6327 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. | 6327 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. |
6328 __ bind(&double_elements); | 6328 __ bind(&double_elements); |
6329 | 6329 |
6330 __ movq(r9, FieldOperand(rbx, JSObject::kElementsOffset)); | 6330 __ movq(r9, FieldOperand(rbx, JSObject::kElementsOffset)); |
6331 __ SmiToInteger32(r11, rcx); | 6331 __ SmiToInteger32(r11, rcx); |
6332 __ StoreNumberToDoubleElements(rax, | 6332 __ StoreNumberToDoubleElements(rax, |
6333 r9, | 6333 r9, |
6334 r11, | 6334 r11, |
6335 xmm0, | 6335 xmm0, |
6336 &slow_elements); | 6336 &slow_elements); |
6337 __ ret(0); | 6337 __ ret(0); |
6338 } | 6338 } |
6339 | 6339 |
6340 #undef __ | 6340 #undef __ |
6341 | 6341 |
6342 } } // namespace v8::internal | 6342 } } // namespace v8::internal |
6343 | 6343 |
6344 #endif // V8_TARGET_ARCH_X64 | 6344 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |