remove Isolate::Current from most files starting with 'j' through 'o'
R=bmeurer@chromium.org BUG= Review URL: https://codereview.chromium.org/23578012 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16520 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
924463984c
commit
2b7efe05ae
@ -60,7 +60,7 @@ static void AddNumber(v8::Local<v8::Object> object,
|
||||
|
||||
void StatisticsExtension::GetCounters(
|
||||
const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Isolate* isolate = reinterpret_cast<Isolate*>(args.GetIsolate());
|
||||
Heap* heap = isolate->heap();
|
||||
|
||||
if (args.Length() > 0) { // GC if first argument evaluates to true.
|
||||
|
@ -130,7 +130,8 @@ Handle<DescriptorArray> 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);
|
||||
}
|
||||
|
||||
|
13
src/heap.cc
13
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
|
||||
|
@ -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<ByteArray> 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<ByteArray> 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<CharacterRange>* base,
|
||||
void CharacterRange::AddCaseEquivalents(ZoneList<CharacterRange>* 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;
|
||||
|
@ -631,8 +631,8 @@ static Handle<Object> UnwrapJSValue(Handle<JSValue> jsValue) {
|
||||
|
||||
// Wraps any object into a OpaqueReference, that will hide the object
|
||||
// from JavaScript.
|
||||
static Handle<JSValue> WrapInJSValue(Handle<Object> object) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
static Handle<JSValue> WrapInJSValue(Handle<HeapObject> object) {
|
||||
Isolate* isolate = object->GetIsolate();
|
||||
Handle<JSFunction> constructor = isolate->opaque_reference_function();
|
||||
Handle<JSValue> result =
|
||||
Handle<JSValue>::cast(isolate->factory()->NewJSObject(constructor));
|
||||
@ -662,8 +662,8 @@ static int GetArrayLength(Handle<JSArray> array) {
|
||||
template<typename S>
|
||||
class JSArrayBasedStruct {
|
||||
public:
|
||||
static S Create() {
|
||||
Factory* factory = Isolate::Current()->factory();
|
||||
static S Create(Isolate* isolate) {
|
||||
Factory* factory = isolate->factory();
|
||||
Handle<JSArray> array = factory->NewJSArray(S::kSize_);
|
||||
return S(array);
|
||||
}
|
||||
@ -724,7 +724,7 @@ class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> {
|
||||
this->SetSmiValueField(kParentIndexOffset_, parent_index);
|
||||
}
|
||||
void SetFunctionCode(Handle<Code> function_code,
|
||||
Handle<Object> code_scope_info) {
|
||||
Handle<HeapObject> code_scope_info) {
|
||||
Handle<JSValue> 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<Object>(isolate()->heap()->null_value(),
|
||||
isolate()));
|
||||
Handle<HeapObject>(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<Code>(shared->code()),
|
||||
Handle<Object>(shared->scope_info(), isolate()));
|
||||
Handle<HeapObject>(shared->scope_info()));
|
||||
info.SetSharedFunctionInfo(shared);
|
||||
|
||||
Handle<Object> scope_info_list(SerializeFunctionScope(scope, zone),
|
||||
@ -939,7 +938,7 @@ class FunctionInfoListener {
|
||||
|
||||
JSArray* LiveEdit::GatherCompileInfo(Handle<Script> script,
|
||||
Handle<String> source) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Isolate* isolate = script->GetIsolate();
|
||||
|
||||
FunctionInfoListener listener(isolate);
|
||||
Handle<Object> original_source =
|
||||
@ -1011,8 +1010,8 @@ void LiveEdit::WrapSharedFunctionInfos(Handle<JSArray> array) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
Handle<SharedFunctionInfo> info(
|
||||
SharedFunctionInfo::cast(
|
||||
array->GetElementNoExceptionThrown(array->GetIsolate(), i)));
|
||||
SharedInfoWrapper info_wrapper = SharedInfoWrapper::Create();
|
||||
array->GetElementNoExceptionThrown(isolate, i)));
|
||||
SharedInfoWrapper info_wrapper = SharedInfoWrapper::Create(isolate);
|
||||
Handle<String> name_handle(String::cast(info->name()));
|
||||
info_wrapper.SetProperties(name_handle, info->start_position(),
|
||||
info->end_position(), info);
|
||||
@ -1275,7 +1274,7 @@ static void DeoptimizeDependentFunctions(SharedFunctionInfo* function_info) {
|
||||
MaybeObject* LiveEdit::ReplaceFunctionCode(
|
||||
Handle<JSArray> new_compile_info_array,
|
||||
Handle<JSArray> shared_info_array) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Isolate* isolate = new_compile_info_array->GetIsolate();
|
||||
HandleScope scope(isolate);
|
||||
|
||||
if (!SharedInfoWrapper::IsInstance(shared_info_array)) {
|
||||
@ -1349,7 +1348,7 @@ void LiveEdit::SetFunctionScript(Handle<JSValue> function_wrapper,
|
||||
CHECK(script_handle->IsScript() || script_handle->IsUndefined());
|
||||
shared_info->set_script(*script_handle);
|
||||
|
||||
Isolate::Current()->compilation_cache()->Remove(shared_info);
|
||||
function_wrapper->GetIsolate()->compilation_cache()->Remove(shared_info);
|
||||
}
|
||||
|
||||
|
||||
@ -1518,7 +1517,7 @@ static Handle<Code> PatchPositionsInCode(
|
||||
MaybeObject* LiveEdit::PatchFunctionPositions(
|
||||
Handle<JSArray> shared_info_array, Handle<JSArray> position_change_array) {
|
||||
if (!SharedInfoWrapper::IsInstance(shared_info_array)) {
|
||||
return Isolate::Current()->ThrowIllegalOperation();
|
||||
return shared_info_array->GetIsolate()->ThrowIllegalOperation();
|
||||
}
|
||||
|
||||
SharedInfoWrapper shared_info_wrapper(shared_info_array);
|
||||
@ -1662,7 +1661,7 @@ static bool CheckActivation(Handle<JSArray> shared_info_array,
|
||||
static bool FixTryCatchHandler(StackFrame* top_frame,
|
||||
StackFrame* bottom_frame) {
|
||||
Address* pointer_address =
|
||||
&Memory::Address_at(Isolate::Current()->get_address_from_id(
|
||||
&Memory::Address_at(top_frame->isolate()->get_address_from_id(
|
||||
Isolate::kHandlerAddress));
|
||||
|
||||
while (*pointer_address < top_frame->sp()) {
|
||||
@ -1698,7 +1697,7 @@ static const char* DropFrames(Vector<StackFrame*> frames,
|
||||
ASSERT(bottom_js_frame->is_java_script());
|
||||
|
||||
// Check the nature of the top frame.
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Isolate* isolate = bottom_js_frame->isolate();
|
||||
Code* pre_top_frame_code = pre_top_frame->LookupCode();
|
||||
bool frame_has_padding;
|
||||
if (pre_top_frame_code->is_inline_cache_stub() &&
|
||||
@ -1801,7 +1800,7 @@ static const char* DropFrames(Vector<StackFrame*> frames,
|
||||
// Make sure FixTryCatchHandler is idempotent.
|
||||
ASSERT(!FixTryCatchHandler(pre_top_frame, bottom_js_frame));
|
||||
|
||||
Handle<Code> code = Isolate::Current()->builtins()->FrameDropper_LiveEdit();
|
||||
Handle<Code> code = isolate->builtins()->FrameDropper_LiveEdit();
|
||||
*top_frame_pc_address = code->entry();
|
||||
pre_top_frame->SetCallerFp(bottom_js_frame->fp());
|
||||
|
||||
@ -1849,8 +1848,7 @@ class MultipleFunctionTarget {
|
||||
// Drops all call frame matched by target and all frames above them.
|
||||
template<typename TARGET>
|
||||
static const char* DropActivationsInActiveThreadImpl(
|
||||
TARGET& target, bool do_drop) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Isolate* isolate, TARGET& target, bool do_drop) {
|
||||
Debug* debug = isolate->debug();
|
||||
Zone zone(isolate);
|
||||
Vector<StackFrame*> frames = CreateStackMap(isolate, &zone);
|
||||
@ -1949,8 +1947,8 @@ static const char* DropActivationsInActiveThread(
|
||||
Handle<JSArray> shared_info_array, Handle<JSArray> result, bool do_drop) {
|
||||
MultipleFunctionTarget target(shared_info_array, result);
|
||||
|
||||
const char* message =
|
||||
DropActivationsInActiveThreadImpl(target, do_drop);
|
||||
const char* message = DropActivationsInActiveThreadImpl(
|
||||
shared_info_array->GetIsolate(), target, do_drop);
|
||||
if (message) {
|
||||
return message;
|
||||
}
|
||||
@ -2015,7 +2013,7 @@ Handle<JSArray> LiveEdit::CheckAndDropActivations(
|
||||
// First check inactive threads. Fail if some functions are blocked there.
|
||||
InactiveThreadActivationsChecker inactive_threads_checker(shared_info_array,
|
||||
result);
|
||||
Isolate::Current()->thread_manager()->IterateArchivedThreads(
|
||||
isolate->thread_manager()->IterateArchivedThreads(
|
||||
&inactive_threads_checker);
|
||||
if (inactive_threads_checker.HasBlockedFunctions()) {
|
||||
return result;
|
||||
@ -2067,7 +2065,8 @@ class SingleFrameTarget {
|
||||
const char* LiveEdit::RestartFrame(JavaScriptFrame* frame) {
|
||||
SingleFrameTarget target(frame);
|
||||
|
||||
const char* result = DropActivationsInActiveThreadImpl(target, true);
|
||||
const char* result = DropActivationsInActiveThreadImpl(
|
||||
frame->isolate(), target, true);
|
||||
if (result != NULL) {
|
||||
return result;
|
||||
}
|
||||
|
12
src/log.cc
12
src/log.cc
@ -1764,21 +1764,21 @@ void Logger::LogAccessorCallbacks() {
|
||||
}
|
||||
|
||||
|
||||
static void AddIsolateIdIfNeeded(StringStream* stream) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
static void AddIsolateIdIfNeeded(Isolate* isolate, StringStream* stream) {
|
||||
if (isolate->IsDefaultIsolate()) return;
|
||||
stream->Add("isolate-%p-", isolate);
|
||||
}
|
||||
|
||||
|
||||
static SmartArrayPointer<const char> PrepareLogFileName(const char* file_name) {
|
||||
static SmartArrayPointer<const char> PrepareLogFileName(
|
||||
Isolate* isolate, const char* file_name) {
|
||||
if (strchr(file_name, '%') != NULL ||
|
||||
!Isolate::Current()->IsDefaultIsolate()) {
|
||||
!isolate->IsDefaultIsolate()) {
|
||||
// If there's a '%' in the log file name we have to expand
|
||||
// placeholders.
|
||||
HeapStringAllocator allocator;
|
||||
StringStream stream(&allocator);
|
||||
AddIsolateIdIfNeeded(&stream);
|
||||
AddIsolateIdIfNeeded(isolate, &stream);
|
||||
for (const char* p = file_name; *p; p++) {
|
||||
if (*p == '%') {
|
||||
p++;
|
||||
@ -1832,7 +1832,7 @@ bool Logger::SetUp(Isolate* isolate) {
|
||||
}
|
||||
|
||||
SmartArrayPointer<const char> log_file_name =
|
||||
PrepareLogFileName(FLAG_logfile);
|
||||
PrepareLogFileName(isolate, FLAG_logfile);
|
||||
log_->Initialize(*log_file_name);
|
||||
|
||||
if (FLAG_ll_prof) {
|
||||
|
@ -6584,7 +6584,7 @@ MaybeObject* Map::ShareDescriptor(DescriptorArray* descriptors,
|
||||
} else {
|
||||
// Descriptor arrays grow by 50%.
|
||||
MaybeObject* maybe_descriptors = DescriptorArray::Allocate(
|
||||
old_size, old_size < 4 ? 1 : old_size / 2);
|
||||
GetIsolate(), old_size, old_size < 4 ? 1 : old_size / 2);
|
||||
if (!maybe_descriptors->To(&new_descriptors)) return maybe_descriptors;
|
||||
|
||||
DescriptorArray::WhitenessWitness witness(new_descriptors);
|
||||
@ -6834,7 +6834,8 @@ MaybeObject* Map::CopyAddDescriptor(Descriptor* descriptor,
|
||||
}
|
||||
|
||||
DescriptorArray* new_descriptors;
|
||||
MaybeObject* maybe_descriptors = DescriptorArray::Allocate(old_size, 1);
|
||||
MaybeObject* maybe_descriptors =
|
||||
DescriptorArray::Allocate(GetIsolate(), old_size, 1);
|
||||
if (!maybe_descriptors->To(&new_descriptors)) return maybe_descriptors;
|
||||
|
||||
DescriptorArray::WhitenessWitness witness(new_descriptors);
|
||||
@ -6881,7 +6882,7 @@ MaybeObject* DescriptorArray::CopyUpToAddAttributes(
|
||||
int size = enumeration_index;
|
||||
|
||||
DescriptorArray* descriptors;
|
||||
MaybeObject* maybe_descriptors = Allocate(size);
|
||||
MaybeObject* maybe_descriptors = Allocate(GetIsolate(), size);
|
||||
if (!maybe_descriptors->To(&descriptors)) return maybe_descriptors;
|
||||
DescriptorArray::WhitenessWitness witness(descriptors);
|
||||
|
||||
@ -6928,7 +6929,8 @@ MaybeObject* Map::CopyReplaceDescriptor(DescriptorArray* descriptors,
|
||||
ASSERT_LT(insertion_index, new_size);
|
||||
|
||||
DescriptorArray* new_descriptors;
|
||||
MaybeObject* maybe_descriptors = DescriptorArray::Allocate(new_size);
|
||||
MaybeObject* maybe_descriptors =
|
||||
DescriptorArray::Allocate(GetIsolate(), new_size);
|
||||
if (!maybe_descriptors->To(&new_descriptors)) return maybe_descriptors;
|
||||
DescriptorArray::WhitenessWitness witness(new_descriptors);
|
||||
|
||||
@ -7718,8 +7720,10 @@ bool FixedArray::IsEqualTo(FixedArray* other) {
|
||||
#endif
|
||||
|
||||
|
||||
MaybeObject* DescriptorArray::Allocate(int number_of_descriptors, int slack) {
|
||||
Heap* heap = Isolate::Current()->heap();
|
||||
MaybeObject* DescriptorArray::Allocate(Isolate* isolate,
|
||||
int number_of_descriptors,
|
||||
int slack) {
|
||||
Heap* heap = isolate->heap();
|
||||
// Do not use DescriptorArray::cast on incomplete object.
|
||||
int size = number_of_descriptors + slack;
|
||||
if (size == 0) return heap->empty_descriptor_array();
|
||||
@ -7787,7 +7791,8 @@ MaybeObject* DescriptorArray::Merge(int verbatim,
|
||||
// Allocate a new descriptor array large enough to hold the required
|
||||
// descriptors, with minimally the exact same size as this descriptor array.
|
||||
MaybeObject* maybe_descriptors = DescriptorArray::Allocate(
|
||||
new_size, Max(new_size, other->number_of_descriptors()) - new_size);
|
||||
GetIsolate(), new_size,
|
||||
Max(new_size, other->number_of_descriptors()) - new_size);
|
||||
if (!maybe_descriptors->To(&result)) return maybe_descriptors;
|
||||
ASSERT(result->length() > length() ||
|
||||
result->NumberOfSlackDescriptors() > 0 ||
|
||||
@ -8003,7 +8008,7 @@ bool Name::IsCacheable(Isolate* isolate) {
|
||||
|
||||
|
||||
bool String::LooksValid() {
|
||||
if (!Isolate::Current()->heap()->Contains(this)) return false;
|
||||
if (!GetIsolate()->heap()->Contains(this)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -8163,8 +8168,7 @@ const uc16* SeqTwoByteString::SeqTwoByteStringGetData(unsigned start) {
|
||||
}
|
||||
|
||||
|
||||
void Relocatable::PostGarbageCollectionProcessing() {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
void Relocatable::PostGarbageCollectionProcessing(Isolate* isolate) {
|
||||
Relocatable* current = isolate->relocatable_top();
|
||||
while (current != NULL) {
|
||||
current->PostGarbageCollection();
|
||||
@ -8174,8 +8178,8 @@ void Relocatable::PostGarbageCollectionProcessing() {
|
||||
|
||||
|
||||
// Reserve space for statics needing saving and restoring.
|
||||
int Relocatable::ArchiveSpacePerThread() {
|
||||
return sizeof(Isolate::Current()->relocatable_top());
|
||||
int Relocatable::ArchiveSpacePerThread(Isolate* isolate) {
|
||||
return sizeof(isolate->relocatable_top());
|
||||
}
|
||||
|
||||
|
||||
@ -8183,26 +8187,26 @@ int Relocatable::ArchiveSpacePerThread() {
|
||||
char* Relocatable::ArchiveState(Isolate* isolate, char* to) {
|
||||
*reinterpret_cast<Relocatable**>(to) = isolate->relocatable_top();
|
||||
isolate->set_relocatable_top(NULL);
|
||||
return to + ArchiveSpacePerThread();
|
||||
return to + ArchiveSpacePerThread(isolate);
|
||||
}
|
||||
|
||||
|
||||
// Restore statics that are thread local.
|
||||
char* Relocatable::RestoreState(Isolate* isolate, char* from) {
|
||||
isolate->set_relocatable_top(*reinterpret_cast<Relocatable**>(from));
|
||||
return from + ArchiveSpacePerThread();
|
||||
return from + ArchiveSpacePerThread(isolate);
|
||||
}
|
||||
|
||||
|
||||
char* Relocatable::Iterate(ObjectVisitor* v, char* thread_storage) {
|
||||
char* Relocatable::Iterate(
|
||||
Isolate* isolate, ObjectVisitor* v, char* thread_storage) {
|
||||
Relocatable* top = *reinterpret_cast<Relocatable**>(thread_storage);
|
||||
Iterate(v, top);
|
||||
return thread_storage + ArchiveSpacePerThread();
|
||||
return thread_storage + ArchiveSpacePerThread(isolate);
|
||||
}
|
||||
|
||||
|
||||
void Relocatable::Iterate(ObjectVisitor* v) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
void Relocatable::Iterate(Isolate* isolate, ObjectVisitor* v) {
|
||||
Iterate(v, isolate->relocatable_top());
|
||||
}
|
||||
|
||||
@ -9316,7 +9320,7 @@ static bool CompileLazyHelper(CompilationInfo* info,
|
||||
ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled());
|
||||
ASSERT(!info->isolate()->has_pending_exception());
|
||||
bool result = Compiler::CompileLazy(info);
|
||||
ASSERT(result != Isolate::Current()->has_pending_exception());
|
||||
ASSERT(result != info->isolate()->has_pending_exception());
|
||||
if (!result && flag == CLEAR_EXCEPTION) {
|
||||
info->isolate()->clear_pending_exception();
|
||||
}
|
||||
@ -9706,12 +9710,13 @@ bool JSFunction::PassesFilter(const char* raw_filter) {
|
||||
}
|
||||
|
||||
|
||||
MaybeObject* Oddball::Initialize(const char* to_string,
|
||||
MaybeObject* Oddball::Initialize(Heap* heap,
|
||||
const char* to_string,
|
||||
Object* to_number,
|
||||
byte kind) {
|
||||
String* internalized_to_string;
|
||||
{ MaybeObject* maybe_string =
|
||||
Isolate::Current()->heap()->InternalizeUtf8String(
|
||||
heap->InternalizeUtf8String(
|
||||
CStrVector(to_string));
|
||||
if (!maybe_string->To(&internalized_to_string)) return maybe_string;
|
||||
}
|
||||
@ -10432,7 +10437,7 @@ int Code::GetAge() {
|
||||
|
||||
void Code::GetCodeAgeAndParity(Code* code, Age* age,
|
||||
MarkingParity* parity) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Isolate* isolate = code->GetIsolate();
|
||||
Builtins* builtins = isolate->builtins();
|
||||
Code* stub = NULL;
|
||||
#define HANDLE_CODE_AGE(AGE) \
|
||||
@ -15263,7 +15268,7 @@ MaybeObject* NameDictionary::TransformPropertiesToFastFor(
|
||||
// Allocate the instance descriptor.
|
||||
DescriptorArray* descriptors;
|
||||
MaybeObject* maybe_descriptors =
|
||||
DescriptorArray::Allocate(instance_descriptor_length);
|
||||
DescriptorArray::Allocate(GetIsolate(), instance_descriptor_length);
|
||||
if (!maybe_descriptors->To(&descriptors)) {
|
||||
return maybe_descriptors;
|
||||
}
|
||||
@ -15556,7 +15561,7 @@ void DebugInfo::ClearBreakPoint(Handle<DebugInfo> debug_info,
|
||||
int code_position,
|
||||
Handle<Object> break_point_object) {
|
||||
Handle<Object> break_point_info(debug_info->GetBreakPointInfo(code_position),
|
||||
Isolate::Current());
|
||||
debug_info->GetIsolate());
|
||||
if (break_point_info->IsUndefined()) return;
|
||||
BreakPointInfo::ClearBreakPoint(
|
||||
Handle<BreakPointInfo>::cast(break_point_info),
|
||||
@ -15569,7 +15574,7 @@ void DebugInfo::SetBreakPoint(Handle<DebugInfo> debug_info,
|
||||
int source_position,
|
||||
int statement_position,
|
||||
Handle<Object> break_point_object) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Isolate* isolate = debug_info->GetIsolate();
|
||||
Handle<Object> break_point_info(debug_info->GetBreakPointInfo(code_position),
|
||||
isolate);
|
||||
if (!break_point_info->IsUndefined()) {
|
||||
@ -15683,7 +15688,7 @@ int DebugInfo::GetBreakPointInfoIndex(int code_position) {
|
||||
// Remove the specified break point object.
|
||||
void BreakPointInfo::ClearBreakPoint(Handle<BreakPointInfo> break_point_info,
|
||||
Handle<Object> break_point_object) {
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Isolate* isolate = break_point_info->GetIsolate();
|
||||
// If there are no break points just ignore.
|
||||
if (break_point_info->break_point_objects()->IsUndefined()) return;
|
||||
// If there is a single break point clear it if it is the same.
|
||||
|
@ -3186,7 +3186,8 @@ class DescriptorArray: public FixedArray {
|
||||
|
||||
// Allocates a DescriptorArray, but returns the singleton
|
||||
// empty descriptor array object if number_of_descriptors is 0.
|
||||
MUST_USE_RESULT static MaybeObject* Allocate(int number_of_descriptors,
|
||||
MUST_USE_RESULT static MaybeObject* Allocate(Isolate* isolate,
|
||||
int number_of_descriptors,
|
||||
int slack = 0);
|
||||
|
||||
// Casting.
|
||||
@ -8724,13 +8725,14 @@ class Relocatable BASE_EMBEDDED {
|
||||
virtual void IterateInstance(ObjectVisitor* v) { }
|
||||
virtual void PostGarbageCollection() { }
|
||||
|
||||
static void PostGarbageCollectionProcessing();
|
||||
static int ArchiveSpacePerThread();
|
||||
static void PostGarbageCollectionProcessing(Isolate* isolate);
|
||||
static int ArchiveSpacePerThread(Isolate* isolate);
|
||||
static char* ArchiveState(Isolate* isolate, char* to);
|
||||
static char* RestoreState(Isolate* isolate, char* from);
|
||||
static void Iterate(ObjectVisitor* v);
|
||||
static void Iterate(Isolate* isolate, ObjectVisitor* v);
|
||||
static void Iterate(ObjectVisitor* v, Relocatable* top);
|
||||
static char* Iterate(ObjectVisitor* v, char* t);
|
||||
static char* Iterate(Isolate* isolate, ObjectVisitor* v, char* t);
|
||||
|
||||
private:
|
||||
Isolate* isolate_;
|
||||
Relocatable* prev_;
|
||||
@ -8866,7 +8868,8 @@ class Oddball: public HeapObject {
|
||||
DECLARE_VERIFIER(Oddball)
|
||||
|
||||
// Initialize the fields.
|
||||
MUST_USE_RESULT MaybeObject* Initialize(const char* to_string,
|
||||
MUST_USE_RESULT MaybeObject* Initialize(Heap* heap,
|
||||
const char* to_string,
|
||||
Object* to_number,
|
||||
byte kind);
|
||||
|
||||
|
@ -227,7 +227,7 @@ void ThreadManager::Unlock() {
|
||||
}
|
||||
|
||||
|
||||
static int ArchiveSpacePerThread() {
|
||||
static int ArchiveSpacePerThread(Isolate* isolate) {
|
||||
return HandleScopeImplementer::ArchiveSpacePerThread() +
|
||||
Isolate::ArchiveSpacePerThread() +
|
||||
#ifdef ENABLE_DEBUGGER_SUPPORT
|
||||
@ -236,7 +236,7 @@ static int ArchiveSpacePerThread() {
|
||||
StackGuard::ArchiveSpacePerThread() +
|
||||
RegExpStack::ArchiveSpacePerThread() +
|
||||
Bootstrapper::ArchiveSpacePerThread() +
|
||||
Relocatable::ArchiveSpacePerThread();
|
||||
Relocatable::ArchiveSpacePerThread(isolate);
|
||||
}
|
||||
|
||||
|
||||
@ -256,7 +256,7 @@ ThreadState::~ThreadState() {
|
||||
|
||||
|
||||
void ThreadState::AllocateSpace() {
|
||||
data_ = NewArray<char>(ArchiveSpacePerThread());
|
||||
data_ = NewArray<char>(ArchiveSpacePerThread(Isolate::Current()));
|
||||
}
|
||||
|
||||
|
||||
@ -396,7 +396,7 @@ void ThreadManager::Iterate(ObjectVisitor* v) {
|
||||
char* data = state->data();
|
||||
data = HandleScopeImplementer::Iterate(v, data);
|
||||
data = isolate_->Iterate(v, data);
|
||||
data = Relocatable::Iterate(v, data);
|
||||
data = Relocatable::Iterate(Isolate::Current(), v, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user