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 7039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7050 // GenerateStoreField calls the stub with two different permutations of | 7050 // GenerateStoreField calls the stub with two different permutations of |
7051 // registers. This is the second. | 7051 // registers. This is the second. |
7052 { REG(ebx), REG(ecx), REG(edx), EMIT_REMEMBERED_SET }, | 7052 { REG(ebx), REG(ecx), REG(edx), EMIT_REMEMBERED_SET }, |
7053 // StoreIC::GenerateNormal via GenerateDictionaryStore | 7053 // StoreIC::GenerateNormal via GenerateDictionaryStore |
7054 { REG(ebx), REG(edi), REG(edx), EMIT_REMEMBERED_SET }, | 7054 { REG(ebx), REG(edi), REG(edx), EMIT_REMEMBERED_SET }, |
7055 // KeyedStoreIC::GenerateGeneric. | 7055 // KeyedStoreIC::GenerateGeneric. |
7056 { REG(ebx), REG(edx), REG(ecx), EMIT_REMEMBERED_SET}, | 7056 { REG(ebx), REG(edx), REG(ecx), EMIT_REMEMBERED_SET}, |
7057 // KeyedStoreStubCompiler::GenerateStoreFastElement. | 7057 // KeyedStoreStubCompiler::GenerateStoreFastElement. |
7058 { REG(edi), REG(ebx), REG(ecx), EMIT_REMEMBERED_SET}, | 7058 { REG(edi), REG(ebx), REG(ecx), EMIT_REMEMBERED_SET}, |
7059 { REG(edx), REG(edi), REG(ebx), EMIT_REMEMBERED_SET}, | 7059 { REG(edx), REG(edi), REG(ebx), EMIT_REMEMBERED_SET}, |
7060 // ElementsTransitionGenerator::GenerateSmiOnlyToObject | 7060 // ElementsTransitionGenerator::GenerateMapChangeElementTransition |
7061 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble | 7061 // and ElementsTransitionGenerator::GenerateSmiOnlyToDouble |
7062 // and ElementsTransitionGenerator::GenerateDoubleToObject | 7062 // and ElementsTransitionGenerator::GenerateDoubleToObject |
7063 { REG(edx), REG(ebx), REG(edi), EMIT_REMEMBERED_SET}, | 7063 { REG(edx), REG(ebx), REG(edi), EMIT_REMEMBERED_SET}, |
7064 { REG(edx), REG(ebx), REG(edi), OMIT_REMEMBERED_SET}, | 7064 { REG(edx), REG(ebx), REG(edi), OMIT_REMEMBERED_SET}, |
7065 // ElementsTransitionGenerator::GenerateDoubleToObject | 7065 // ElementsTransitionGenerator::GenerateDoubleToObject |
7066 { REG(eax), REG(edx), REG(esi), EMIT_REMEMBERED_SET}, | 7066 { REG(eax), REG(edx), REG(esi), EMIT_REMEMBERED_SET}, |
7067 { REG(edx), REG(eax), REG(edi), EMIT_REMEMBERED_SET}, | 7067 { REG(edx), REG(eax), REG(edi), EMIT_REMEMBERED_SET}, |
7068 // StoreArrayLiteralElementStub::Generate | 7068 // StoreArrayLiteralElementStub::Generate |
7069 { REG(ebx), REG(eax), REG(ecx), EMIT_REMEMBERED_SET}, | 7069 { REG(ebx), REG(eax), REG(ecx), EMIT_REMEMBERED_SET}, |
7070 // Null termination. | 7070 // Null termination. |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7323 | 7323 |
7324 Label element_done; | 7324 Label element_done; |
7325 Label double_elements; | 7325 Label double_elements; |
7326 Label smi_element; | 7326 Label smi_element; |
7327 Label slow_elements; | 7327 Label slow_elements; |
7328 Label slow_elements_from_double; | 7328 Label slow_elements_from_double; |
7329 Label fast_elements; | 7329 Label fast_elements; |
7330 | 7330 |
7331 __ CheckFastElements(edi, &double_elements); | 7331 __ CheckFastElements(edi, &double_elements); |
7332 | 7332 |
7333 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS | 7333 // Check for FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS elements |
7334 __ JumpIfSmi(eax, &smi_element); | 7334 __ JumpIfSmi(eax, &smi_element); |
7335 __ CheckFastSmiOnlyElements(edi, &fast_elements, Label::kNear); | 7335 __ CheckFastSmiOnlyElements(edi, &fast_elements, Label::kNear); |
7336 | 7336 |
7337 // Store into the array literal requires a elements transition. Call into | 7337 // Store into the array literal requires a elements transition. Call into |
7338 // the runtime. | 7338 // the runtime. |
7339 | 7339 |
7340 __ bind(&slow_elements); | 7340 __ bind(&slow_elements); |
7341 __ pop(edi); // Pop return address and remember to put back later for tail | 7341 __ pop(edi); // Pop return address and remember to put back later for tail |
7342 // call. | 7342 // call. |
7343 __ push(ebx); | 7343 __ push(ebx); |
7344 __ push(ecx); | 7344 __ push(ecx); |
7345 __ push(eax); | 7345 __ push(eax); |
7346 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 7346 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
7347 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); | 7347 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
7348 __ push(edx); | 7348 __ push(edx); |
7349 __ push(edi); // Return return address so that tail call returns to right | 7349 __ push(edi); // Return return address so that tail call returns to right |
7350 // place. | 7350 // place. |
7351 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); | 7351 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); |
7352 | 7352 |
7353 __ bind(&slow_elements_from_double); | 7353 __ bind(&slow_elements_from_double); |
7354 __ pop(edx); | 7354 __ pop(edx); |
7355 __ jmp(&slow_elements); | 7355 __ jmp(&slow_elements); |
7356 | 7356 |
7357 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. | 7357 // Array literal has ElementsKind of FAST_*_ELEMENTS and value is an object. |
7358 __ bind(&fast_elements); | 7358 __ bind(&fast_elements); |
7359 __ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset)); | 7359 __ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset)); |
7360 __ lea(ecx, FieldOperand(ebx, ecx, times_half_pointer_size, | 7360 __ lea(ecx, FieldOperand(ebx, ecx, times_half_pointer_size, |
7361 FixedArrayBase::kHeaderSize)); | 7361 FixedArrayBase::kHeaderSize)); |
7362 __ mov(Operand(ecx, 0), eax); | 7362 __ mov(Operand(ecx, 0), eax); |
7363 // Update the write barrier for the array store. | 7363 // Update the write barrier for the array store. |
7364 __ RecordWrite(ebx, ecx, eax, | 7364 __ RecordWrite(ebx, ecx, eax, |
7365 kDontSaveFPRegs, | 7365 kDontSaveFPRegs, |
7366 EMIT_REMEMBERED_SET, | 7366 EMIT_REMEMBERED_SET, |
7367 OMIT_SMI_CHECK); | 7367 OMIT_SMI_CHECK); |
7368 __ ret(0); | 7368 __ ret(0); |
7369 | 7369 |
7370 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or | 7370 // Array literal has ElementsKind of FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS, |
7371 // FAST_ELEMENTS, and value is Smi. | 7371 // and value is Smi. |
7372 __ bind(&smi_element); | 7372 __ bind(&smi_element); |
7373 __ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset)); | 7373 __ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset)); |
7374 __ mov(FieldOperand(ebx, ecx, times_half_pointer_size, | 7374 __ mov(FieldOperand(ebx, ecx, times_half_pointer_size, |
7375 FixedArrayBase::kHeaderSize), eax); | 7375 FixedArrayBase::kHeaderSize), eax); |
7376 __ ret(0); | 7376 __ ret(0); |
7377 | 7377 |
7378 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. | 7378 // Array literal has ElementsKind of FAST_*_DOUBLE_ELEMENTS. |
7379 __ bind(&double_elements); | 7379 __ bind(&double_elements); |
7380 | 7380 |
7381 __ push(edx); | 7381 __ push(edx); |
7382 __ mov(edx, FieldOperand(ebx, JSObject::kElementsOffset)); | 7382 __ mov(edx, FieldOperand(ebx, JSObject::kElementsOffset)); |
7383 __ StoreNumberToDoubleElements(eax, | 7383 __ StoreNumberToDoubleElements(eax, |
7384 edx, | 7384 edx, |
7385 ecx, | 7385 ecx, |
7386 edi, | 7386 edi, |
7387 xmm0, | 7387 xmm0, |
7388 &slow_elements_from_double, | 7388 &slow_elements_from_double, |
7389 false); | 7389 false); |
7390 __ pop(edx); | 7390 __ pop(edx); |
7391 __ ret(0); | 7391 __ ret(0); |
7392 } | 7392 } |
7393 | 7393 |
7394 #undef __ | 7394 #undef __ |
7395 | 7395 |
7396 } } // namespace v8::internal | 7396 } } // namespace v8::internal |
7397 | 7397 |
7398 #endif // V8_TARGET_ARCH_IA32 | 7398 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |