Revision: 4955
Author: lukezarko
Date: Fri Jun 25 13:52:32 2010
Log: [Isolates] Remove even more statics.

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

Modified:
 /branches/experimental/isolates/src/arm/codegen-arm.cc
 /branches/experimental/isolates/src/assembler.cc
 /branches/experimental/isolates/src/execution.cc
 /branches/experimental/isolates/src/ia32/codegen-ia32.cc
 /branches/experimental/isolates/src/ia32/disasm-ia32.cc
 /branches/experimental/isolates/src/isolate.h
 /branches/experimental/isolates/src/jsregexp.cc
 /branches/experimental/isolates/src/jsregexp.h
 /branches/experimental/isolates/src/objects-inl.h
 /branches/experimental/isolates/src/objects.cc
 /branches/experimental/isolates/src/objects.h
 /branches/experimental/isolates/src/profile-generator-inl.h
 /branches/experimental/isolates/src/profile-generator.cc
 /branches/experimental/isolates/src/profile-generator.h
 /branches/experimental/isolates/src/x64/codegen-x64.cc
 /branches/experimental/isolates/src/x64/disasm-x64.cc

=======================================
--- /branches/experimental/isolates/src/arm/codegen-arm.cc Wed Jun 23 09:21:33 2010 +++ /branches/experimental/isolates/src/arm/codegen-arm.cc Fri Jun 25 13:52:32 2010
@@ -9247,7 +9247,7 @@
   ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
   __ add(r2, r2, Operand(2));  // r2 was a smi.
   // Check that the static offsets vector buffer is large enough.
-  __ cmp(r2, Operand(OffsetsVector::kStaticOffsetsVectorSize));
+  __ cmp(r2, Operand(Isolate::kJSRegexpStaticOffsetsVectorSize));
   __ b(hi, &runtime);

   // r2: Number of capture registers
=======================================
--- /branches/experimental/isolates/src/assembler.cc Mon Jun 21 10:40:11 2010 +++ /branches/experimental/isolates/src/assembler.cc Fri Jun 25 13:52:32 2010
@@ -710,7 +710,8 @@
 }

 ExternalReference ExternalReference::address_of_static_offsets_vector() {
-  return ExternalReference(OffsetsVector::static_offsets_vector_address());
+  return ExternalReference(OffsetsVector::static_offsets_vector_address(
+      Isolate::Current()));
 }

ExternalReference ExternalReference::address_of_regexp_stack_memory_address() {
=======================================
--- /branches/experimental/isolates/src/execution.cc Thu Jun 24 09:41:05 2010 +++ /branches/experimental/isolates/src/execution.cc Fri Jun 25 13:52:32 2010
@@ -368,15 +368,11 @@
   isolate_->heap()->SetStackLimits();
   return from + sizeof(ThreadLocal);
 }
-
-
-static internal::Thread::LocalStorageKey stack_limit_key =
-    internal::Thread::CreateThreadLocalKey();


 void StackGuard::FreeThreadResources() {
   Thread::SetThreadLocal(
-      stack_limit_key,
+      stack_limit_key_,
       reinterpret_cast<void*>(thread_local_.real_climit_));
 }

@@ -420,7 +416,7 @@

 void StackGuard::InitThread(const ExecutionAccess& lock) {
   if (thread_local_.Initialize()) isolate_->heap()->SetStackLimits();
-  void* stored_limit = Thread::GetThreadLocal(stack_limit_key);
+  void* stored_limit = Thread::GetThreadLocal(stack_limit_key_);
   // You should hold the ExecutionAccess lock when you call this.
   if (stored_limit != NULL) {
     StackGuard::SetStackLimit(reinterpret_cast<intptr_t>(stored_limit));
=======================================
--- /branches/experimental/isolates/src/ia32/codegen-ia32.cc Wed Jun 23 09:21:33 2010 +++ /branches/experimental/isolates/src/ia32/codegen-ia32.cc Fri Jun 25 13:52:32 2010
@@ -11274,7 +11274,7 @@
   ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
   __ add(Operand(edx), Immediate(2));  // edx was a smi.
   // Check that the static offsets vector buffer is large enough.
-  __ cmp(edx, OffsetsVector::kStaticOffsetsVectorSize);
+  __ cmp(edx, Isolate::kJSRegexpStaticOffsetsVectorSize);
   __ j(above, &runtime);

   // ecx: RegExp data (FixedArray)
=======================================
--- /branches/experimental/isolates/src/ia32/disasm-ia32.cc Wed Jun 16 08:56:49 2010 +++ /branches/experimental/isolates/src/ia32/disasm-ia32.cc Fri Jun 25 13:52:32 2010
@@ -242,7 +242,6 @@
 }


-// TODO(isolates): This appears to act morally as a constant. Is it safe?
 static InstructionTable instruction_table;


=======================================
--- /branches/experimental/isolates/src/isolate.h       Fri Jun 25 11:24:19 2010
+++ /branches/experimental/isolates/src/isolate.h       Fri Jun 25 13:52:32 2010
@@ -177,7 +177,8 @@

#define ISOLATE_INIT_ARRAY_LIST(V) \ /* SerializerDeserializer state. */ \ - V(Object*, serialize_partial_snapshot_cache, kPartialSnapshotCacheCapacity) + V(Object*, serialize_partial_snapshot_cache, kPartialSnapshotCacheCapacity) \
+  V(int, jsregexp_static_offsets_vector, kJSRegexpStaticOffsetsVectorSize)

#define ISOLATE_INIT_LIST(V) \ /* AssertNoZoneAllocation state. */ \
@@ -194,6 +195,10 @@
/* To distinguish the function templates, so that we can find them in the */ \ /* function cache of the global context. */ \ V(int, next_serial_number, 0) \ + /* State for Relocatable. */ \ + V(Relocatable*, relocatable_top, NULL) \ + /* State for CodeEntry in profile-generator. */ \ + V(unsigned, code_entry_next_call_uid, NULL) \
   ISOLATE_PLATFORM_INIT_LIST(V)

 class Isolate {
@@ -528,6 +533,26 @@
   }

   StringTracker* string_tracker() { return string_tracker_; }
+
+ unibrow::Mapping<unibrow::Ecma262UnCanonicalize>* jsregexp_uncanonicalize() {
+    return &jsregexp_uncanonicalize_;
+  }
+
+  unibrow::Mapping<unibrow::CanonicalizationRange>* jsregexp_canonrange() {
+    return &jsregexp_canonrange_;
+  }
+
+  StringInputBuffer* objects_string_compare_buffer_a() {
+    return &objects_string_compare_buffer_a_;
+  }
+
+  StringInputBuffer* objects_string_compare_buffer_b() {
+    return &objects_string_compare_buffer_b_;
+  }
+
+  StaticResource<StringInputBuffer>* objects_string_input_buffer() {
+    return &objects_string_input_buffer_;
+  }

   void* PreallocatedStorageNew(size_t size);
   void PreallocatedStorageDelete(void* p);
@@ -552,6 +577,8 @@
   // SerializerDeserializer state.
   static const int kPartialSnapshotCacheCapacity = 1300;

+  static const int kJSRegexpStaticOffsetsVectorSize = 50;
+
   static int number_of_isolates() { return number_of_isolates_; }

// Initialize process-wide state. Generally called from a static initializer,
@@ -629,6 +656,11 @@
   ContextSwitcher* context_switcher_;
   ThreadManager* thread_manager_;
   StringTracker* string_tracker_;
+ unibrow::Mapping<unibrow::Ecma262UnCanonicalize> jsregexp_uncanonicalize_;
+  unibrow::Mapping<unibrow::CanonicalizationRange> jsregexp_canonrange_;
+  StringInputBuffer objects_string_compare_buffer_a_;
+  StringInputBuffer objects_string_compare_buffer_b_;
+  StaticResource<StringInputBuffer> objects_string_input_buffer_;

 #ifdef DEBUG
   // A static array of histogram info for each type.
=======================================
--- /branches/experimental/isolates/src/jsregexp.cc     Mon Jun 21 10:40:11 2010
+++ /branches/experimental/isolates/src/jsregexp.cc     Fri Jun 25 13:52:32 2010
@@ -1246,18 +1246,16 @@
       break;
   }
 }
-
-
-static unibrow::Mapping<unibrow::Ecma262UnCanonicalize> uncanonicalize;
-static unibrow::Mapping<unibrow::CanonicalizationRange> canonrange;


// Returns the number of characters in the equivalence class, omitting those
 // that cannot occur in the source string because it is ASCII.
-static int GetCaseIndependentLetters(uc16 character,
+static int GetCaseIndependentLetters(Isolate* isolate,
+                                     uc16 character,
                                      bool ascii_subject,
                                      unibrow::uchar* letters) {
-  int length = uncanonicalize.get(character, '\0', letters);
+  int length =
+      isolate->jsregexp_uncanonicalize()->get(character, '\0', letters);
   // Unibrow returns 0 or 1 for characters where case independependence is
   // trivial.
   if (length == 0) {
@@ -1273,7 +1271,8 @@
 }


-static inline bool EmitSimpleCharacter(RegExpCompiler* compiler,
+static inline bool EmitSimpleCharacter(Isolate* isolate,
+                                       RegExpCompiler* compiler,
                                        uc16 c,
                                        Label* on_failure,
                                        int cp_offset,
@@ -1295,7 +1294,8 @@

// Only emits non-letters (things that don't have case). Only used for case
 // independent matches.
-static inline bool EmitAtomNonLetter(RegExpCompiler* compiler,
+static inline bool EmitAtomNonLetter(Isolate* isolate,
+                                     RegExpCompiler* compiler,
                                      uc16 c,
                                      Label* on_failure,
                                      int cp_offset,
@@ -1304,7 +1304,7 @@
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
   bool ascii = compiler->ascii();
   unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-  int length = GetCaseIndependentLetters(c, ascii, chars);
+  int length = GetCaseIndependentLetters(isolate, c, ascii, chars);
   if (length < 1) {
// This can't match. Must be an ASCII subject and a non-ASCII character. // We do not need to do anything since the ASCII pass already handled this.
@@ -1366,7 +1366,8 @@
 }


-typedef bool EmitCharacterFunction(RegExpCompiler* compiler,
+typedef bool EmitCharacterFunction(Isolate* isolate,
+                                   RegExpCompiler* compiler,
                                    uc16 c,
                                    Label* on_failure,
                                    int cp_offset,
@@ -1375,7 +1376,8 @@

// Only emits letters (things that have case). Only used for case independent
 // matches.
-static inline bool EmitAtomLetter(RegExpCompiler* compiler,
+static inline bool EmitAtomLetter(Isolate* isolate,
+                                  RegExpCompiler* compiler,
                                   uc16 c,
                                   Label* on_failure,
                                   int cp_offset,
@@ -1384,7 +1386,7 @@
   RegExpMacroAssembler* macro_assembler = compiler->macro_assembler();
   bool ascii = compiler->ascii();
   unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
-  int length = GetCaseIndependentLetters(c, ascii, chars);
+  int length = GetCaseIndependentLetters(isolate, c, ascii, chars);
   if (length <= 1) return false;
   // We may not need to check against the end of the input string
   // if this character lies before a character that matched.
@@ -1785,6 +1787,7 @@
                                     RegExpCompiler* compiler,
                                     int characters_filled_in,
                                     bool not_at_start) {
+  Isolate* isolate = Isolate::Current();
   ASSERT(characters_filled_in < details->characters());
   int characters = details->characters();
   int char_mask;
@@ -1815,7 +1818,8 @@
         }
         if (compiler->ignore_case()) {
           unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
- int length = GetCaseIndependentLetters(c, compiler->ascii(), chars); + int length = GetCaseIndependentLetters(isolate, c, compiler->ascii(),
+                                                 chars);
ASSERT(length != 0); // Can only happen if c > char_mask (see above).
           if (length == 1) {
             // This letter has no case equivalents, so it's nice and simple
@@ -2315,6 +2319,7 @@
                             Trace* trace,
                             bool first_element_checked,
                             int* checked_up_to) {
+  Isolate* isolate = Isolate::Current();
   RegExpMacroAssembler* assembler = compiler->macro_assembler();
   bool ascii = compiler->ascii();
   Label* backtrack = trace->backtrack();
@@ -2350,7 +2355,8 @@
             break;
         }
         if (emit_function != NULL) {
-          bool bound_checked = emit_function(compiler,
+          bool bound_checked = emit_function(isolate,
+                                             compiler,
                                              quarks[j],
                                              backtrack,
                                              cp_offset + j,
@@ -3987,13 +3993,15 @@
 }


-static void AddUncanonicals(ZoneList<CharacterRange>* ranges,
+static void AddUncanonicals(Isolate* isolate,
+                            ZoneList<CharacterRange>* ranges,
                             int bottom,
                             int top);


 void CharacterRange::AddCaseEquivalents(ZoneList<CharacterRange>* ranges,
                                         bool is_ascii) {
+  Isolate* isolate = Isolate::Current();
   uc16 bottom = from();
   uc16 top = to();
   if (is_ascii) {
@@ -4003,7 +4011,7 @@
   unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
   if (top == bottom) {
     // If this is a singleton we just expand the one character.
-    int length = uncanonicalize.get(bottom, '\0', chars);
+ int length = isolate->jsregexp_uncanonicalize()->get(bottom, '\0', chars);
     for (int i = 0; i < length; i++) {
       uc32 chr = chars[i];
       if (chr != bottom) {
@@ -4031,7 +4039,7 @@
     // covered by the range.
     unibrow::uchar range[unibrow::Ecma262UnCanonicalize::kMaxWidth];
     // First, look up the block that contains the 'bottom' character.
-    int length = canonrange.get(bottom, '\0', range);
+    int length = isolate->jsregexp_canonrange()->get(bottom, '\0', range);
     if (length == 0) {
       range[0] = bottom;
     } else {
@@ -4052,7 +4060,7 @@
     // position to be after the last block each time.  The position
     // always points to the start of a block.
     while (pos < top) {
-      length = canonrange.get(start, '\0', range);
+      length = isolate->jsregexp_canonrange()->get(start, '\0', range);
       if (length == 0) {
         range[0] = start;
       } else {
@@ -4063,7 +4071,7 @@
       // of the range.
       int block_end = start + (range[0] & kPayloadMask) - 1;
       int end = (block_end > top) ? top : block_end;
-      length = uncanonicalize.get(start, '\0', range);
+      length = isolate->jsregexp_uncanonicalize()->get(start, '\0', range);
       for (int i = 0; i < length; i++) {
         uc32 c = range[i];
         uc16 range_from = c + (pos - start);
@@ -4077,7 +4085,7 @@
   } else {
     // Unibrow ranges don't work for high characters due to the "2^11 bug".
     // Therefore we do something dumber for these ranges.
-    AddUncanonicals(ranges, bottom, top);
+    AddUncanonicals(isolate, ranges, bottom, top);
   }
 }

@@ -4177,7 +4185,8 @@
 }


-static void AddUncanonicals(ZoneList<CharacterRange>* ranges,
+static void AddUncanonicals(Isolate* isolate,
+                            ZoneList<CharacterRange>* ranges,
                             int bottom,
                             int top) {
   unibrow::uchar chars[unibrow::Ecma262UnCanonicalize::kMaxWidth];
@@ -4215,8 +4224,8 @@
   // case mappings.
   for (int i = 0; i < boundary_count; i++) {
     if (bottom < boundaries[i] && top >= boundaries[i]) {
-      AddUncanonicals(ranges, bottom, boundaries[i] - 1);
-      AddUncanonicals(ranges, boundaries[i], top);
+      AddUncanonicals(isolate, ranges, bottom, boundaries[i] - 1);
+      AddUncanonicals(isolate, ranges, boundaries[i], top);
       return;
     }
   }
@@ -4228,7 +4237,8 @@
 #ifdef DEBUG
       for (int j = bottom; j <= top; j++) {
         unsigned current_char = j;
-        int length = uncanonicalize.get(current_char, '\0', chars);
+        int length = isolate->jsregexp_uncanonicalize()->get(current_char,
+                                                             '\0', chars);
         for (int k = 0; k < length; k++) {
           ASSERT(chars[k] == current_char);
         }
@@ -4241,7 +4251,7 @@
   // Step through the range finding equivalent characters.
   ZoneList<unibrow::uchar> *characters = new ZoneList<unibrow::uchar>(100);
   for (int i = bottom; i <= top; i++) {
-    int length = uncanonicalize.get(i, '\0', chars);
+    int length = isolate->jsregexp_uncanonicalize()->get(i, '\0', chars);
     for (int j = 0; j < length; j++) {
       uc32 chr = chars[j];
       if (chr != i && (chr < bottom || chr > top)) {
@@ -5261,7 +5271,4 @@
 }


-int OffsetsVector::static_offsets_vector_[
-    OffsetsVector::kStaticOffsetsVectorSize];
-
 }}  // namespace v8::internal
=======================================
--- /branches/experimental/isolates/src/jsregexp.h      Tue Jun  1 03:51:42 2010
+++ /branches/experimental/isolates/src/jsregexp.h      Fri Jun 25 13:52:32 2010
@@ -1428,31 +1428,28 @@
  public:
   inline OffsetsVector(int num_registers)
       : offsets_vector_length_(num_registers) {
-    if (offsets_vector_length_ > kStaticOffsetsVectorSize) {
+ if (offsets_vector_length_ > Isolate::kJSRegexpStaticOffsetsVectorSize) {
       vector_ = NewArray<int>(offsets_vector_length_);
     } else {
-      vector_ = static_offsets_vector_;
+      vector_ = Isolate::Current()->jsregexp_static_offsets_vector();
     }
   }
   inline ~OffsetsVector() {
-    if (offsets_vector_length_ > kStaticOffsetsVectorSize) {
+ if (offsets_vector_length_ > Isolate::kJSRegexpStaticOffsetsVectorSize) {
       DeleteArray(vector_);
       vector_ = NULL;
     }
   }
   inline int* vector() { return vector_; }
   inline int length() { return offsets_vector_length_; }
-
-  static const int kStaticOffsetsVectorSize = 50;

  private:
-  static Address static_offsets_vector_address() {
-    return reinterpret_cast<Address>(&static_offsets_vector_);
+  static Address static_offsets_vector_address(Isolate* isolate) {
+ return reinterpret_cast<Address>(isolate->jsregexp_static_offsets_vector());
   }

   int* vector_;
   int offsets_vector_length_;
-  static int static_offsets_vector_[kStaticOffsetsVectorSize];

   friend class ExternalReference;
 };
=======================================
--- /branches/experimental/isolates/src/objects-inl.h Thu Jun 10 10:14:01 2010 +++ /branches/experimental/isolates/src/objects-inl.h Fri Jun 25 13:52:32 2010
@@ -3212,6 +3212,20 @@
   if (length() == 0) return this;
   return HEAP->CopyFixedArray(this);
 }
+
+
+Relocatable::Relocatable() {
+  Isolate* isolate = Isolate::Current();
+  prev_ = isolate->relocatable_top();
+  isolate->set_relocatable_top(this);
+}
+
+
+Relocatable::~Relocatable() {
+  Isolate* isolate = Isolate::Current();
+  ASSERT_EQ(isolate->relocatable_top(), this);
+  isolate->set_relocatable_top(prev_);
+}


 #undef CAST_ACCESSOR
=======================================
--- /branches/experimental/isolates/src/objects.cc      Wed Jun 23 09:21:33 2010
+++ /branches/experimental/isolates/src/objects.cc      Fri Jun 25 13:52:32 2010
@@ -3789,9 +3789,6 @@
 #endif


-static StaticResource<StringInputBuffer> string_input_buffer;
-
-
 bool String::LooksValid() {
   if (!HEAP->Contains(this)) return false;
   return true;
@@ -3805,7 +3802,8 @@
   // the string will be accessed later (for example by WriteUtf8)
   // so it's still a good idea.
   TryFlatten();
-  Access<StringInputBuffer> buffer(&string_input_buffer);
+  Access<StringInputBuffer> buffer(
+      Isolate::Current()->objects_string_input_buffer());
   buffer->Reset(0, this);
   int result = 0;
   while (buffer->has_more())
@@ -3880,7 +3878,8 @@
   if (length < 0) length = kMaxInt - offset;

   // Compute the size of the UTF-8 string. Start at the specified offset.
-  Access<StringInputBuffer> buffer(&string_input_buffer);
+  Access<StringInputBuffer> buffer(
+      Isolate::Current()->objects_string_input_buffer());
   buffer->Reset(offset, this);
   int character_position = offset;
   int utf8_bytes = 0;
@@ -3955,7 +3954,8 @@
     return SmartPointer<uc16>();
   }

-  Access<StringInputBuffer> buffer(&string_input_buffer);
+  Access<StringInputBuffer> buffer(
+      Isolate::Current()->objects_string_input_buffer());
   buffer->Reset(this);

   uc16* result = NewArray<uc16>(length() + 1);
@@ -4236,13 +4236,11 @@
   UNREACHABLE();
   return 0;
 }
-
-
-Relocatable* Relocatable::top_ = NULL;


 void Relocatable::PostGarbageCollectionProcessing() {
-  Relocatable* current = top_;
+  Isolate* isolate = Isolate::Current();
+  Relocatable* current = isolate->relocatable_top();
   while (current != NULL) {
     current->PostGarbageCollection();
     current = current->prev_;
@@ -4252,21 +4250,23 @@

 // Reserve space for statics needing saving and restoring.
 int Relocatable::ArchiveSpacePerThread() {
-  return sizeof(top_);
+  return sizeof(Isolate::Current()->relocatable_top());
 }


 // Archive statics that are thread local.
 char* Relocatable::ArchiveState(char* to) {
-  *reinterpret_cast<Relocatable**>(to) = top_;
-  top_ = NULL;
+  Isolate* isolate = Isolate::Current();
+  *reinterpret_cast<Relocatable**>(to) = isolate->relocatable_top();
+  isolate->set_relocatable_top(NULL);
   return to + ArchiveSpacePerThread();
 }


 // Restore statics that are thread local.
 char* Relocatable::RestoreState(char* from) {
-  top_ = *reinterpret_cast<Relocatable**>(from);
+  Isolate* isolate = Isolate::Current();
+  isolate->set_relocatable_top(*reinterpret_cast<Relocatable**>(from));
   return from + ArchiveSpacePerThread();
 }

@@ -4279,7 +4279,8 @@


 void Relocatable::Iterate(ObjectVisitor* v) {
-  Iterate(v, top_);
+  Isolate* isolate = Isolate::Current();
+  Iterate(v, isolate->relocatable_top());
 }


@@ -4656,13 +4657,12 @@
   }
   return true;
 }
-
-
-static StringInputBuffer string_compare_buffer_b;


 template <typename IteratorA>
-static inline bool CompareStringContentsPartial(IteratorA* ia, String* b) {
+static inline bool CompareStringContentsPartial(Isolate* isolate,
+                                                IteratorA* ia,
+                                                String* b) {
   if (b->IsFlat()) {
     if (b->IsAsciiRepresentation()) {
       VectorIterator<char> ib(b->ToAsciiVector());
@@ -4672,13 +4672,11 @@
       return CompareStringContents(ia, &ib);
     }
   } else {
-    string_compare_buffer_b.Reset(0, b);
-    return CompareStringContents(ia, &string_compare_buffer_b);
+    isolate->objects_string_compare_buffer_b()->Reset(0, b);
+    return CompareStringContents(ia,
+ isolate->objects_string_compare_buffer_b());
   }
 }
-
-
-static StringInputBuffer string_compare_buffer_a;


 bool String::SlowEquals(String* other) {
@@ -4708,6 +4706,7 @@
                                     Vector<const char>(str2, len));
   }

+  Isolate* isolate = Isolate::Current();
   if (lhs->IsFlat()) {
     if (IsAsciiRepresentation()) {
       Vector<const char> vec1 = lhs->ToAsciiVector();
@@ -4722,8 +4721,9 @@
         }
       } else {
         VectorIterator<char> buf1(vec1);
-        string_compare_buffer_b.Reset(0, rhs);
-        return CompareStringContents(&buf1, &string_compare_buffer_b);
+        isolate->objects_string_compare_buffer_b()->Reset(0, rhs);
+        return CompareStringContents(&buf1,
+            isolate->objects_string_compare_buffer_b());
       }
     } else {
       Vector<const uc16> vec1 = lhs->ToUC16Vector();
@@ -4738,13 +4738,15 @@
         }
       } else {
         VectorIterator<uc16> buf1(vec1);
-        string_compare_buffer_b.Reset(0, rhs);
-        return CompareStringContents(&buf1, &string_compare_buffer_b);
+        isolate->objects_string_compare_buffer_b()->Reset(0, rhs);
+        return CompareStringContents(&buf1,
+            isolate->objects_string_compare_buffer_b());
       }
     }
   } else {
-    string_compare_buffer_a.Reset(0, lhs);
-    return CompareStringContentsPartial(&string_compare_buffer_a, rhs);
+    isolate->objects_string_compare_buffer_a()->Reset(0, lhs);
+    return CompareStringContentsPartial(isolate,
+        isolate->objects_string_compare_buffer_a(), rhs);
   }
 }

=======================================
--- /branches/experimental/isolates/src/objects.h       Mon Jun 21 10:40:11 2010
+++ /branches/experimental/isolates/src/objects.h       Fri Jun 25 13:52:32 2010
@@ -4593,11 +4593,8 @@
 // iterating or updating after gc.
 class Relocatable BASE_EMBEDDED {
  public:
-  inline Relocatable() : prev_(top_) { top_ = this; }
-  virtual ~Relocatable() {
-    ASSERT_EQ(top_, this);
-    top_ = prev_;
-  }
+  inline Relocatable();
+  inline virtual ~Relocatable();
   virtual void IterateInstance(ObjectVisitor* v) { }
   virtual void PostGarbageCollection() { }

@@ -4609,7 +4606,6 @@
   static void Iterate(ObjectVisitor* v, Relocatable* top);
   static char* Iterate(ObjectVisitor* v, char* t);
  private:
-  static Relocatable* top_;
   Relocatable* prev_;
 };

=======================================
--- /branches/experimental/isolates/src/profile-generator-inl.h Wed Jun 16 17:13:33 2010 +++ /branches/experimental/isolates/src/profile-generator-inl.h Fri Jun 25 13:52:32 2010
@@ -52,13 +52,15 @@
                      const char* resource_name,
                      int line_number,
                      int security_token_id)
-    : call_uid_(next_call_uid_++),
-      tag_(tag),
+    : tag_(tag),
       name_prefix_(name_prefix),
       name_(name),
       resource_name_(resource_name),
       line_number_(line_number),
       security_token_id_(security_token_id) {
+  Isolate* isolate = Isolate::Current();
+  call_uid_ = isolate->code_entry_next_call_uid();
+  isolate->set_code_entry_next_call_uid(call_uid_ + 1);
 }


=======================================
--- /branches/experimental/isolates/src/profile-generator.cc Thu Jun 24 09:41:05 2010 +++ /branches/experimental/isolates/src/profile-generator.cc Fri Jun 25 13:52:32 2010
@@ -121,7 +121,6 @@


 const char* CodeEntry::kEmptyNamePrefix = "";
-unsigned CodeEntry::next_call_uid_ = 1;


 void CodeEntry::CopyData(const CodeEntry& source) {
=======================================
--- /branches/experimental/isolates/src/profile-generator.h Wed Jun 16 17:13:33 2010 +++ /branches/experimental/isolates/src/profile-generator.h Fri Jun 25 13:52:32 2010
@@ -116,8 +116,6 @@
   int line_number_;
   int security_token_id_;

-  static unsigned next_call_uid_;
-
   DISALLOW_COPY_AND_ASSIGN(CodeEntry);
 };

=======================================
--- /branches/experimental/isolates/src/x64/codegen-x64.cc Wed Jun 23 09:21:33 2010 +++ /branches/experimental/isolates/src/x64/codegen-x64.cc Fri Jun 25 13:52:32 2010
@@ -8563,7 +8563,7 @@
   __ PositiveSmiTimesPowerOfTwoToInteger64(rdx, rdx, 1);
   __ addq(rdx, Immediate(2));  // rdx was number_of_captures * 2.
   // Check that the static offsets vector buffer is large enough.
-  __ cmpq(rdx, Immediate(OffsetsVector::kStaticOffsetsVectorSize));
+  __ cmpq(rdx, Immediate(Isolate::kJSRegexpStaticOffsetsVectorSize));
   __ j(above, &runtime);

   // rcx: RegExp data (FixedArray)
=======================================
--- /branches/experimental/isolates/src/x64/disasm-x64.cc Wed Jun 16 08:56:49 2010 +++ /branches/experimental/isolates/src/x64/disasm-x64.cc Fri Jun 25 13:52:32 2010
@@ -267,7 +267,6 @@
 }


-// TODO(isolates): This appears to act morally as a constant. Is it safe?
 static InstructionTable instruction_table;


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

Reply via email to