diff --git a/src/extensions/statistics-extension.cc b/src/extensions/statistics-extension.cc index 32bc07de8b..651d99d452 100644 --- a/src/extensions/statistics-extension.cc +++ b/src/extensions/statistics-extension.cc @@ -60,7 +60,7 @@ static void AddNumber(v8::Local object, void StatisticsExtension::GetCounters( const v8::FunctionCallbackInfo& args) { - Isolate* isolate = Isolate::Current(); + Isolate* isolate = reinterpret_cast(args.GetIsolate()); Heap* heap = isolate->heap(); if (args.Length() > 0) { // GC if first argument evaluates to true. diff --git a/src/factory.cc b/src/factory.cc index 3d949210d4..c7f7806fc1 100644 --- a/src/factory.cc +++ b/src/factory.cc @@ -130,7 +130,8 @@ Handle Factory::NewDescriptorArray(int number_of_descriptors, int slack) { ASSERT(0 <= number_of_descriptors); CALL_HEAP_FUNCTION(isolate(), - DescriptorArray::Allocate(number_of_descriptors, slack), + DescriptorArray::Allocate( + isolate(), number_of_descriptors, slack), DescriptorArray); } diff --git a/src/heap.cc b/src/heap.cc index bd341e3fbb..722705f6b7 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -1027,7 +1027,7 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector, isolate_->eternal_handles()->PostGarbageCollectionProcessing(this); // Update relocatables. - Relocatable::PostGarbageCollectionProcessing(); + Relocatable::PostGarbageCollectionProcessing(isolate_); if (collector == MARK_COMPACTOR) { // Register the amount of external allocated memory. @@ -2938,7 +2938,7 @@ MaybeObject* Heap::CreateOddball(const char* to_string, { MaybeObject* maybe_result = Allocate(oddball_map(), OLD_POINTER_SPACE); if (!maybe_result->ToObject(&result)) return maybe_result; } - return Oddball::cast(result)->Initialize(to_string, to_number, kind); + return Oddball::cast(result)->Initialize(this, to_string, to_number, kind); } @@ -3042,15 +3042,16 @@ bool Heap::CreateInitialObjects() { // Finish initializing oddballs after creating the string table. { MaybeObject* maybe_obj = - undefined_value()->Initialize("undefined", + undefined_value()->Initialize(this, + "undefined", nan_value(), Oddball::kUndefined); if (!maybe_obj->ToObject(&obj)) return false; } // Initialize the null_value. - { MaybeObject* maybe_obj = - null_value()->Initialize("null", Smi::FromInt(0), Oddball::kNull); + { MaybeObject* maybe_obj = null_value()->Initialize( + this, "null", Smi::FromInt(0), Oddball::kNull); if (!maybe_obj->ToObject(&obj)) return false; } @@ -6574,7 +6575,7 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) { v->Synchronize(VisitorSynchronization::kBootstrapper); isolate_->Iterate(v); v->Synchronize(VisitorSynchronization::kTop); - Relocatable::Iterate(v); + Relocatable::Iterate(isolate_, v); v->Synchronize(VisitorSynchronization::kRelocatable); #ifdef ENABLE_DEBUGGER_SUPPORT diff --git a/src/jsregexp.cc b/src/jsregexp.cc index 0ce10b8c3d..5c79477eb1 100644 --- a/src/jsregexp.cc +++ b/src/jsregexp.cc @@ -1869,7 +1869,7 @@ static void EmitUseLookupTable( for (int i = j; i < kSize; i++) { templ[i] = bit; } - Factory* factory = Isolate::Current()->factory(); + Factory* factory = masm->zone()->isolate()->factory(); // TODO(erikcorry): Cache these. Handle ba = factory->NewByteArray(kSize, TENURED); for (int i = 0; i < kSize; i++) { @@ -2548,7 +2548,7 @@ void TextNode::GetQuickCheckDetails(QuickCheckDetails* details, RegExpCompiler* compiler, int characters_filled_in, bool not_at_start) { - Isolate* isolate = Isolate::Current(); + Isolate* isolate = compiler->macro_assembler()->zone()->isolate(); ASSERT(characters_filled_in < details->characters()); int characters = details->characters(); int char_mask; @@ -3246,8 +3246,8 @@ void TextNode::TextEmitPass(RegExpCompiler* compiler, Trace* trace, bool first_element_checked, int* checked_up_to) { - Isolate* isolate = Isolate::Current(); RegExpMacroAssembler* assembler = compiler->macro_assembler(); + Isolate* isolate = assembler->zone()->isolate(); bool ascii = compiler->ascii(); Label* backtrack = trace->backtrack(); QuickCheckDetails* quick_check = trace->quick_check_performed(); @@ -3820,7 +3820,7 @@ bool BoyerMooreLookahead::EmitSkipInstructions(RegExpMacroAssembler* masm) { return true; } - Factory* factory = Isolate::Current()->factory(); + Factory* factory = masm->zone()->isolate()->factory(); Handle boolean_skip_table = factory->NewByteArray(kSize, TENURED); int skip_distance = GetSkipTable( min_lookahead, max_lookahead, boolean_skip_table); @@ -5292,7 +5292,7 @@ void CharacterRange::Split(ZoneList* base, void CharacterRange::AddCaseEquivalents(ZoneList* ranges, bool is_ascii, Zone* zone) { - Isolate* isolate = Isolate::Current(); + Isolate* isolate = zone->isolate(); uc16 bottom = from(); uc16 top = to(); if (is_ascii && !RangeContainsLatin1Equivalents(*this)) { @@ -5680,7 +5680,7 @@ OutSet* DispatchTable::Get(uc16 value) { void Analysis::EnsureAnalyzed(RegExpNode* that) { - StackLimitCheck check(Isolate::Current()); + StackLimitCheck check(that->zone()->isolate()); if (check.HasOverflowed()) { fail("Stack overflow"); return; diff --git a/src/liveedit.cc b/src/liveedit.cc index b6ac0461c4..c3ccdf0bec 100644 --- a/src/liveedit.cc +++ b/src/liveedit.cc @@ -631,8 +631,8 @@ static Handle UnwrapJSValue(Handle jsValue) { // Wraps any object into a OpaqueReference, that will hide the object // from JavaScript. -static Handle WrapInJSValue(Handle object) { - Isolate* isolate = Isolate::Current(); +static Handle WrapInJSValue(Handle object) { + Isolate* isolate = object->GetIsolate(); Handle constructor = isolate->opaque_reference_function(); Handle result = Handle::cast(isolate->factory()->NewJSObject(constructor)); @@ -662,8 +662,8 @@ static int GetArrayLength(Handle array) { template class JSArrayBasedStruct { public: - static S Create() { - Factory* factory = Isolate::Current()->factory(); + static S Create(Isolate* isolate) { + Factory* factory = isolate->factory(); Handle array = factory->NewJSArray(S::kSize_); return S(array); } @@ -724,7 +724,7 @@ class FunctionInfoWrapper : public JSArrayBasedStruct { this->SetSmiValueField(kParentIndexOffset_, parent_index); } void SetFunctionCode(Handle function_code, - Handle code_scope_info) { + Handle code_scope_info) { Handle code_wrapper = WrapInJSValue(function_code); this->SetField(kCodeOffset_, code_wrapper); @@ -833,7 +833,7 @@ class FunctionInfoListener { void FunctionStarted(FunctionLiteral* fun) { HandleScope scope(isolate()); - FunctionInfoWrapper info = FunctionInfoWrapper::Create(); + FunctionInfoWrapper info = FunctionInfoWrapper::Create(isolate()); info.SetInitialProperties(fun->name(), fun->start_position(), fun->end_position(), fun->parameter_count(), fun->materialized_literal_count(), @@ -860,8 +860,7 @@ class FunctionInfoListener { result_->GetElementNoExceptionThrown( isolate(), current_parent_index_)); info.SetFunctionCode(function_code, - Handle(isolate()->heap()->null_value(), - isolate())); + Handle(isolate()->heap()->null_value())); } // Saves full information about a function: its code, its scope info @@ -876,7 +875,7 @@ class FunctionInfoListener { result_->GetElementNoExceptionThrown( isolate(), current_parent_index_)); info.SetFunctionCode(Handle(shared->code()), - Handle(shared->scope_info(), isolate())); + Handle(shared->scope_info())); info.SetSharedFunctionInfo(shared); Handle scope_info_list(SerializeFunctionScope(scope, zone), @@ -939,7 +938,7 @@ class FunctionInfoListener { JSArray* LiveEdit::GatherCompileInfo(Handle