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 3300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3311 | 3311 |
3312 void TranscendentalCacheStub::GenerateCallCFunction(MacroAssembler* masm, | 3312 void TranscendentalCacheStub::GenerateCallCFunction(MacroAssembler* masm, |
3313 Register scratch) { | 3313 Register scratch) { |
3314 __ push(ra); | 3314 __ push(ra); |
3315 __ PrepareCallCFunction(2, scratch); | 3315 __ PrepareCallCFunction(2, scratch); |
3316 if (IsMipsSoftFloatABI) { | 3316 if (IsMipsSoftFloatABI) { |
3317 __ Move(a0, a1, f4); | 3317 __ Move(a0, a1, f4); |
3318 } else { | 3318 } else { |
3319 __ mov_d(f12, f4); | 3319 __ mov_d(f12, f4); |
3320 } | 3320 } |
| 3321 AllowExternalCallThatCantCauseGC scope(masm); |
3321 switch (type_) { | 3322 switch (type_) { |
3322 case TranscendentalCache::SIN: | 3323 case TranscendentalCache::SIN: |
3323 __ CallCFunction( | 3324 __ CallCFunction( |
3324 ExternalReference::math_sin_double_function(masm->isolate()), | 3325 ExternalReference::math_sin_double_function(masm->isolate()), |
3325 0, 1); | 3326 0, 1); |
3326 break; | 3327 break; |
3327 case TranscendentalCache::COS: | 3328 case TranscendentalCache::COS: |
3328 __ CallCFunction( | 3329 __ CallCFunction( |
3329 ExternalReference::math_cos_double_function(masm->isolate()), | 3330 ExternalReference::math_cos_double_function(masm->isolate()), |
3330 0, 1); | 3331 0, 1); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3470 __ TailCallRuntime(Runtime::kMath_pow_cfunction, 2, 1); | 3471 __ TailCallRuntime(Runtime::kMath_pow_cfunction, 2, 1); |
3471 } | 3472 } |
3472 | 3473 |
3473 | 3474 |
3474 bool CEntryStub::NeedsImmovableCode() { | 3475 bool CEntryStub::NeedsImmovableCode() { |
3475 return true; | 3476 return true; |
3476 } | 3477 } |
3477 | 3478 |
3478 | 3479 |
3479 bool CEntryStub::CompilingCallsToThisStubIsGCSafe() { | 3480 bool CEntryStub::CompilingCallsToThisStubIsGCSafe() { |
3480 return !save_doubles_ && result_size_ == 1; | 3481 return (!save_doubles_ || ISOLATE->fp_stubs_generated()) && |
| 3482 result_size_ == 1; |
3481 } | 3483 } |
3482 | 3484 |
3483 | 3485 |
3484 void CodeStub::GenerateStubsAheadOfTime() { | 3486 void CodeStub::GenerateStubsAheadOfTime() { |
3485 } | 3487 } |
3486 | 3488 |
3487 | 3489 |
| 3490 void CodeStub::GenerateFPStubs() { |
| 3491 CEntryStub save_doubles(1); |
| 3492 save_doubles.SaveDoubles(); |
| 3493 Handle<Code> code = save_doubles.GetCode(); |
| 3494 code->GetIsolate()->set_fp_stubs_generated(true); |
| 3495 } |
| 3496 |
| 3497 |
3488 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { | 3498 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { |
3489 __ Throw(v0); | 3499 __ Throw(v0); |
3490 } | 3500 } |
3491 | 3501 |
3492 | 3502 |
3493 void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm, | 3503 void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm, |
3494 UncatchableExceptionType type) { | 3504 UncatchableExceptionType type) { |
3495 __ ThrowUncatchable(type, v0); | 3505 __ ThrowUncatchable(type, v0); |
3496 } | 3506 } |
3497 | 3507 |
(...skipping 3499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6997 __ mov(result, zero_reg); | 7007 __ mov(result, zero_reg); |
6998 __ Ret(); | 7008 __ Ret(); |
6999 } | 7009 } |
7000 | 7010 |
7001 | 7011 |
7002 #undef __ | 7012 #undef __ |
7003 | 7013 |
7004 } } // namespace v8::internal | 7014 } } // namespace v8::internal |
7005 | 7015 |
7006 #endif // V8_TARGET_ARCH_MIPS | 7016 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |