Commit 8470a778 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Do not use CodeStub::FindInCache if not necessary.

GetCode does the FindInCache check as well.

R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/548313002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23795 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4b0c0760
...@@ -976,20 +976,10 @@ void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { ...@@ -976,20 +976,10 @@ void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
void CodeStub::GenerateFPStubs(Isolate* isolate) { void CodeStub::GenerateFPStubs(Isolate* isolate) {
// Generate if not already in cache.
SaveFPRegsMode mode = kSaveFPRegs; SaveFPRegsMode mode = kSaveFPRegs;
CEntryStub save_doubles(isolate, 1, mode); CEntryStub(isolate, 1, mode).GetCode();
StoreBufferOverflowStub stub(isolate, mode); StoreBufferOverflowStub(isolate, mode).GetCode();
// These stubs might already be in the snapshot, detect that and don't
// regenerate, which would lead to code stub initialization state being messed
// up.
Code* save_doubles_code;
if (!save_doubles.FindCodeInCache(&save_doubles_code)) {
save_doubles_code = *save_doubles.GetCode();
}
Code* store_buffer_overflow_code;
if (!stub.FindCodeInCache(&store_buffer_overflow_code)) {
store_buffer_overflow_code = *stub.GetCode();
}
isolate->set_fp_stubs_generated(true); isolate->set_fp_stubs_generated(true);
} }
......
...@@ -134,8 +134,7 @@ Handle<Code> PlatformCodeStub::GenerateCode() { ...@@ -134,8 +134,7 @@ Handle<Code> PlatformCodeStub::GenerateCode() {
Handle<Code> CodeStub::GetCode() { Handle<Code> CodeStub::GetCode() {
Heap* heap = isolate()->heap(); Heap* heap = isolate()->heap();
Code* code; Code* code;
if (UseSpecialCache() if (UseSpecialCache() ? FindCodeInSpecialCache(&code)
? FindCodeInSpecialCache(&code)
: FindCodeInCache(&code)) { : FindCodeInCache(&code)) {
DCHECK(GetCodeKind() == code->kind()); DCHECK(GetCodeKind() == code->kind());
return Handle<Code>(code); return Handle<Code>(code);
......
...@@ -2273,13 +2273,8 @@ void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { ...@@ -2273,13 +2273,8 @@ void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) {
void CodeStub::GenerateFPStubs(Isolate* isolate) { void CodeStub::GenerateFPStubs(Isolate* isolate) {
CEntryStub save_doubles(isolate, 1, kSaveFPRegs); // Generate if not already in cache.
// Stubs might already be in the snapshot, detect that and don't regenerate, CEntryStub(isolate, 1, kSaveFPRegs).GetCode();
// which would lead to code stub initialization state being messed up.
Code* save_doubles_code;
if (!save_doubles.FindCodeInCache(&save_doubles_code)) {
save_doubles_code = *(save_doubles.GetCode());
}
isolate->set_fp_stubs_generated(true); isolate->set_fp_stubs_generated(true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment