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

Unified Diff: src/ia32/code-stubs-ia32.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/ia32/code-stubs-ia32.h
diff --git a/src/ia32/code-stubs-ia32.h b/src/ia32/code-stubs-ia32.h
index bc08cb0f6d7ed4346db163ad157cb6811a6c5df4..1e5c6cc3b6a1f539478789d0fed3c4f209a2a7ae 100644
--- a/src/ia32/code-stubs-ia32.h
+++ b/src/ia32/code-stubs-ia32.h
@@ -75,13 +75,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);
@@ -116,22 +116,26 @@ 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, 3> {};
class ResultBits: public BitField<int, 3, 3> {};
class IndexBits: public BitField<int, 6, 3> {};
class LookupModeBits: public BitField<LookupMode, 9, 1> {};
- Register dictionary_;
- Register result_;
- Register index_;
- LookupMode mode_;
+ DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub);
};
@@ -144,14 +148,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 {
@@ -353,8 +357,10 @@ class RecordWriteStub: public PlatformCodeStub {
enum OnNoNeedToInformIncrementalMarker {
kReturnOnNoNeedToInformIncrementalMarker,
kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
- }
-;
+ };
+
+ Major MajorKey() const { return RecordWrite; }
+
void Generate(MacroAssembler* masm);
void GenerateIncremental(MacroAssembler* masm, Mode mode);
void CheckNeedsToInformIncrementalMarker(
@@ -363,18 +369,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, 3> {};
@@ -383,12 +399,9 @@ class RecordWriteStub: public PlatformCodeStub {
class RememberedSetActionBits: public BitField<RememberedSetAction, 9, 1> {};
class SaveFPRegsModeBits: public BitField<SaveFPRegsMode, 10, 1> {};
- Register object_;
- Register value_;
- Register address_;
- RememberedSetAction remembered_set_action_;
- SaveFPRegsMode save_fp_regs_mode_;
RegisterAllocation regs_;
+
+ DISALLOW_COPY_AND_ASSIGN(RecordWriteStub);
};

Powered by Google App Engine
This is Rietveld 408576698