Revision: 23795
Author:   [email protected]
Date:     Tue Sep  9 11:45:53 2014 UTC
Log:      Do not use CodeStub::FindInCache if not necessary.

GetCode does the FindInCache check as well.

[email protected]

Review URL: https://codereview.chromium.org/548313002
https://code.google.com/p/v8/source/detail?r=23795

Modified:
 /branches/bleeding_edge/src/arm/code-stubs-arm.cc
 /branches/bleeding_edge/src/code-stubs.cc
 /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc

=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Mon Sep 8 15:18:54 2014 UTC +++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Tue Sep 9 11:45:53 2014 UTC
@@ -976,20 +976,10 @@


 void CodeStub::GenerateFPStubs(Isolate* isolate) {
+  // Generate if not already in cache.
   SaveFPRegsMode mode = kSaveFPRegs;
-  CEntryStub save_doubles(isolate, 1, mode);
-  StoreBufferOverflowStub stub(isolate, mode);
-  // 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();
-  }
+  CEntryStub(isolate, 1, mode).GetCode();
+  StoreBufferOverflowStub(isolate, mode).GetCode();
   isolate->set_fp_stubs_generated(true);
 }

=======================================
--- /branches/bleeding_edge/src/code-stubs.cc   Mon Sep  8 15:18:54 2014 UTC
+++ /branches/bleeding_edge/src/code-stubs.cc   Tue Sep  9 11:45:53 2014 UTC
@@ -134,9 +134,8 @@
 Handle<Code> CodeStub::GetCode() {
   Heap* heap = isolate()->heap();
   Code* code;
-  if (UseSpecialCache()
-      ? FindCodeInSpecialCache(&code)
-      : FindCodeInCache(&code)) {
+  if (UseSpecialCache() ? FindCodeInSpecialCache(&code)
+                        : FindCodeInCache(&code)) {
     DCHECK(GetCodeKind() == code->kind());
     return Handle<Code>(code);
   }
=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Mon Sep 8 15:18:54 2014 UTC +++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Tue Sep 9 11:45:53 2014 UTC
@@ -2273,13 +2273,8 @@


 void CodeStub::GenerateFPStubs(Isolate* isolate) {
-  CEntryStub save_doubles(isolate, 1, kSaveFPRegs);
- // 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());
-  }
+  // Generate if not already in cache.
+  CEntryStub(isolate, 1, kSaveFPRegs).GetCode();
   isolate->set_fp_stubs_generated(true);
 }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to