Commit e5aaf742 authored by akos.palfi@imgtec.com's avatar akos.palfi@imgtec.com

MIPS: Minor-key-ify remaining code stubs.

Port r23643 (0051736b)

BUG=
R=paul.lind@imgtec.com

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23668 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c25ba578
This diff is collapsed.
......@@ -104,29 +104,42 @@ class RestoreRegistersStateStub: public PlatformCodeStub {
// so you don't have to set up the frame.
class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
public:
WriteInt32ToHeapNumberStub(Isolate* isolate,
Register the_int,
Register the_heap_number,
Register scratch,
WriteInt32ToHeapNumberStub(Isolate* isolate, Register the_int,
Register the_heap_number, Register scratch,
Register scratch2)
: PlatformCodeStub(isolate),
the_int_(the_int),
the_heap_number_(the_heap_number),
scratch_(scratch),
sign_(scratch2) {
DCHECK(IntRegisterBits::is_valid(the_int_.code()));
DCHECK(HeapNumberRegisterBits::is_valid(the_heap_number_.code()));
DCHECK(ScratchRegisterBits::is_valid(scratch_.code()));
DCHECK(SignRegisterBits::is_valid(sign_.code()));
: PlatformCodeStub(isolate) {
minor_key_ = IntRegisterBits::encode(the_int.code()) |
HeapNumberRegisterBits::encode(the_heap_number.code()) |
ScratchRegisterBits::encode(scratch.code()) |
SignRegisterBits::encode(scratch2.code());
DCHECK(IntRegisterBits::is_valid(the_int.code()));
DCHECK(HeapNumberRegisterBits::is_valid(the_heap_number.code()));
DCHECK(ScratchRegisterBits::is_valid(scratch.code()));
DCHECK(SignRegisterBits::is_valid(scratch2.code()));
}
static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
private:
Register the_int_;
Register the_heap_number_;
Register scratch_;
Register sign_;
Major MajorKey() const { return WriteInt32ToHeapNumber; }
void Generate(MacroAssembler* masm);
Register the_int() const {
return Register::from_code(IntRegisterBits::decode(minor_key_));
}
Register the_heap_number() const {
return Register::from_code(HeapNumberRegisterBits::decode(minor_key_));
}
Register scratch() const {
return Register::from_code(ScratchRegisterBits::decode(minor_key_));
}
Register sign() const {
return Register::from_code(SignRegisterBits::decode(minor_key_));
}
// Minor key encoding in 16 bits.
class IntRegisterBits: public BitField<int, 0, 4> {};
......@@ -134,16 +147,7 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
class ScratchRegisterBits: public BitField<int, 8, 4> {};
class SignRegisterBits: public BitField<int, 12, 4> {};
Major MajorKey() const { return WriteInt32ToHeapNumber; }
uint32_t MinorKey() const {
// Encode the parameters in a unique 16 bit value.
return IntRegisterBits::encode(the_int_.code())
| HeapNumberRegisterBits::encode(the_heap_number_.code())
| ScratchRegisterBits::encode(scratch_.code())
| SignRegisterBits::encode(sign_.code());
}
void Generate(MacroAssembler* masm);
DISALLOW_COPY_AND_ASSIGN(WriteInt32ToHeapNumberStub);
};
......@@ -156,14 +160,14 @@ class RecordWriteStub: public PlatformCodeStub {
RememberedSetAction remembered_set_action,
SaveFPRegsMode fp_mode)
: PlatformCodeStub(isolate),
object_(object),
value_(value),
address_(address),
remembered_set_action_(remembered_set_action),
save_fp_regs_mode_(fp_mode),
regs_(object, // An input reg.
address, // An input reg.
value) { // One scratch reg.
minor_key_ = ObjectBits::encode(object.code()) |
ValueBits::encode(value.code()) |
AddressBits::encode(address.code()) |
RememberedSetActionBits::encode(remembered_set_action) |
SaveFPRegsModeBits::encode(fp_mode);
}
enum Mode {
......@@ -297,6 +301,8 @@ class RecordWriteStub: public PlatformCodeStub {
kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
};
Major MajorKey() const { return RecordWrite; }
void Generate(MacroAssembler* masm);
void GenerateIncremental(MacroAssembler* masm, Mode mode);
void CheckNeedsToInformIncrementalMarker(
......@@ -305,18 +311,28 @@ class RecordWriteStub: public PlatformCodeStub {
Mode mode);
void InformIncrementalMarker(MacroAssembler* masm);
Major MajorKey() const { return RecordWrite; }
void Activate(Code* code) {
code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code);
}
uint32_t MinorKey() const {
return ObjectBits::encode(object_.code()) |
ValueBits::encode(value_.code()) |
AddressBits::encode(address_.code()) |
RememberedSetActionBits::encode(remembered_set_action_) |
SaveFPRegsModeBits::encode(save_fp_regs_mode_);
Register object() const {
return Register::from_code(ObjectBits::decode(minor_key_));
}
void Activate(Code* code) {
code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code);
Register value() const {
return Register::from_code(ValueBits::decode(minor_key_));
}
Register address() const {
return Register::from_code(AddressBits::decode(minor_key_));
}
RememberedSetAction remembered_set_action() const {
return RememberedSetActionBits::decode(minor_key_);
}
SaveFPRegsMode save_fp_regs_mode() const {
return SaveFPRegsModeBits::decode(minor_key_);
}
class ObjectBits: public BitField<int, 0, 5> {};
......@@ -325,13 +341,10 @@ class RecordWriteStub: public PlatformCodeStub {
class RememberedSetActionBits: public BitField<RememberedSetAction, 15, 1> {};
class SaveFPRegsModeBits: public BitField<SaveFPRegsMode, 16, 1> {};
Register object_;
Register value_;
Register address_;
RememberedSetAction remembered_set_action_;
SaveFPRegsMode save_fp_regs_mode_;
Label slow_;
RegisterAllocation regs_;
DISALLOW_COPY_AND_ASSIGN(RecordWriteStub);
};
......@@ -348,9 +361,10 @@ class DirectCEntryStub: public PlatformCodeStub {
private:
Major MajorKey() const { return DirectCEntry; }
uint32_t MinorKey() const { return 0; }
bool NeedsImmovableCode() { return true; }
DISALLOW_COPY_AND_ASSIGN(DirectCEntryStub);
};
......@@ -359,7 +373,9 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP };
NameDictionaryLookupStub(Isolate* isolate, LookupMode mode)
: PlatformCodeStub(isolate), mode_(mode) { }
: PlatformCodeStub(isolate) {
minor_key_ = LookupModeBits::encode(mode);
}
void Generate(MacroAssembler* masm);
......@@ -395,11 +411,11 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
Major MajorKey() const { return NameDictionaryLookup; }
uint32_t MinorKey() const { return LookupModeBits::encode(mode_); }
LookupMode mode() const { return LookupModeBits::decode(minor_key_); }
class LookupModeBits: public BitField<LookupMode, 0, 1> {};
LookupMode mode_;
DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub);
};
......
This diff is collapsed.
......@@ -103,29 +103,42 @@ class RestoreRegistersStateStub: public PlatformCodeStub {
// so you don't have to set up the frame.
class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
public:
WriteInt32ToHeapNumberStub(Isolate* isolate,
Register the_int,
Register the_heap_number,
Register scratch,
WriteInt32ToHeapNumberStub(Isolate* isolate, Register the_int,
Register the_heap_number, Register scratch,
Register scratch2)
: PlatformCodeStub(isolate),
the_int_(the_int),
the_heap_number_(the_heap_number),
scratch_(scratch),
sign_(scratch2) {
DCHECK(IntRegisterBits::is_valid(the_int_.code()));
DCHECK(HeapNumberRegisterBits::is_valid(the_heap_number_.code()));
DCHECK(ScratchRegisterBits::is_valid(scratch_.code()));
DCHECK(SignRegisterBits::is_valid(sign_.code()));
: PlatformCodeStub(isolate) {
minor_key_ = IntRegisterBits::encode(the_int.code()) |
HeapNumberRegisterBits::encode(the_heap_number.code()) |
ScratchRegisterBits::encode(scratch.code()) |
SignRegisterBits::encode(scratch2.code());
DCHECK(IntRegisterBits::is_valid(the_int.code()));
DCHECK(HeapNumberRegisterBits::is_valid(the_heap_number.code()));
DCHECK(ScratchRegisterBits::is_valid(scratch.code()));
DCHECK(SignRegisterBits::is_valid(scratch2.code()));
}
static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
private:
Register the_int_;
Register the_heap_number_;
Register scratch_;
Register sign_;
Major MajorKey() const { return WriteInt32ToHeapNumber; }
void Generate(MacroAssembler* masm);
Register the_int() const {
return Register::from_code(IntRegisterBits::decode(minor_key_));
}
Register the_heap_number() const {
return Register::from_code(HeapNumberRegisterBits::decode(minor_key_));
}
Register scratch() const {
return Register::from_code(ScratchRegisterBits::decode(minor_key_));
}
Register sign() const {
return Register::from_code(SignRegisterBits::decode(minor_key_));
}
// Minor key encoding in 16 bits.
class IntRegisterBits: public BitField<int, 0, 4> {};
......@@ -133,16 +146,7 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub {
class ScratchRegisterBits: public BitField<int, 8, 4> {};
class SignRegisterBits: public BitField<int, 12, 4> {};
Major MajorKey() const { return WriteInt32ToHeapNumber; }
uint32_t MinorKey() const {
// Encode the parameters in a unique 16 bit value.
return IntRegisterBits::encode(the_int_.code())
| HeapNumberRegisterBits::encode(the_heap_number_.code())
| ScratchRegisterBits::encode(scratch_.code())
| SignRegisterBits::encode(sign_.code());
}
void Generate(MacroAssembler* masm);
DISALLOW_COPY_AND_ASSIGN(WriteInt32ToHeapNumberStub);
};
......@@ -155,14 +159,14 @@ class RecordWriteStub: public PlatformCodeStub {
RememberedSetAction remembered_set_action,
SaveFPRegsMode fp_mode)
: PlatformCodeStub(isolate),
object_(object),
value_(value),
address_(address),
remembered_set_action_(remembered_set_action),
save_fp_regs_mode_(fp_mode),
regs_(object, // An input reg.
address, // An input reg.
value) { // One scratch reg.
minor_key_ = ObjectBits::encode(object.code()) |
ValueBits::encode(value.code()) |
AddressBits::encode(address.code()) |
RememberedSetActionBits::encode(remembered_set_action) |
SaveFPRegsModeBits::encode(fp_mode);
}
enum Mode {
......@@ -296,6 +300,8 @@ class RecordWriteStub: public PlatformCodeStub {
kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
};
Major MajorKey() const { return RecordWrite; }
void Generate(MacroAssembler* masm);
void GenerateIncremental(MacroAssembler* masm, Mode mode);
void CheckNeedsToInformIncrementalMarker(
......@@ -304,18 +310,28 @@ class RecordWriteStub: public PlatformCodeStub {
Mode mode);
void InformIncrementalMarker(MacroAssembler* masm);
Major MajorKey() const { return RecordWrite; }
void Activate(Code* code) {
code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code);
}
uint32_t MinorKey() const {
return ObjectBits::encode(object_.code()) |
ValueBits::encode(value_.code()) |
AddressBits::encode(address_.code()) |
RememberedSetActionBits::encode(remembered_set_action_) |
SaveFPRegsModeBits::encode(save_fp_regs_mode_);
Register object() const {
return Register::from_code(ObjectBits::decode(minor_key_));
}
void Activate(Code* code) {
code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code);
Register value() const {
return Register::from_code(ValueBits::decode(minor_key_));
}
Register address() const {
return Register::from_code(AddressBits::decode(minor_key_));
}
RememberedSetAction remembered_set_action() const {
return RememberedSetActionBits::decode(minor_key_);
}
SaveFPRegsMode save_fp_regs_mode() const {
return SaveFPRegsModeBits::decode(minor_key_);
}
class ObjectBits: public BitField<int, 0, 5> {};
......@@ -324,13 +340,10 @@ class RecordWriteStub: public PlatformCodeStub {
class RememberedSetActionBits: public BitField<RememberedSetAction, 15, 1> {};
class SaveFPRegsModeBits: public BitField<SaveFPRegsMode, 16, 1> {};
Register object_;
Register value_;
Register address_;
RememberedSetAction remembered_set_action_;
SaveFPRegsMode save_fp_regs_mode_;
Label slow_;
RegisterAllocation regs_;
DISALLOW_COPY_AND_ASSIGN(RecordWriteStub);
};
......@@ -347,9 +360,10 @@ class DirectCEntryStub: public PlatformCodeStub {
private:
Major MajorKey() const { return DirectCEntry; }
uint32_t MinorKey() const { return 0; }
bool NeedsImmovableCode() { return true; }
DISALLOW_COPY_AND_ASSIGN(DirectCEntryStub);
};
......@@ -358,7 +372,9 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP };
NameDictionaryLookupStub(Isolate* isolate, LookupMode mode)
: PlatformCodeStub(isolate), mode_(mode) { }
: PlatformCodeStub(isolate) {
minor_key_ = LookupModeBits::encode(mode);
}
void Generate(MacroAssembler* masm);
......@@ -394,11 +410,11 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
Major MajorKey() const { return NameDictionaryLookup; }
uint32_t MinorKey() const { return LookupModeBits::encode(mode_); }
LookupMode mode() const { return LookupModeBits::decode(minor_key_); }
class LookupModeBits: public BitField<LookupMode, 0, 1> {};
LookupMode mode_;
DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub);
};
......
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