| 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 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 case CodeStub::SubString: { | 1342 case CodeStub::SubString: { |
| 1343 SubStringStub stub; | 1343 SubStringStub stub; |
| 1344 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 1344 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 1345 break; | 1345 break; |
| 1346 } | 1346 } |
| 1347 case CodeStub::StringCompare: { | 1347 case CodeStub::StringCompare: { |
| 1348 StringCompareStub stub; | 1348 StringCompareStub stub; |
| 1349 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 1349 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 1350 break; | 1350 break; |
| 1351 } | 1351 } |
| 1352 case CodeStub::TranscendentalCache: { | |
| 1353 TranscendentalCacheStub stub(instr->transcendental_type(), | |
| 1354 TranscendentalCacheStub::TAGGED); | |
| 1355 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | |
| 1356 break; | |
| 1357 } | |
| 1358 default: | 1352 default: |
| 1359 UNREACHABLE(); | 1353 UNREACHABLE(); |
| 1360 } | 1354 } |
| 1361 } | 1355 } |
| 1362 | 1356 |
| 1363 | 1357 |
| 1364 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { | 1358 void LCodeGen::DoUnknownOSRValue(LUnknownOSRValue* instr) { |
| 1365 GenerateOsrPrologue(); | 1359 GenerateOsrPrologue(); |
| 1366 } | 1360 } |
| 1367 | 1361 |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2252 // Don't delete this mov. It may improve performance on some CPUs, | 2246 // Don't delete this mov. It may improve performance on some CPUs, |
| 2253 // when there is a mulsd depending on the result | 2247 // when there is a mulsd depending on the result |
| 2254 __ movaps(left, left); | 2248 __ movaps(left, left); |
| 2255 break; | 2249 break; |
| 2256 case Token::MOD: { | 2250 case Token::MOD: { |
| 2257 // Pass two doubles as arguments on the stack. | 2251 // Pass two doubles as arguments on the stack. |
| 2258 __ PrepareCallCFunction(4, eax); | 2252 __ PrepareCallCFunction(4, eax); |
| 2259 __ movsd(Operand(esp, 0 * kDoubleSize), left); | 2253 __ movsd(Operand(esp, 0 * kDoubleSize), left); |
| 2260 __ movsd(Operand(esp, 1 * kDoubleSize), right); | 2254 __ movsd(Operand(esp, 1 * kDoubleSize), right); |
| 2261 __ CallCFunction( | 2255 __ CallCFunction( |
| 2262 ExternalReference::double_fp_operation(Token::MOD, isolate()), | 2256 ExternalReference::mod_two_doubles_operation(isolate()), |
| 2263 4); | 2257 4); |
| 2264 | 2258 |
| 2265 // Return value is in st(0) on ia32. | 2259 // Return value is in st(0) on ia32. |
| 2266 // Store it into the result register. | 2260 // Store it into the result register. |
| 2267 __ sub(Operand(esp), Immediate(kDoubleSize)); | 2261 __ sub(Operand(esp), Immediate(kDoubleSize)); |
| 2268 __ fstp_d(Operand(esp, 0)); | 2262 __ fstp_d(Operand(esp, 0)); |
| 2269 __ movsd(result, Operand(esp, 0)); | 2263 __ movsd(result, Operand(esp, 0)); |
| 2270 __ add(Operand(esp), Immediate(kDoubleSize)); | 2264 __ add(Operand(esp), Immediate(kDoubleSize)); |
| 2271 break; | 2265 break; |
| 2272 } | 2266 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2296 break; | 2290 break; |
| 2297 case Token::MOD: { | 2291 case Token::MOD: { |
| 2298 // Pass two doubles as arguments on the stack. | 2292 // Pass two doubles as arguments on the stack. |
| 2299 __ PrepareCallCFunction(4, eax); | 2293 __ PrepareCallCFunction(4, eax); |
| 2300 X87Mov(Operand(esp, 1 * kDoubleSize), right); | 2294 X87Mov(Operand(esp, 1 * kDoubleSize), right); |
| 2301 X87Mov(Operand(esp, 0), left); | 2295 X87Mov(Operand(esp, 0), left); |
| 2302 X87Free(right); | 2296 X87Free(right); |
| 2303 ASSERT(left.is(result)); | 2297 ASSERT(left.is(result)); |
| 2304 X87PrepareToWrite(result); | 2298 X87PrepareToWrite(result); |
| 2305 __ CallCFunction( | 2299 __ CallCFunction( |
| 2306 ExternalReference::double_fp_operation(Token::MOD, isolate()), | 2300 ExternalReference::mod_two_doubles_operation(isolate()), |
| 2307 4); | 2301 4); |
| 2308 | 2302 |
| 2309 // Return value is in st(0) on ia32. | 2303 // Return value is in st(0) on ia32. |
| 2310 X87CommitWrite(result); | 2304 X87CommitWrite(result); |
| 2311 break; | 2305 break; |
| 2312 } | 2306 } |
| 2313 default: | 2307 default: |
| 2314 UNREACHABLE(); | 2308 UNREACHABLE(); |
| 2315 break; | 2309 break; |
| 2316 } | 2310 } |
| (...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4155 | 4149 |
| 4156 void LCodeGen::DoMathLog(LMathLog* instr) { | 4150 void LCodeGen::DoMathLog(LMathLog* instr) { |
| 4157 CpuFeatureScope scope(masm(), SSE2); | 4151 CpuFeatureScope scope(masm(), SSE2); |
| 4158 ASSERT(instr->value()->Equals(instr->result())); | 4152 ASSERT(instr->value()->Equals(instr->result())); |
| 4159 XMMRegister input_reg = ToDoubleRegister(instr->value()); | 4153 XMMRegister input_reg = ToDoubleRegister(instr->value()); |
| 4160 XMMRegister xmm_scratch = double_scratch0(); | 4154 XMMRegister xmm_scratch = double_scratch0(); |
| 4161 Label positive, done, zero; | 4155 Label positive, done, zero; |
| 4162 __ xorps(xmm_scratch, xmm_scratch); | 4156 __ xorps(xmm_scratch, xmm_scratch); |
| 4163 __ ucomisd(input_reg, xmm_scratch); | 4157 __ ucomisd(input_reg, xmm_scratch); |
| 4164 __ j(above, &positive, Label::kNear); | 4158 __ j(above, &positive, Label::kNear); |
| 4165 __ j(equal, &zero, Label::kNear); | 4159 __ j(not_carry, &zero, Label::kNear); |
| 4166 ExternalReference nan = | 4160 ExternalReference nan = |
| 4167 ExternalReference::address_of_canonical_non_hole_nan(); | 4161 ExternalReference::address_of_canonical_non_hole_nan(); |
| 4168 __ movsd(input_reg, Operand::StaticVariable(nan)); | 4162 __ movsd(input_reg, Operand::StaticVariable(nan)); |
| 4169 __ jmp(&done, Label::kNear); | 4163 __ jmp(&done, Label::kNear); |
| 4170 __ bind(&zero); | 4164 __ bind(&zero); |
| 4171 ExternalReference ninf = | 4165 ExternalReference ninf = |
| 4172 ExternalReference::address_of_negative_infinity(); | 4166 ExternalReference::address_of_negative_infinity(); |
| 4173 __ movsd(input_reg, Operand::StaticVariable(ninf)); | 4167 __ movsd(input_reg, Operand::StaticVariable(ninf)); |
| 4174 __ jmp(&done, Label::kNear); | 4168 __ jmp(&done, Label::kNear); |
| 4175 __ bind(&positive); | 4169 __ bind(&positive); |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4911 __ StoreToSafepointRegisterSlot(result, eax); | 4905 __ StoreToSafepointRegisterSlot(result, eax); |
| 4912 } | 4906 } |
| 4913 | 4907 |
| 4914 | 4908 |
| 4915 void LCodeGen::DoStringAdd(LStringAdd* instr) { | 4909 void LCodeGen::DoStringAdd(LStringAdd* instr) { |
| 4916 ASSERT(ToRegister(instr->context()).is(esi)); | 4910 ASSERT(ToRegister(instr->context()).is(esi)); |
| 4917 if (FLAG_new_string_add) { | 4911 if (FLAG_new_string_add) { |
| 4918 ASSERT(ToRegister(instr->left()).is(edx)); | 4912 ASSERT(ToRegister(instr->left()).is(edx)); |
| 4919 ASSERT(ToRegister(instr->right()).is(eax)); | 4913 ASSERT(ToRegister(instr->right()).is(eax)); |
| 4920 NewStringAddStub stub(instr->hydrogen()->flags(), | 4914 NewStringAddStub stub(instr->hydrogen()->flags(), |
| 4921 isolate()->heap()->GetPretenureMode()); | 4915 instr->hydrogen()->pretenure_flag()); |
| 4922 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 4916 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 4923 } else { | 4917 } else { |
| 4924 EmitPushTaggedOperand(instr->left()); | 4918 EmitPushTaggedOperand(instr->left()); |
| 4925 EmitPushTaggedOperand(instr->right()); | 4919 EmitPushTaggedOperand(instr->right()); |
| 4926 StringAddStub stub(instr->hydrogen()->flags()); | 4920 StringAddStub stub(instr->hydrogen()->flags()); |
| 4927 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 4921 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| 4928 } | 4922 } |
| 4929 } | 4923 } |
| 4930 | 4924 |
| 4931 | 4925 |
| (...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6369 FixedArray::kHeaderSize - kPointerSize)); | 6363 FixedArray::kHeaderSize - kPointerSize)); |
| 6370 __ bind(&done); | 6364 __ bind(&done); |
| 6371 } | 6365 } |
| 6372 | 6366 |
| 6373 | 6367 |
| 6374 #undef __ | 6368 #undef __ |
| 6375 | 6369 |
| 6376 } } // namespace v8::internal | 6370 } } // namespace v8::internal |
| 6377 | 6371 |
| 6378 #endif // V8_TARGET_ARCH_IA32 | 6372 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |