Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 7920006: Fix asserts and GC unsafeness in stub generation, bug=1689. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3163 matching lines...) Expand 10 before | Expand all | Expand 10 after
3174 Register scratch) { 3174 Register scratch) {
3175 Isolate* isolate = masm->isolate(); 3175 Isolate* isolate = masm->isolate();
3176 3176
3177 __ push(lr); 3177 __ push(lr);
3178 __ PrepareCallCFunction(0, 1, scratch); 3178 __ PrepareCallCFunction(0, 1, scratch);
3179 if (masm->use_eabi_hardfloat()) { 3179 if (masm->use_eabi_hardfloat()) {
3180 __ vmov(d0, d2); 3180 __ vmov(d0, d2);
3181 } else { 3181 } else {
3182 __ vmov(r0, r1, d2); 3182 __ vmov(r0, r1, d2);
3183 } 3183 }
3184 AllowExternalCallThatCantCauseGC scope(masm);
3184 switch (type_) { 3185 switch (type_) {
3185 case TranscendentalCache::SIN: 3186 case TranscendentalCache::SIN:
3186 __ CallCFunction(ExternalReference::math_sin_double_function(isolate), 3187 __ CallCFunction(ExternalReference::math_sin_double_function(isolate),
3187 0, 1); 3188 0, 1);
3188 break; 3189 break;
3189 case TranscendentalCache::COS: 3190 case TranscendentalCache::COS:
3190 __ CallCFunction(ExternalReference::math_cos_double_function(isolate), 3191 __ CallCFunction(ExternalReference::math_cos_double_function(isolate),
3191 0, 1); 3192 0, 1);
3192 break; 3193 break;
3193 case TranscendentalCache::LOG: 3194 case TranscendentalCache::LOG:
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3327 __ TailCallRuntime(Runtime::kMath_pow_cfunction, 2, 1); 3328 __ TailCallRuntime(Runtime::kMath_pow_cfunction, 2, 1);
3328 } 3329 }
3329 3330
3330 3331
3331 bool CEntryStub::NeedsImmovableCode() { 3332 bool CEntryStub::NeedsImmovableCode() {
3332 return true; 3333 return true;
3333 } 3334 }
3334 3335
3335 3336
3336 bool CEntryStub::CompilingCallsToThisStubIsGCSafe() { 3337 bool CEntryStub::CompilingCallsToThisStubIsGCSafe() {
3337 return !save_doubles_ && result_size_ == 1; 3338 return (!save_doubles_ || ISOLATE->fp_stubs_generated()) &&
3339 result_size_ == 1;
3338 } 3340 }
3339 3341
3340 3342
3341 void CodeStub::GenerateStubsAheadOfTime() { 3343 void CodeStub::GenerateStubsAheadOfTime() {
3342 } 3344 }
3345
3346
3347 void CodeStub::GenerateFPStubs() {
3348 CEntryStub save_doubles(1);
3349 save_doubles.SaveDoubles();
3350 Handle<Code> code = save_doubles.GetCode();
3351 code->GetIsolate()->set_fp_stubs_generated(true);
3352 }
3353
3354
3343 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) { 3355 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
3344 __ Throw(r0); 3356 __ Throw(r0);
3345 } 3357 }
3346 3358
3347 3359
3348 void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm, 3360 void CEntryStub::GenerateThrowUncatchable(MacroAssembler* masm,
3349 UncatchableExceptionType type) { 3361 UncatchableExceptionType type) {
3350 __ ThrowUncatchable(type, r0); 3362 __ ThrowUncatchable(type, r0);
3351 } 3363 }
3352 3364
(...skipping 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after
6726 __ mov(result, Operand::Zero()); 6738 __ mov(result, Operand::Zero());
6727 __ Ret(); 6739 __ Ret();
6728 } 6740 }
6729 6741
6730 6742
6731 #undef __ 6743 #undef __
6732 6744
6733 } } // namespace v8::internal 6745 } } // namespace v8::internal
6734 6746
6735 #endif // V8_TARGET_ARCH_ARM 6747 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698