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

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

Issue 535733004: 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
Index: src/x64/code-stubs-x64.h
diff --git a/src/x64/code-stubs-x64.h b/src/x64/code-stubs-x64.h
index d4f6be13319b22dd6ff0d26a64c1d75961d97b69..bcbf220394116ec8ea648d5e5157547994634340 100644
--- a/src/x64/code-stubs-x64.h
+++ b/src/x64/code-stubs-x64.h
@@ -71,16 +71,13 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
public:
enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP };
- NameDictionaryLookupStub(Isolate* isolate,
- Register dictionary,
- Register result,
- Register index,
- LookupMode mode)
- : PlatformCodeStub(isolate),
- dictionary_(dictionary),
- result_(result),
- index_(index),
- mode_(mode) { }
+ NameDictionaryLookupStub(Isolate* isolate, Register dictionary,
+ Register result, Register index, LookupMode mode)
+ : PlatformCodeStub(isolate) {
+ minor_key_ = DictionaryBits::encode(dictionary.code()) |
+ ResultBits::encode(result.code()) |
+ IndexBits::encode(index.code()) | LookupModeBits::encode(mode);
+ }
void Generate(MacroAssembler* masm);
@@ -115,42 +112,43 @@ class NameDictionaryLookupStub: public PlatformCodeStub {
Major MajorKey() const { return NameDictionaryLookup; }
- uint32_t MinorKey() const {
- return DictionaryBits::encode(dictionary_.code()) |
- ResultBits::encode(result_.code()) |
- IndexBits::encode(index_.code()) |
- LookupModeBits::encode(mode_);
+ Register dictionary() const {
+ return Register::from_code(DictionaryBits::decode(minor_key_));
+ }
+
+ Register result() const {
+ return Register::from_code(ResultBits::decode(minor_key_));
+ }
+
+ Register index() const {
+ return Register::from_code(IndexBits::decode(minor_key_));
}
+ LookupMode mode() const { return LookupModeBits::decode(minor_key_); }
+
class DictionaryBits: public BitField<int, 0, 4> {};
class ResultBits: public BitField<int, 4, 4> {};
class IndexBits: public BitField<int, 8, 4> {};
class LookupModeBits: public BitField<LookupMode, 12, 1> {};
- Register dictionary_;
- Register result_;
- Register index_;
- LookupMode mode_;
+ DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub);
};
class RecordWriteStub: public PlatformCodeStub {
public:
- RecordWriteStub(Isolate* isolate,
- Register object,
- Register value,
- Register address,
- RememberedSetAction remembered_set_action,
+ RecordWriteStub(Isolate* isolate, Register object, Register value,
+ Register address, 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 {
@@ -336,6 +334,8 @@ class RecordWriteStub: public PlatformCodeStub {
kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
};
+ Major MajorKey() const { return RecordWrite; }
+
void Generate(MacroAssembler* masm);
void GenerateIncremental(MacroAssembler* masm, Mode mode);
void CheckNeedsToInformIncrementalMarker(
@@ -344,18 +344,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, 4> {};
@@ -364,13 +374,10 @@ class RecordWriteStub: public PlatformCodeStub {
class RememberedSetActionBits: public BitField<RememberedSetAction, 12, 1> {};
class SaveFPRegsModeBits: public BitField<SaveFPRegsMode, 13, 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);
};

Powered by Google App Engine
This is Rietveld 408576698