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

Unified Diff: src/code-stubs.h

Issue 500983002: Revert "Encode CEntryStub properties in the minor key." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | « src/arm64/code-stubs-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 138154ce918819e11bc98800ae7ba500aeb607f0..4d021c2dc7dbe19c901d15753d288c1e8ad506ee 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -150,7 +150,7 @@ class CodeStub BASE_EMBEDDED {
static Major MajorKeyFromKey(uint32_t key) {
return static_cast<Major>(MajorKeyBits::decode(key));
}
- static uint32_t MinorKeyFromKey(uint32_t key) {
+ static int MinorKeyFromKey(uint32_t key) {
return MinorKeyBits::decode(key);
}
@@ -163,7 +163,7 @@ class CodeStub BASE_EMBEDDED {
static const char* MajorName(Major major_key, bool allow_unknown_keys);
- explicit CodeStub(Isolate* isolate) : minor_key_(0), isolate_(isolate) {}
+ explicit CodeStub(Isolate* isolate) : isolate_(isolate) { }
virtual ~CodeStub() {}
static void GenerateStubsAheadOfTime(Isolate* isolate);
@@ -182,7 +182,7 @@ class CodeStub BASE_EMBEDDED {
// Returns information for computing the number key.
virtual Major MajorKey() const = 0;
- virtual uint32_t MinorKey() const { return minor_key_; }
+ virtual int MinorKey() const = 0;
virtual InlineCacheState GetICState() const { return UNINITIALIZED; }
virtual ExtraICState GetExtraICState() const { return kNoExtraICState; }
@@ -215,8 +215,6 @@ class CodeStub BASE_EMBEDDED {
return MinorKeyBits::encode(MinorKey()) | MajorKeyBits::encode(MajorKey());
}
- uint32_t minor_key_;
-
private:
// Perform bookkeeping required after code generation when stub code is
// initially generated.
@@ -478,7 +476,7 @@ class HydrogenCodeStub : public CodeStub {
class IsMissBits: public BitField<bool, kStubMinorKeyBits - 1, 1> {};
void GenerateLightweightMiss(MacroAssembler* masm);
- virtual uint32_t MinorKey() const {
+ virtual int MinorKey() const {
return IsMissBits::encode(is_uninitialized_) |
MinorKeyBits::encode(NotMissMinorKey());
}
@@ -755,7 +753,7 @@ class InstanceofStub: public PlatformCodeStub {
private:
Major MajorKey() const { return Instanceof; }
- uint32_t MinorKey() const { return static_cast<int>(flags_); }
+ int MinorKey() const { return static_cast<int>(flags_); }
bool HasArgsInRegisters() const {
return (flags_ & kArgsInRegisters) != 0;
@@ -796,7 +794,7 @@ class ArrayConstructorStub: public PlatformCodeStub {
virtual void PrintName(OStream& os) const V8_OVERRIDE; // NOLINT
virtual CodeStub::Major MajorKey() const { return ArrayConstructor; }
- virtual uint32_t MinorKey() const { return argument_count_; }
+ virtual int MinorKey() const { return argument_count_; }
ArgumentCountKey argument_count_;
};
@@ -810,7 +808,7 @@ class InternalArrayConstructorStub: public PlatformCodeStub {
private:
virtual CodeStub::Major MajorKey() const { return InternalArrayConstructor; }
- virtual uint32_t MinorKey() const { return 0; }
+ virtual int MinorKey() const { return 0; }
void GenerateCase(MacroAssembler* masm, ElementsKind kind);
};
@@ -826,7 +824,7 @@ class MathPowStub: public PlatformCodeStub {
private:
virtual CodeStub::Major MajorKey() const { return MathPow; }
- virtual uint32_t MinorKey() const { return exponent_type_; }
+ virtual int MinorKey() const { return exponent_type_; }
ExponentType exponent_type_;
};
@@ -859,7 +857,7 @@ class CallICStub: public PlatformCodeStub {
}
protected:
- virtual uint32_t MinorKey() const { return GetExtraICState(); }
+ virtual int MinorKey() const { return GetExtraICState(); }
virtual void PrintState(OStream& os) const V8_OVERRIDE; // NOLINT
virtual CodeStub::Major MajorKey() const { return CallIC; }
@@ -899,7 +897,7 @@ class FunctionPrototypeStub : public PlatformCodeStub {
private:
virtual CodeStub::Major MajorKey() const { return FunctionPrototype; }
- virtual uint32_t MinorKey() const { return 0; }
+ virtual int MinorKey() const { return 0; }
};
@@ -1085,7 +1083,7 @@ class CallApiFunctionStub : public PlatformCodeStub {
private:
virtual void Generate(MacroAssembler* masm) V8_OVERRIDE;
virtual Major MajorKey() const V8_OVERRIDE { return CallApiFunction; }
- virtual uint32_t MinorKey() const V8_OVERRIDE { return bit_field_; }
+ virtual int MinorKey() const V8_OVERRIDE { return bit_field_; }
class IsStoreBits: public BitField<bool, 0, 1> {};
class CallDataUndefinedBits: public BitField<bool, 1, 1> {};
@@ -1104,7 +1102,7 @@ class CallApiGetterStub : public PlatformCodeStub {
private:
virtual void Generate(MacroAssembler* masm) V8_OVERRIDE;
virtual Major MajorKey() const V8_OVERRIDE { return CallApiGetter; }
- virtual uint32_t MinorKey() const V8_OVERRIDE { return 0; }
+ virtual int MinorKey() const V8_OVERRIDE { return 0; }
DISALLOW_COPY_AND_ASSIGN(CallApiGetterStub);
};
@@ -1198,7 +1196,7 @@ class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub {
virtual Major MajorKey() const V8_OVERRIDE {
return BinaryOpICWithAllocationSite;
}
- virtual uint32_t MinorKey() const V8_OVERRIDE { return GetExtraICState(); }
+ virtual int MinorKey() const V8_OVERRIDE { return GetExtraICState(); }
private:
static void GenerateAheadOfTime(Isolate* isolate,
@@ -1329,7 +1327,7 @@ class ICCompareStub: public PlatformCodeStub {
class HandlerStateField: public BitField<int, 11, 4> { };
virtual CodeStub::Major MajorKey() const { return CompareIC; }
- virtual uint32_t MinorKey() const;
+ virtual int MinorKey() const;
virtual Code::Kind GetCodeKind() const { return Code::COMPARE_IC; }
@@ -1462,15 +1460,12 @@ OStream& operator<<(OStream& os, const CompareNilICStub::State& s);
class CEntryStub : public PlatformCodeStub {
public:
- CEntryStub(Isolate* isolate, int result_size,
+ CEntryStub(Isolate* isolate,
+ int result_size,
SaveFPRegsMode save_doubles = kDontSaveFPRegs)
- : PlatformCodeStub(isolate) {
- minor_key_ = SaveDoublesBits::encode(save_doubles == kSaveFPRegs);
- DCHECK(result_size == 1 || result_size == 2);
-#ifdef _WIN64
- minor_key_ = ResultSizeBits::update(minor_key_, result_size);
-#endif // _WIN64
- }
+ : PlatformCodeStub(isolate),
+ result_size_(result_size),
+ save_doubles_(save_doubles) { }
void Generate(MacroAssembler* masm);
@@ -1481,17 +1476,14 @@ class CEntryStub : public PlatformCodeStub {
static void GenerateAheadOfTime(Isolate* isolate);
private:
- Major MajorKey() const { return CEntry; }
+ // Number of pointers/values returned.
+ const int result_size_;
+ SaveFPRegsMode save_doubles_;
- bool save_doubles() const { return SaveDoublesBits::decode(minor_key_); }
-#ifdef _WIN64
- int result_size() const { ResultSizeBits::decode(minor_key_); }
-#endif // _WIN64
+ Major MajorKey() const { return CEntry; }
+ int MinorKey() const;
bool NeedsImmovableCode();
-
- class SaveDoublesBits : public BitField<bool, 0, 1> {};
- class ResultSizeBits : public BitField<int, 3, 1> {};
};
@@ -1506,7 +1498,7 @@ class JSEntryStub : public PlatformCodeStub {
private:
Major MajorKey() const { return JSEntry; }
- uint32_t MinorKey() const { return 0; }
+ int MinorKey() const { return 0; }
virtual void FinishCode(Handle<Code> code);
@@ -1521,7 +1513,7 @@ class JSConstructEntryStub : public JSEntryStub {
void Generate(MacroAssembler* masm) { GenerateBody(masm, true); }
private:
- uint32_t MinorKey() const { return 1; }
+ int MinorKey() const { return 1; }
virtual void PrintName(OStream& os) const V8_OVERRIDE { // NOLINT
os << "JSConstructEntryStub";
@@ -1545,7 +1537,7 @@ class ArgumentsAccessStub: public PlatformCodeStub {
Type type_;
Major MajorKey() const { return ArgumentsAccess; }
- uint32_t MinorKey() const { return type_; }
+ int MinorKey() const { return type_; }
void Generate(MacroAssembler* masm);
void GenerateReadElement(MacroAssembler* masm);
@@ -1563,7 +1555,7 @@ class RegExpExecStub: public PlatformCodeStub {
private:
Major MajorKey() const { return RegExpExec; }
- uint32_t MinorKey() const { return 0; }
+ int MinorKey() const { return 0; }
void Generate(MacroAssembler* masm);
};
@@ -1623,7 +1615,7 @@ class CallFunctionStub: public PlatformCodeStub {
STATIC_ASSERT(Code::kArgumentsBits + 2 <= kStubMinorKeyBits);
Major MajorKey() const { return CallFunction; }
- uint32_t MinorKey() const {
+ int MinorKey() const {
// Encode the parameters in a unique 32 bit value.
return FlagBits::encode(flags_) | ArgcBits::encode(argc_);
}
@@ -1658,7 +1650,7 @@ class CallConstructStub: public PlatformCodeStub {
virtual void PrintName(OStream& os) const V8_OVERRIDE; // NOLINT
Major MajorKey() const { return CallConstruct; }
- uint32_t MinorKey() const { return flags_; }
+ int MinorKey() const { return flags_; }
bool RecordCallTarget() const {
return (flags_ & RECORD_CONSTRUCTOR_TARGET) != 0;
@@ -1867,7 +1859,7 @@ class LoadDictionaryElementPlatformStub : public PlatformCodeStub {
private:
Major MajorKey() const { return LoadElement; }
- uint32_t MinorKey() const { return DICTIONARY_ELEMENTS; }
+ int MinorKey() const { return DICTIONARY_ELEMENTS; }
DISALLOW_COPY_AND_ASSIGN(LoadDictionaryElementPlatformStub);
};
@@ -1954,7 +1946,7 @@ class DoubleToIStub : public PlatformCodeStub {
public BitField<int, 2 * kBitsPerRegisterNumber + 5, 1> {}; // NOLINT
Major MajorKey() const { return DoubleToI; }
- uint32_t MinorKey() const { return bit_field_; }
+ int MinorKey() const { return bit_field_; }
int bit_field_;
@@ -2290,7 +2282,7 @@ class StoreElementStub : public PlatformCodeStub {
store_mode_(store_mode) {}
Major MajorKey() const { return StoreElement; }
- uint32_t MinorKey() const {
+ int MinorKey() const {
return ElementsKindBits::encode(elements_kind_) |
IsJSArrayBits::encode(is_js_array_) |
StoreModeBits::encode(store_mode_);
@@ -2480,7 +2472,7 @@ class StoreArrayLiteralElementStub : public PlatformCodeStub {
private:
Major MajorKey() const { return StoreArrayLiteralElement; }
- uint32_t MinorKey() const { return 0; }
+ int MinorKey() const { return 0; }
void Generate(MacroAssembler* masm);
@@ -2500,9 +2492,7 @@ class StubFailureTrampolineStub : public PlatformCodeStub {
class FunctionModeField: public BitField<StubFunctionMode, 0, 1> {};
Major MajorKey() const { return StubFailureTrampoline; }
- uint32_t MinorKey() const {
- return FunctionModeField::encode(function_mode_);
- }
+ int MinorKey() const { return FunctionModeField::encode(function_mode_); }
void Generate(MacroAssembler* masm);
@@ -2528,7 +2518,7 @@ class ProfileEntryHookStub : public PlatformCodeStub {
Isolate* isolate);
Major MajorKey() const { return ProfileEntryHook; }
- uint32_t MinorKey() const { return 0; }
+ int MinorKey() const { return 0; }
void Generate(MacroAssembler* masm);
« no previous file with comments | « src/arm64/code-stubs-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698