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

Unified Diff: src/arm/code-stubs-arm.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
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | src/arm64/code-stubs-arm64.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/code-stubs-arm.h
diff --git a/src/arm/code-stubs-arm.h b/src/arm/code-stubs-arm.h
index 06265dd7f2289c036e34a5b52f451e494c9df90c..8a6f8d28857e00f9d9a9fe44275294684b4d0c2c 100644
--- a/src/arm/code-stubs-arm.h
+++ b/src/arm/code-stubs-arm.h
@@ -75,36 +75,39 @@ class StringHelper : public AllStatic {
// 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)
- : PlatformCodeStub(isolate),
- the_int_(the_int),
- the_heap_number_(the_heap_number),
- scratch_(scratch) { }
+ WriteInt32ToHeapNumberStub(Isolate* isolate, Register the_int,
+ Register the_heap_number, Register scratch)
+ : PlatformCodeStub(isolate) {
+ minor_key_ = IntRegisterBits::encode(the_int.code()) |
+ HeapNumberRegisterBits::encode(the_heap_number.code()) |
+ ScratchRegisterBits::encode(scratch.code());
+ }
static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
private:
- Register the_int_;
- Register the_heap_number_;
- Register scratch_;
+ 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_));
+ }
// Minor key encoding in 16 bits.
class IntRegisterBits: public BitField<int, 0, 4> {};
class HeapNumberRegisterBits: public BitField<int, 4, 4> {};
class ScratchRegisterBits: public BitField<int, 8, 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());
- }
-
- void Generate(MacroAssembler* masm);
+ DISALLOW_COPY_AND_ASSIGN(WriteInt32ToHeapNumberStub);
};
@@ -117,14 +120,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 {
@@ -254,6 +257,8 @@ class RecordWriteStub: public PlatformCodeStub {
kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
};
+ Major MajorKey() const { return RecordWrite; }
+
void Generate(MacroAssembler* masm);
void GenerateIncremental(MacroAssembler* masm, Mode mode);
void CheckNeedsToInformIncrementalMarker(
@@ -262,18 +267,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> {};
@@ -282,13 +297,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);
};
@@ -305,9 +317,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);
};
@@ -316,7 +329,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);
@@ -352,11 +367,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);
};
} } // namespace v8::internal
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | src/arm64/code-stubs-arm64.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698