Commit ef32bb46 authored by palfia@homejinni.com's avatar palfia@homejinni.com

MIPS: remove most uses of Isolate::Current in arch specific files.

Port r16643 (b818da5)

BUG=
R=gergely@homejinni.com

Review URL: https://codereview.chromium.org/24108002

Patch from Balazs Kilvady <kilvadyb@homejinni.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16657 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f81ac266
...@@ -338,7 +338,7 @@ bool RelocInfo::IsPatchedDebugBreakSlotSequence() { ...@@ -338,7 +338,7 @@ bool RelocInfo::IsPatchedDebugBreakSlotSequence() {
} }
void RelocInfo::Visit(ObjectVisitor* visitor) { void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) {
RelocInfo::Mode mode = rmode(); RelocInfo::Mode mode = rmode();
if (mode == RelocInfo::EMBEDDED_OBJECT) { if (mode == RelocInfo::EMBEDDED_OBJECT) {
visitor->VisitEmbeddedPointer(this); visitor->VisitEmbeddedPointer(this);
...@@ -351,12 +351,11 @@ void RelocInfo::Visit(ObjectVisitor* visitor) { ...@@ -351,12 +351,11 @@ void RelocInfo::Visit(ObjectVisitor* visitor) {
} else if (RelocInfo::IsCodeAgeSequence(mode)) { } else if (RelocInfo::IsCodeAgeSequence(mode)) {
visitor->VisitCodeAgeSequence(this); visitor->VisitCodeAgeSequence(this);
#ifdef ENABLE_DEBUGGER_SUPPORT #ifdef ENABLE_DEBUGGER_SUPPORT
// TODO(isolates): Get a cached isolate below.
} else if (((RelocInfo::IsJSReturn(mode) && } else if (((RelocInfo::IsJSReturn(mode) &&
IsPatchedReturnSequence()) || IsPatchedReturnSequence()) ||
(RelocInfo::IsDebugBreakSlot(mode) && (RelocInfo::IsDebugBreakSlot(mode) &&
IsPatchedDebugBreakSlotSequence())) && IsPatchedDebugBreakSlotSequence())) &&
Isolate::Current()->debug()->has_break_points()) { isolate->debug()->has_break_points()) {
visitor->VisitDebugTarget(this); visitor->VisitDebugTarget(this);
#endif #endif
} else if (RelocInfo::IsRuntimeEntry(mode)) { } else if (RelocInfo::IsRuntimeEntry(mode)) {
......
...@@ -238,15 +238,12 @@ void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) { ...@@ -238,15 +238,12 @@ void RelocInfo::PatchCodeWithCall(Address target, int guard_bytes) {
// See assembler-mips-inl.h for inlined constructors. // See assembler-mips-inl.h for inlined constructors.
Operand::Operand(Handle<Object> handle) { Operand::Operand(Handle<Object> handle) {
#ifdef DEBUG
Isolate* isolate = Isolate::Current();
#endif
AllowDeferredHandleDereference using_raw_address; AllowDeferredHandleDereference using_raw_address;
rm_ = no_reg; rm_ = no_reg;
// Verify all Objects referred by code are NOT in new space. // Verify all Objects referred by code are NOT in new space.
Object* obj = *handle; Object* obj = *handle;
ASSERT(!isolate->heap()->InNewSpace(obj));
if (obj->IsHeapObject()) { if (obj->IsHeapObject()) {
ASSERT(!HeapObject::cast(obj)->GetHeap()->InNewSpace(obj));
imm32_ = reinterpret_cast<intptr_t>(handle.location()); imm32_ = reinterpret_cast<intptr_t>(handle.location());
rmode_ = RelocInfo::EMBEDDED_OBJECT; rmode_ = RelocInfo::EMBEDDED_OBJECT;
} else { } else {
......
...@@ -649,7 +649,7 @@ void DoubleToIStub::Generate(MacroAssembler* masm) { ...@@ -649,7 +649,7 @@ void DoubleToIStub::Generate(MacroAssembler* masm) {
} }
bool WriteInt32ToHeapNumberStub::IsPregenerated() { bool WriteInt32ToHeapNumberStub::IsPregenerated(Isolate* isolate) {
// These variants are compiled ahead of time. See next method. // These variants are compiled ahead of time. See next method.
if (the_int_.is(a1) && if (the_int_.is(a1) &&
the_heap_number_.is(v0) && the_heap_number_.is(v0) &&
...@@ -2723,8 +2723,8 @@ bool CEntryStub::NeedsImmovableCode() { ...@@ -2723,8 +2723,8 @@ bool CEntryStub::NeedsImmovableCode() {
} }
bool CEntryStub::IsPregenerated() { bool CEntryStub::IsPregenerated(Isolate* isolate) {
return (!save_doubles_ || Isolate::Current()->fp_stubs_generated()) && return (!save_doubles_ || isolate->fp_stubs_generated()) &&
result_size_ == 1; result_size_ == 1;
} }
...@@ -6585,7 +6585,7 @@ static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = { ...@@ -6585,7 +6585,7 @@ static const AheadOfTimeWriteBarrierStubList kAheadOfTime[] = {
#undef REG #undef REG
bool RecordWriteStub::IsPregenerated() { bool RecordWriteStub::IsPregenerated(Isolate* isolate) {
for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime; for (const AheadOfTimeWriteBarrierStubList* entry = kAheadOfTime;
!entry->object.is(no_reg); !entry->object.is(no_reg);
entry++) { entry++) {
......
...@@ -69,7 +69,7 @@ class StoreBufferOverflowStub: public PlatformCodeStub { ...@@ -69,7 +69,7 @@ class StoreBufferOverflowStub: public PlatformCodeStub {
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);
virtual bool IsPregenerated() { return true; } virtual bool IsPregenerated(Isolate* isolate) V8_OVERRIDE { return true; }
static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
virtual bool SometimesSetsUpAFrame() { return false; } virtual bool SometimesSetsUpAFrame() { return false; }
...@@ -240,7 +240,7 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub { ...@@ -240,7 +240,7 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
ASSERT(SignRegisterBits::is_valid(sign_.code())); ASSERT(SignRegisterBits::is_valid(sign_.code()));
} }
bool IsPregenerated(); virtual bool IsPregenerated(Isolate* isolate) V8_OVERRIDE;
static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
private: private:
...@@ -316,7 +316,7 @@ class RecordWriteStub: public PlatformCodeStub { ...@@ -316,7 +316,7 @@ class RecordWriteStub: public PlatformCodeStub {
INCREMENTAL_COMPACTION INCREMENTAL_COMPACTION
}; };
virtual bool IsPregenerated(); virtual bool IsPregenerated(Isolate* isolate) V8_OVERRIDE;
static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
virtual bool SometimesSetsUpAFrame() { return false; } virtual bool SometimesSetsUpAFrame() { return false; }
......
...@@ -60,7 +60,7 @@ void BreakLocationIterator::SetDebugBreakAtReturn() { ...@@ -60,7 +60,7 @@ void BreakLocationIterator::SetDebugBreakAtReturn() {
// li and Call pseudo-instructions emit two instructions each. // li and Call pseudo-instructions emit two instructions each.
patcher.masm()->li(v8::internal::t9, patcher.masm()->li(v8::internal::t9,
Operand(reinterpret_cast<int32_t>( Operand(reinterpret_cast<int32_t>(
Isolate::Current()->debug()->debug_break_return()->entry()))); debug_info_->GetIsolate()->debug()->debug_break_return()->entry())));
patcher.masm()->Call(v8::internal::t9); patcher.masm()->Call(v8::internal::t9);
patcher.masm()->nop(); patcher.masm()->nop();
patcher.masm()->nop(); patcher.masm()->nop();
...@@ -105,7 +105,7 @@ void BreakLocationIterator::SetDebugBreakAtSlot() { ...@@ -105,7 +105,7 @@ void BreakLocationIterator::SetDebugBreakAtSlot() {
// call t9 (jalr t9 / nop instruction pair) // call t9 (jalr t9 / nop instruction pair)
CodePatcher patcher(rinfo()->pc(), Assembler::kDebugBreakSlotInstructions); CodePatcher patcher(rinfo()->pc(), Assembler::kDebugBreakSlotInstructions);
patcher.masm()->li(v8::internal::t9, Operand(reinterpret_cast<int32_t>( patcher.masm()->li(v8::internal::t9, Operand(reinterpret_cast<int32_t>(
Isolate::Current()->debug()->debug_break_slot()->entry()))); debug_info_->GetIsolate()->debug()->debug_break_slot()->entry())));
patcher.masm()->Call(v8::internal::t9); patcher.masm()->Call(v8::internal::t9);
} }
......
...@@ -359,7 +359,7 @@ void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm, ...@@ -359,7 +359,7 @@ void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm,
extra_state, extra_state,
Code::NORMAL, Code::NORMAL,
argc); argc);
Isolate::Current()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, a1, a2, a3, t0, t1, t2); masm, flags, a1, a2, a3, t0, t1, t2);
// If the stub cache probing failed, the receiver might be a value. // If the stub cache probing failed, the receiver might be a value.
...@@ -395,7 +395,7 @@ void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm, ...@@ -395,7 +395,7 @@ void CallICBase::GenerateMonomorphicCacheProbe(MacroAssembler* masm,
// Probe the stub cache for the value object. // Probe the stub cache for the value object.
__ bind(&probe); __ bind(&probe);
Isolate::Current()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, a1, a2, a3, t0, t1, t2); masm, flags, a1, a2, a3, t0, t1, t2);
__ bind(&miss); __ bind(&miss);
...@@ -658,7 +658,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { ...@@ -658,7 +658,7 @@ void LoadIC::GenerateMegamorphic(MacroAssembler* masm) {
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, Code::kNoExtraICState, Code::STUB, MONOMORPHIC, Code::kNoExtraICState,
Code::NORMAL, Code::LOAD_IC); Code::NORMAL, Code::LOAD_IC);
Isolate::Current()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, a0, a2, a3, t0, t1, t2); masm, flags, a0, a2, a3, t0, t1, t2);
// Cache miss: Jump to runtime. // Cache miss: Jump to runtime.
...@@ -1498,7 +1498,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm, ...@@ -1498,7 +1498,7 @@ void StoreIC::GenerateMegamorphic(MacroAssembler* masm,
Code::Flags flags = Code::ComputeFlags( Code::Flags flags = Code::ComputeFlags(
Code::STUB, MONOMORPHIC, strict_mode, Code::STUB, MONOMORPHIC, strict_mode,
Code::NORMAL, Code::STORE_IC); Code::NORMAL, Code::STORE_IC);
Isolate::Current()->stub_cache()->GenerateProbe( masm->isolate()->stub_cache()->GenerateProbe(
masm, flags, a1, a2, a3, t0, t1, t2); masm, flags, a1, a2, a3, t0, t1, t2);
// Cache miss: Jump to runtime. // Cache miss: Jump to runtime.
......
...@@ -882,7 +882,7 @@ Handle<HeapObject> RegExpMacroAssemblerMIPS::GetCode(Handle<String> source) { ...@@ -882,7 +882,7 @@ Handle<HeapObject> RegExpMacroAssemblerMIPS::GetCode(Handle<String> source) {
masm_->GetCode(&code_desc); masm_->GetCode(&code_desc);
Handle<Code> code = isolate()->factory()->NewCode( Handle<Code> code = isolate()->factory()->NewCode(
code_desc, Code::ComputeFlags(Code::REGEXP), masm_->CodeObject()); code_desc, Code::ComputeFlags(Code::REGEXP), masm_->CodeObject());
LOG(Isolate::Current(), RegExpCodeCreateEvent(*code, *source)); LOG(masm_->isolate(), RegExpCodeCreateEvent(*code, *source));
return Handle<HeapObject>::cast(code); return Handle<HeapObject>::cast(code);
} }
...@@ -1086,7 +1086,6 @@ int RegExpMacroAssemblerMIPS::CheckStackGuardState(Address* return_address, ...@@ -1086,7 +1086,6 @@ int RegExpMacroAssemblerMIPS::CheckStackGuardState(Address* return_address,
Code* re_code, Code* re_code,
Address re_frame) { Address re_frame) {
Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate); Isolate* isolate = frame_entry<Isolate*>(re_frame, kIsolate);
ASSERT(isolate == Isolate::Current());
if (isolate->stack_guard()->IsStackOverflow()) { if (isolate->stack_guard()->IsStackOverflow()) {
isolate->StackOverflow(); isolate->StackOverflow();
return EXCEPTION; return EXCEPTION;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment