Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Unified Diff: src/mips/code-stubs-mips.h

Issue 536193002: MIPS: Minor-key-ify remaining code stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/code-stubs-mips.h
diff --git a/src/mips/code-stubs-mips.h b/src/mips/code-stubs-mips.h
index 4a3833d2aae7ff2d46dc38ff02dccca11db40d22..acc9c6075d9c611c21edf05d278c3cae8f0eb022 100644
--- a/src/mips/code-stubs-mips.h
+++ b/src/mips/code-stubs-mips.h
@@ -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);
};
« no previous file with comments | « no previous file | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698