Commit fc90c556 authored by paul.lind@imgtec.com's avatar paul.lind@imgtec.com

MIPS: Unify JSEntryStub and JSConstructEntryStub, and some more code stub cleanups.

Port r23742 (a68a0c0)

BUG=
R=paul.lind@imgtec.com

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

Patch from Balazs Kilvady <balazs.kilvady@imgtec.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23749 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8c82d6c2
......@@ -1255,7 +1255,7 @@ void CEntryStub::Generate(MacroAssembler* masm) {
}
void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
void JSEntryStub::Generate(MacroAssembler* masm) {
Label invoke, handler_entry, exit;
Isolate* isolate = masm->isolate();
......@@ -1289,7 +1289,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
// We build an EntryFrame.
__ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used.
int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY;
int marker = type();
__ li(t2, Operand(Smi::FromInt(marker)));
__ li(t1, Operand(Smi::FromInt(marker)));
__ li(t0, Operand(ExternalReference(Isolate::kCEntryFPAddress,
......@@ -1380,7 +1380,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
// 4 args slots
// args
if (is_construct) {
if (type() == StackFrame::ENTRY_CONSTRUCT) {
ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline,
isolate);
__ li(t0, Operand(construct_entry));
......
......@@ -64,9 +64,7 @@ class StoreRegistersStateStub: public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
private:
void Generate(MacroAssembler* masm);
DEFINE_CODE_STUB(StoreRegistersState, PlatformCodeStub);
DEFINE_PLATFORM_CODE_STUB(StoreRegistersState, PlatformCodeStub);
};
......@@ -78,9 +76,7 @@ class RestoreRegistersStateStub: public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
private:
void Generate(MacroAssembler* masm);
DEFINE_CODE_STUB(RestoreRegistersState, PlatformCodeStub);
DEFINE_PLATFORM_CODE_STUB(RestoreRegistersState, PlatformCodeStub);
};
......@@ -106,8 +102,6 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
private:
void Generate(MacroAssembler* masm);
Register the_int() const {
return Register::from_code(IntRegisterBits::decode(minor_key_));
}
......@@ -130,7 +124,7 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
class ScratchRegisterBits: public BitField<int, 8, 4> {};
class SignRegisterBits: public BitField<int, 12, 4> {};
DEFINE_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub);
DEFINE_PLATFORM_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub);
};
......@@ -289,7 +283,7 @@ class RecordWriteStub: public PlatformCodeStub {
virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; }
void Generate(MacroAssembler* masm);
virtual void Generate(MacroAssembler* masm) OVERRIDE;
void GenerateIncremental(MacroAssembler* masm, Mode mode);
void CheckNeedsToInformIncrementalMarker(
MacroAssembler* masm,
......@@ -342,13 +336,12 @@ class RecordWriteStub: public PlatformCodeStub {
class DirectCEntryStub: public PlatformCodeStub {
public:
explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
void Generate(MacroAssembler* masm);
void GenerateCall(MacroAssembler* masm, Register target);
private:
bool NeedsImmovableCode() { return true; }
DEFINE_CODE_STUB(DirectCEntry, PlatformCodeStub);
DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub);
};
......@@ -361,8 +354,6 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
minor_key_ = LookupModeBits::encode(mode);
}
void Generate(MacroAssembler* masm);
static void GenerateNegativeLookup(MacroAssembler* masm,
Label* miss,
Label* done,
......@@ -397,7 +388,7 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
class LookupModeBits: public BitField<LookupMode, 0, 1> {};
DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub);
DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub);
};
......
......@@ -1248,7 +1248,7 @@ void CEntryStub::Generate(MacroAssembler* masm) {
}
void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
void JSEntryStub::Generate(MacroAssembler* masm) {
Label invoke, handler_entry, exit;
Isolate* isolate = masm->isolate();
......@@ -1288,7 +1288,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
// We build an EntryFrame.
__ li(a7, Operand(-1)); // Push a bad frame pointer to fail if it is used.
int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY;
int marker = type();
__ li(a6, Operand(Smi::FromInt(marker)));
__ li(a5, Operand(Smi::FromInt(marker)));
ExternalReference c_entry_fp(Isolate::kCEntryFPAddress, isolate);
......@@ -1379,7 +1379,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
// [ O32: 4 args slots]
// args
if (is_construct) {
if (type() == StackFrame::ENTRY_CONSTRUCT) {
ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline,
isolate);
__ li(a4, Operand(construct_entry));
......
......@@ -65,9 +65,7 @@ class StoreRegistersStateStub: public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
private:
void Generate(MacroAssembler* masm);
DEFINE_CODE_STUB(StoreRegistersState, PlatformCodeStub);
DEFINE_PLATFORM_CODE_STUB(StoreRegistersState, PlatformCodeStub);
};
......@@ -79,9 +77,7 @@ class RestoreRegistersStateStub: public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
private:
void Generate(MacroAssembler* masm);
DEFINE_CODE_STUB(RestoreRegistersState, PlatformCodeStub);
DEFINE_PLATFORM_CODE_STUB(RestoreRegistersState, PlatformCodeStub);
};
// This stub can convert a signed int32 to a heap number (double). It does
......@@ -289,7 +285,7 @@ class RecordWriteStub: public PlatformCodeStub {
virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; }
void Generate(MacroAssembler* masm);
virtual void Generate(MacroAssembler* masm) OVERRIDE;
void GenerateIncremental(MacroAssembler* masm, Mode mode);
void CheckNeedsToInformIncrementalMarker(
MacroAssembler* masm,
......@@ -342,13 +338,12 @@ class RecordWriteStub: public PlatformCodeStub {
class DirectCEntryStub: public PlatformCodeStub {
public:
explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
void Generate(MacroAssembler* masm);
void GenerateCall(MacroAssembler* masm, Register target);
private:
bool NeedsImmovableCode() { return true; }
DEFINE_CODE_STUB(DirectCEntry, PlatformCodeStub);
DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub);
};
......@@ -361,8 +356,6 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
minor_key_ = LookupModeBits::encode(mode);
}
void Generate(MacroAssembler* masm);
static void GenerateNegativeLookup(MacroAssembler* masm,
Label* miss,
Label* done,
......@@ -397,7 +390,7 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
class LookupModeBits: public BitField<LookupMode, 0, 1> {};
DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub);
DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub);
};
......
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