From 835b000a72b7c804228d30534264dfcf783031a8 Mon Sep 17 00:00:00 2001 From: "balazs.kilvady@imgtec.com" Date: Fri, 5 Sep 2014 09:37:43 +0000 Subject: [PATCH] MIPS: Introduce code stub constructors for stub keys. Port r23716 (9118048) BUG= R=dusan.milosavljevic@imgtec.com Review URL: https://codereview.chromium.org/535373003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23721 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/code-stubs-mips.h | 33 ++++++++++++++------------------- src/mips64/code-stubs-mips64.h | 33 ++++++++++++++------------------- 2 files changed, 28 insertions(+), 38 deletions(-) diff --git a/src/mips/code-stubs-mips.h b/src/mips/code-stubs-mips.h index 561f882..ae65383 100644 --- a/src/mips/code-stubs-mips.h +++ b/src/mips/code-stubs-mips.h @@ -5,9 +5,6 @@ #ifndef V8_MIPS_CODE_STUBS_ARM_H_ #define V8_MIPS_CODE_STUBS_ARM_H_ -#include "src/code-stubs.h" - - namespace v8 { namespace internal { @@ -65,24 +62,25 @@ class StoreRegistersStateStub: public PlatformCodeStub { : PlatformCodeStub(isolate) {} static void GenerateAheadOfTime(Isolate* isolate); + private: - virtual inline Major MajorKey() const FINAL OVERRIDE; - uint32_t MinorKey() const { return 0; } + void Generate(MacroAssembler* masm); - void Generate(MacroAssembler* masm); + DEFINE_CODE_STUB(StoreRegistersState, PlatformCodeStub); }; + class RestoreRegistersStateStub: public PlatformCodeStub { public: explicit RestoreRegistersStateStub(Isolate* isolate) : PlatformCodeStub(isolate) {} static void GenerateAheadOfTime(Isolate* isolate); - private: - virtual inline Major MajorKey() const FINAL OVERRIDE; - uint32_t MinorKey() const { return 0; } + private: void Generate(MacroAssembler* masm); + + DEFINE_CODE_STUB(RestoreRegistersState, PlatformCodeStub); }; @@ -108,8 +106,6 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub { static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); private: - virtual inline Major MajorKey() const FINAL OVERRIDE; - void Generate(MacroAssembler* masm); Register the_int() const { @@ -134,7 +130,7 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub { class ScratchRegisterBits: public BitField {}; class SignRegisterBits: public BitField {}; - DISALLOW_COPY_AND_ASSIGN(WriteInt32ToHeapNumberStub); + DEFINE_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub); }; @@ -157,6 +153,9 @@ class RecordWriteStub: public PlatformCodeStub { SaveFPRegsModeBits::encode(fp_mode); } + RecordWriteStub(uint32_t key, Isolate* isolate) + : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {} + enum Mode { STORE_BUFFER_ONLY, INCREMENTAL, @@ -288,7 +287,7 @@ class RecordWriteStub: public PlatformCodeStub { kUpdateRememberedSetOnNoNeedToInformIncrementalMarker }; - virtual inline Major MajorKey() const FINAL OVERRIDE; + virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; } void Generate(MacroAssembler* masm); void GenerateIncremental(MacroAssembler* masm, Mode mode); @@ -347,11 +346,9 @@ class DirectCEntryStub: public PlatformCodeStub { void GenerateCall(MacroAssembler* masm, Register target); private: - virtual inline Major MajorKey() const FINAL OVERRIDE; - bool NeedsImmovableCode() { return true; } - DISALLOW_COPY_AND_ASSIGN(DirectCEntryStub); + DEFINE_CODE_STUB(DirectCEntry, PlatformCodeStub); }; @@ -396,13 +393,11 @@ class NameDictionaryLookupStub: public PlatformCodeStub { NameDictionary::kHeaderSize + NameDictionary::kElementsStartIndex * kPointerSize; - virtual inline Major MajorKey() const FINAL OVERRIDE; - LookupMode mode() const { return LookupModeBits::decode(minor_key_); } class LookupModeBits: public BitField {}; - DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub); + DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); }; diff --git a/src/mips64/code-stubs-mips64.h b/src/mips64/code-stubs-mips64.h index fc93f41..b6a917d 100644 --- a/src/mips64/code-stubs-mips64.h +++ b/src/mips64/code-stubs-mips64.h @@ -5,9 +5,6 @@ #ifndef V8_MIPS_CODE_STUBS_ARM_H_ #define V8_MIPS_CODE_STUBS_ARM_H_ -#include "src/code-stubs.h" - - namespace v8 { namespace internal { @@ -66,24 +63,25 @@ class StoreRegistersStateStub: public PlatformCodeStub { : PlatformCodeStub(isolate) {} static void GenerateAheadOfTime(Isolate* isolate); - private: - virtual inline Major MajorKey() const FINAL OVERRIDE; - uint32_t MinorKey() const { return 0; } + private: void Generate(MacroAssembler* masm); + + DEFINE_CODE_STUB(StoreRegistersState, PlatformCodeStub); }; + class RestoreRegistersStateStub: public PlatformCodeStub { public: explicit RestoreRegistersStateStub(Isolate* isolate) : PlatformCodeStub(isolate) {} static void GenerateAheadOfTime(Isolate* isolate); - private: - virtual inline Major MajorKey() const FINAL OVERRIDE; - uint32_t MinorKey() const { return 0; } + private: void Generate(MacroAssembler* masm); + + DEFINE_CODE_STUB(RestoreRegistersState, PlatformCodeStub); }; // This stub can convert a signed int32 to a heap number (double). It does @@ -108,8 +106,6 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub { static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); private: - virtual inline Major MajorKey() const FINAL OVERRIDE; - void Generate(MacroAssembler* masm); Register the_int() const { @@ -134,7 +130,7 @@ class WriteInt32ToHeapNumberStub : public PlatformCodeStub { class ScratchRegisterBits: public BitField {}; class SignRegisterBits: public BitField {}; - DISALLOW_COPY_AND_ASSIGN(WriteInt32ToHeapNumberStub); + DEFINE_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub); }; @@ -157,6 +153,9 @@ class RecordWriteStub: public PlatformCodeStub { SaveFPRegsModeBits::encode(fp_mode); } + RecordWriteStub(uint32_t key, Isolate* isolate) + : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {} + enum Mode { STORE_BUFFER_ONLY, INCREMENTAL, @@ -288,7 +287,7 @@ class RecordWriteStub: public PlatformCodeStub { kUpdateRememberedSetOnNoNeedToInformIncrementalMarker }; - virtual inline Major MajorKey() const FINAL OVERRIDE; + virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; } void Generate(MacroAssembler* masm); void GenerateIncremental(MacroAssembler* masm, Mode mode); @@ -347,11 +346,9 @@ class DirectCEntryStub: public PlatformCodeStub { void GenerateCall(MacroAssembler* masm, Register target); private: - virtual inline Major MajorKey() const FINAL OVERRIDE; - bool NeedsImmovableCode() { return true; } - DISALLOW_COPY_AND_ASSIGN(DirectCEntryStub); + DEFINE_CODE_STUB(DirectCEntry, PlatformCodeStub); }; @@ -396,13 +393,11 @@ class NameDictionaryLookupStub: public PlatformCodeStub { NameDictionary::kHeaderSize + NameDictionary::kElementsStartIndex * kPointerSize; - virtual inline Major MajorKey() const FINAL OVERRIDE; - LookupMode mode() const { return LookupModeBits::decode(minor_key_); } class LookupModeBits: public BitField {}; - DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub); + DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); }; -- 2.7.4