Revision: 4781
Author: lukezarko
Date: Wed Jun  2 02:13:42 2010
Log: - Continue removing [static] qualifier from StubCache.

Review URL: http://codereview.chromium.org/2493001
http://code.google.com/p/v8/source/detail?r=4781

Modified:
 /branches/experimental/isolates/src/arm/ic-arm.cc
 /branches/experimental/isolates/src/codegen.cc
 /branches/experimental/isolates/src/handles.cc
 /branches/experimental/isolates/src/ia32/ic-ia32.cc
 /branches/experimental/isolates/src/ic.cc
 /branches/experimental/isolates/src/isolate.h
 /branches/experimental/isolates/src/stub-cache.h
 /branches/experimental/isolates/src/x64/ic-x64.cc

=======================================
--- /branches/experimental/isolates/src/arm/ic-arm.cc Tue Jun 1 03:51:42 2010 +++ /branches/experimental/isolates/src/arm/ic-arm.cc Wed Jun 2 02:13:42 2010
@@ -300,7 +300,8 @@
   // Probe the stub cache.
   Code::Flags flags =
Code::ComputeFlags(Code::CALL_IC, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc);
-  StubCache::GenerateProbe(masm, flags, r1, r2, r3, no_reg);
+  Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, r1, r2, r3,
+                                                  no_reg);

   // If the stub cache probing failed, the receiver might be a value.
   // For value objects, we use the map of the prototype objects for
@@ -339,7 +340,8 @@

   // Probe the stub cache for the value object.
   __ bind(&probe);
-  StubCache::GenerateProbe(masm, flags, r1, r2, r3, no_reg);
+  Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, r1, r2, r3,
+                                                  no_reg);

   // Cache miss: Jump to runtime.
   __ bind(&miss);
@@ -497,7 +499,8 @@
   Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC,
                                          NOT_IN_LOOP,
                                          MONOMORPHIC);
-  StubCache::GenerateProbe(masm, flags, r0, r2, r3, no_reg);
+  Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, r0, r2, r3,
+                                                  no_reg);

   // Cache miss: Jump to runtime.
   GenerateMiss(masm);
@@ -1737,7 +1740,8 @@
   Code::Flags flags = Code::ComputeFlags(Code::STORE_IC,
                                          NOT_IN_LOOP,
                                          MONOMORPHIC);
-  StubCache::GenerateProbe(masm, flags, r1, r2, r3, no_reg);
+  Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, r1, r2, r3,
+                                                  no_reg);

   // Cache miss: Jump to runtime.
   GenerateMiss(masm);
=======================================
--- /branches/experimental/isolates/src/codegen.cc      Wed Apr 28 04:38:43 2010
+++ /branches/experimental/isolates/src/codegen.cc      Wed Jun  2 02:13:42 2010
@@ -254,7 +254,9 @@
     // that it needs so we need to ensure it is generated already.
     ComputeCallInitialize(argc, NOT_IN_LOOP);
   }
- CALL_HEAP_FUNCTION(StubCache::ComputeCallInitialize(argc, in_loop), Code);
+  CALL_HEAP_FUNCTION(
+ Isolate::Current()->stub_cache()->ComputeCallInitialize(argc, in_loop),
+      Code);
 }


=======================================
--- /branches/experimental/isolates/src/handles.cc      Tue Jun  1 03:51:42 2010
+++ /branches/experimental/isolates/src/handles.cc      Wed Jun  2 02:13:42 2010
@@ -796,7 +796,8 @@


 Handle<Code> ComputeLazyCompile(int argc) {
-  CALL_HEAP_FUNCTION(StubCache::ComputeLazyCompile(argc), Code);
+ CALL_HEAP_FUNCTION(Isolate::Current()->stub_cache()->ComputeLazyCompile(argc),
+                     Code);
 }


=======================================
--- /branches/experimental/isolates/src/ia32/ic-ia32.cc Tue Jun 1 03:51:42 2010 +++ /branches/experimental/isolates/src/ia32/ic-ia32.cc Wed Jun 2 02:13:42 2010
@@ -1054,7 +1054,8 @@
   // Probe the stub cache.
   Code::Flags flags =
Code::ComputeFlags(Code::CALL_IC, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc);
-  StubCache::GenerateProbe(masm, flags, edx, ecx, ebx, eax);
+ Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, edx, ecx, ebx,
+                                                  eax);

   // If the stub cache probing failed, the receiver might be a value.
   // For value objects, we use the map of the prototype objects for
@@ -1091,7 +1092,8 @@

   // Probe the stub cache for the value object.
   __ bind(&probe);
-  StubCache::GenerateProbe(masm, flags, edx, ecx, ebx, no_reg);
+ Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, edx, ecx, ebx,
+                                                  no_reg);

   // Cache miss: Jump to runtime.
   __ bind(&miss);
@@ -1267,7 +1269,8 @@
   Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC,
                                          NOT_IN_LOOP,
                                          MONOMORPHIC);
-  StubCache::GenerateProbe(masm, flags, eax, ecx, ebx, edx);
+ Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, eax, ecx, ebx,
+                                                  edx);

   // Cache miss: Jump to runtime.
   GenerateMiss(masm);
@@ -1490,7 +1493,8 @@
   Code::Flags flags = Code::ComputeFlags(Code::STORE_IC,
                                          NOT_IN_LOOP,
                                          MONOMORPHIC);
-  StubCache::GenerateProbe(masm, flags, edx, ecx, ebx, no_reg);
+ Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, edx, ecx, ebx,
+                                                  no_reg);

   // Cache miss: Jump to runtime.
   GenerateMiss(masm);
=======================================
--- /branches/experimental/isolates/src/ic.cc   Wed Jun  2 00:51:31 2010
+++ /branches/experimental/isolates/src/ic.cc   Wed Jun  2 02:13:42 2010
@@ -499,7 +499,8 @@
     // This is the first time we execute this inline cache.
     // Set the target to the pre monomorphic stub to delay
     // setting the monomorphic state.
-    code = StubCache::ComputeCallPreMonomorphic(argc, in_loop);
+ code = Isolate::Current()->stub_cache()->ComputeCallPreMonomorphic(argc, + in_loop);
   } else if (state == MONOMORPHIC) {
     code = Isolate::Current()->stub_cache()->ComputeCallMegamorphic(argc,
in_loop);
@@ -624,7 +625,7 @@
       Code* target = NULL;
       target = Builtins::builtin(Builtins::LoadIC_StringLength);
       set_target(target);
-      StubCache::Set(*name, map, target);
+      Isolate::Current()->stub_cache()->Set(*name, map, target);
       return Smi::FromInt(String::cast(*object)->length());
     }

@@ -639,7 +640,7 @@

       Code* target = Builtins::builtin(Builtins::LoadIC_ArrayLength);
       set_target(target);
-      StubCache::Set(*name, map, target);
+      Isolate::Current()->stub_cache()->Set(*name, map, target);
       return JSArray::cast(*object)->length();
     }

@@ -651,7 +652,9 @@
 #endif
       Code* target = Builtins::builtin(Builtins::LoadIC_FunctionPrototype);
       set_target(target);
-      StubCache::Set(*name, HeapObject::cast(*object)->map(), target);
+      Isolate::Current()->stub_cache()->Set(*name,
+ HeapObject::cast(*object)->map(),
+                                            target);
       return Accessors::FunctionGetPrototype(*object, 0);
     }
   }
@@ -1110,7 +1113,9 @@
 #endif
     Code* target = Builtins::builtin(Builtins::StoreIC_ArrayLength);
     set_target(target);
-    StubCache::Set(*name, HeapObject::cast(*object)->map(), target);
+    Isolate::Current()->stub_cache()->Set(*name,
+                                          HeapObject::cast(*object)->map(),
+                                          target);
     return receiver->SetProperty(*name, *value, NONE);
   }

=======================================
--- /branches/experimental/isolates/src/isolate.h       Tue Jun  1 08:39:14 2010
+++ /branches/experimental/isolates/src/isolate.h       Wed Jun  2 02:13:42 2010
@@ -77,6 +77,11 @@
 #define HEAP (v8::internal::Isolate::Current()->heap())


+// Temporary macro to be used to flag definitions that are indeed static
+// and not per-isolate. (It would be great to be able to grep for [static]!)
+#define RLYSTC static
+
+
 } }  // namespace v8::internal

 #endif  // V8_ISOLATE_H_
=======================================
--- /branches/experimental/isolates/src/stub-cache.h Wed Jun 2 00:51:31 2010 +++ /branches/experimental/isolates/src/stub-cache.h Wed Jun 2 02:13:42 2010
@@ -174,8 +174,8 @@

   // ---

-  static Object* ComputeCallInitialize(int argc, InLoopFlag in_loop);
-  static Object* ComputeCallPreMonomorphic(int argc, InLoopFlag in_loop);
+  Object* ComputeCallInitialize(int argc, InLoopFlag in_loop);
+  Object* ComputeCallPreMonomorphic(int argc, InLoopFlag in_loop);
   Object* ComputeCallNormal(int argc, InLoopFlag in_loop);
   Object* ComputeCallMegamorphic(int argc, InLoopFlag in_loop);
   Object* ComputeCallMiss(int argc);
@@ -188,26 +188,26 @@
   Object* ComputeCallDebugPrepareStepIn(int argc);
 #endif

-  static Object* ComputeLazyCompile(int argc);
+  Object* ComputeLazyCompile(int argc);


   // Update cache for entry hash(name, map).
-  static Code* Set(String* name, Map* map, Code* code);
+  Code* Set(String* name, Map* map, Code* code);

   // Clear the lookup table (@ mark compact collection).
   void Clear();

   // Functions for generating stubs at startup.
-  static void GenerateMiss(MacroAssembler* masm);
+  void GenerateMiss(MacroAssembler* masm);

   // Generate code for probing the stub cache table.
   // If extra != no_reg it might be used as am extra scratch register.
-  static void GenerateProbe(MacroAssembler* masm,
-                            Code::Flags flags,
-                            Register receiver,
-                            Register name,
-                            Register scratch,
-                            Register extra);
+  void GenerateProbe(MacroAssembler* masm,
+                     Code::Flags flags,
+                     Register receiver,
+                     Register name,
+                     Register scratch,
+                     Register extra);

   enum Table {
     kPrimary,
@@ -225,7 +225,7 @@
   static Entry secondary_[];

   // Computes the hashed offsets for primary and secondary caches.
-  static int PrimaryOffset(String* name, Code::Flags flags, Map* map) {
+  RLYSTC int PrimaryOffset(String* name, Code::Flags flags, Map* map) {
     // This works well because the heap object tag size and the hash
     // shift are equal.  Shifting down the length field to get the
     // hash code would effectively throw away two bits of the hash
@@ -248,7 +248,7 @@
     return key & ((kPrimaryTableSize - 1) << kHeapObjectTagSize);
   }

-  static int SecondaryOffset(String* name, Code::Flags flags, int seed) {
+  RLYSTC int SecondaryOffset(String* name, Code::Flags flags, int seed) {
     // Use the seed from the primary cache in the secondary cache.
     uint32_t string_low32bits =
         static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name));
@@ -265,7 +265,7 @@
   // ends in String::kHashShift 0s.  Then we shift it so it is a multiple
   // of sizeof(Entry).  This makes it easier to avoid making mistakes
   // in the hashed offset computations.
-  static Entry* entry(Entry* table, int offset) {
+  RLYSTC Entry* entry(Entry* table, int offset) {
     const int shift_amount = kPointerSizeLog2 + 1 - String::kHashShift;
     return reinterpret_cast<Entry*>(
         reinterpret_cast<Address>(table) + (offset << shift_amount));
=======================================
--- /branches/experimental/isolates/src/x64/ic-x64.cc Tue Jun 1 03:51:42 2010 +++ /branches/experimental/isolates/src/x64/ic-x64.cc Wed Jun 2 02:13:42 2010
@@ -1172,7 +1172,8 @@
   // Probe the stub cache.
   Code::Flags flags =
Code::ComputeFlags(Code::CALL_IC, NOT_IN_LOOP, MONOMORPHIC, NORMAL, argc);
-  StubCache::GenerateProbe(masm, flags, rdx, rcx, rbx, rax);
+ Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx,
+                                                  rax);

   // If the stub cache probing failed, the receiver might be a value.
   // For value objects, we use the map of the prototype objects for
@@ -1208,7 +1209,8 @@

   // Probe the stub cache for the value object.
   __ bind(&probe);
-  StubCache::GenerateProbe(masm, flags, rdx, rcx, rbx, no_reg);
+ Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx,
+                                                  no_reg);

   // Cache miss: Jump to runtime.
   __ bind(&miss);
@@ -1391,7 +1393,8 @@
   Code::Flags flags = Code::ComputeFlags(Code::LOAD_IC,
                                          NOT_IN_LOOP,
                                          MONOMORPHIC);
-  StubCache::GenerateProbe(masm, flags, rax, rcx, rbx, rdx);
+ Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rax, rcx, rbx,
+                                                  rdx);

   // Cache miss: Jump to runtime.
   StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC);
@@ -1516,7 +1519,8 @@
   Code::Flags flags = Code::ComputeFlags(Code::STORE_IC,
                                          NOT_IN_LOOP,
                                          MONOMORPHIC);
-  StubCache::GenerateProbe(masm, flags, rdx, rcx, rbx, no_reg);
+ Isolate::Current()->stub_cache()->GenerateProbe(masm, flags, rdx, rcx, rbx,
+                                                  no_reg);

   // Cache miss: Jump to runtime.
   GenerateMiss(masm);

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

Reply via email to