Revision: 9466
Author:   [email protected]
Date:     Wed Sep 28 05:23:40 2011
Log:      Move the is_pregenerated flag so it does not overlap other flags.
Remove the before-or-after InstanceOf stub rule, which was too
subtle and lacked checking ssertions.
Unify the way the CEntry stub is pregenerated so that it is done
in the same way.
Review URL: http://codereview.chromium.org/8065006
http://code.google.com/p/v8/source/detail?r=9466

Modified:
 /branches/bleeding_edge/src/arm/code-stubs-arm.cc
 /branches/bleeding_edge/src/code-stubs.cc
 /branches/bleeding_edge/src/code-stubs.h
 /branches/bleeding_edge/src/heap.cc
 /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/src/x64/code-stubs-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/code-stubs-arm.cc Wed Sep 28 04:00:41 2011 +++ /branches/bleeding_edge/src/arm/code-stubs-arm.cc Wed Sep 28 05:23:40 2011
@@ -3405,6 +3405,7 @@


 void CodeStub::GenerateStubsAheadOfTime() {
+  CEntryStub::GenerateAheadOfTime();
   WriteInt32ToHeapNumberStub::GenerateFixedRegStubsAheadOfTime();
   StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime();
   RecordWriteStub::GenerateFixedRegStubsAheadOfTime();
@@ -3417,6 +3418,13 @@
   code->set_is_pregenerated(true);
   code->GetIsolate()->set_fp_stubs_generated(true);
 }
+
+
+void CEntryStub::GenerateAheadOfTime() {
+  CEntryStub stub(1, kDontSaveFPRegs);
+  Handle<Code> code = stub.GetCode();
+  code->set_is_pregenerated(true);
+}


 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/code-stubs.cc   Tue Sep 27 04:42:02 2011
+++ /branches/bleeding_edge/src/code-stubs.cc   Wed Sep 28 05:23:40 2011
@@ -130,6 +130,8 @@
     heap->public_set_code_stubs(*dict);
     code = *new_object;
     Activate(code);
+  } else {
+    ASSERT(IsPregenerated() == code->is_pregenerated());
   }

   ASSERT(!NeedsImmovableCode() || heap->lo_space()->Contains(code));
=======================================
--- /branches/bleeding_edge/src/code-stubs.h    Tue Sep 27 04:42:02 2011
+++ /branches/bleeding_edge/src/code-stubs.h    Wed Sep 28 05:23:40 2011
@@ -50,13 +50,6 @@
   V(RegExpExec)                          \
   V(TranscendentalCache)                 \
   V(Instanceof)                          \
- /* All stubs above this line only exist in a few versions, which are */ \ - /* generated ahead of time. Therefore compiling a call to one of */ \ - /* them can't cause a new stub to be compiled, so compiling a call to */ \ - /* them is GC safe. The ones below this line exist in many variants */ \ - /* so code compiling a call to one can cause a GC. This means they */ \ - /* can't be called from other stubs, since stub generation code is */ \ - /* not GC safe. */ \
   V(ConvertToDouble)                     \
   V(WriteInt32ToHeapNumber)              \
   V(StackCheck)                          \
@@ -154,9 +147,7 @@
   }

   // See comment above, where Instanceof is defined.
-  virtual bool IsPregenerated() {
-    return MajorKey() <= Instanceof;
-  }
+  virtual bool IsPregenerated() { return false; }

   static void GenerateStubsAheadOfTime();
   static void GenerateFPStubs();
@@ -574,6 +565,7 @@
// their code generation. On machines that always have gp registers (x64) we
   // can generate both variants ahead of time.
   virtual bool IsPregenerated();
+  static void GenerateAheadOfTime();

  private:
   void GenerateCore(MacroAssembler* masm,
=======================================
--- /branches/bleeding_edge/src/heap.cc Mon Sep 26 04:14:41 2011
+++ /branches/bleeding_edge/src/heap.cc Wed Sep 28 05:23:40 2011
@@ -2170,9 +2170,6 @@
   // create them if we need them during the creation of another stub.
   // Stub creation mixes raw pointers and handles in an unsafe manner so
   // we cannot create stubs while we are creating stubs.
-  CEntryStub ces(1);
-  ces.GetCode();
-
   CodeStub::GenerateStubsAheadOfTime();
 }

=======================================
--- /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Wed Sep 28 03:32:12 2011 +++ /branches/bleeding_edge/src/ia32/code-stubs-ia32.cc Wed Sep 28 05:23:40 2011
@@ -4415,6 +4415,7 @@


 void CodeStub::GenerateStubsAheadOfTime() {
+  CEntryStub::GenerateAheadOfTime();
   StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime();
// It is important that the store buffer overflow stubs are generated first.
   RecordWriteStub::GenerateFixedRegStubsAheadOfTime();
@@ -4427,6 +4428,13 @@
   code->set_is_pregenerated(true);
   code->GetIsolate()->set_fp_stubs_generated(true);
 }
+
+
+void CEntryStub::GenerateAheadOfTime() {
+  CEntryStub stub(1, kDontSaveFPRegs);
+  Handle<Code> code = stub.GetCode();
+  code->set_is_pregenerated(true);
+}


 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
=======================================
--- /branches/bleeding_edge/src/objects.h       Wed Sep 28 03:32:12 2011
+++ /branches/bleeding_edge/src/objects.h       Wed Sep 28 05:23:40 2011
@@ -3888,7 +3888,7 @@
   class IsPregeneratedField: public BitField<bool, 14, 1> {};

   // Signed field cannot be encoded using the BitField class.
-  static const int kArgumentsCountShift = 14;
+  static const int kArgumentsCountShift = 15;
static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1);

   static const int kFlagsNotUsedInLookup =
=======================================
--- /branches/bleeding_edge/src/x64/code-stubs-x64.cc Wed Sep 28 03:32:12 2011 +++ /branches/bleeding_edge/src/x64/code-stubs-x64.cc Wed Sep 28 05:23:40 2011
@@ -3370,13 +3370,16 @@


 bool CEntryStub::IsPregenerated() {
+#ifdef _WIN64
   return result_size_ == 1;
+#else
+  return true;
+#endif
 }


 void CodeStub::GenerateStubsAheadOfTime() {
-  CEntryStub save_doubles(1, kSaveFPRegs);
-  save_doubles.GetCode()->set_is_pregenerated(true);
+  CEntryStub::GenerateAheadOfTime();
   StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime();
// It is important that the store buffer overflow stubs are generated first.
   RecordWriteStub::GenerateFixedRegStubsAheadOfTime();
@@ -3385,6 +3388,14 @@

 void CodeStub::GenerateFPStubs() {
 }
+
+
+void CEntryStub::GenerateAheadOfTime() {
+  CEntryStub stub(1, kDontSaveFPRegs);
+  stub.GetCode()->set_is_pregenerated(true);
+  CEntryStub save_doubles(1, kSaveFPRegs);
+  save_doubles.GetCode()->set_is_pregenerated(true);
+}


 void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to