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