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

Unified Diff: src/code-stubs.h

Issue 246643014: CodeStubs contain their corresponding Isolate* now. (part 1) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Feedback. Rebased. Created 6 years, 8 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/stub-cache-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 fd0c0390b396e309b5e690035a1b67891645c068..c28812c63e3978e08e0231369cc402912e1a6454 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -174,6 +174,7 @@ class CodeStub BASE_EMBEDDED {
static const char* MajorName(Major major_key, bool allow_unknown_keys);
+ explicit CodeStub(Isolate* isolate) : isolate_(isolate) { }
virtual ~CodeStub() {}
static void GenerateStubsAheadOfTime(Isolate* isolate);
@@ -209,6 +210,8 @@ class CodeStub BASE_EMBEDDED {
// Returns a name for logging/debugging purposes.
SmartArrayPointer<const char> GetName();
+ Isolate* isolate() const { return isolate_; }
+
protected:
static bool CanUseFPRegisters();
@@ -265,11 +268,15 @@ class CodeStub BASE_EMBEDDED {
kStubMajorKeyBits, kStubMinorKeyBits> {}; // NOLINT
friend class BreakPointIterator;
+
+ Isolate* isolate_;
};
class PlatformCodeStub : public CodeStub {
public:
+ explicit PlatformCodeStub(Isolate* isolate) : CodeStub(isolate) { }
+
// Retrieve the code for the stub. Generate the code if needed.
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -385,7 +392,8 @@ class HydrogenCodeStub : public CodeStub {
INITIALIZED
};
- explicit HydrogenCodeStub(InitializationState state = INITIALIZED) {
+ HydrogenCodeStub(Isolate* isolate, InitializationState state = INITIALIZED)
+ : CodeStub(isolate) {
is_uninitialized_ = (state == UNINITIALIZED);
}
@@ -493,7 +501,7 @@ class NopRuntimeCallHelper : public RuntimeCallHelper {
class ToNumberStub: public HydrogenCodeStub {
public:
- ToNumberStub() { }
+ explicit ToNumberStub(Isolate* isolate) : HydrogenCodeStub(isolate) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -502,7 +510,7 @@ class ToNumberStub: public HydrogenCodeStub {
CodeStubInterfaceDescriptor* descriptor);
static void InstallDescriptors(Isolate* isolate) {
- ToNumberStub stub;
+ ToNumberStub stub(isolate);
stub.InitializeInterfaceDescriptor(
isolate,
isolate->code_stub_interface_descriptor(CodeStub::ToNumber));
@@ -516,7 +524,7 @@ class ToNumberStub: public HydrogenCodeStub {
class NumberToStringStub V8_FINAL : public HydrogenCodeStub {
public:
- NumberToStringStub() {}
+ explicit NumberToStringStub(Isolate* isolate) : HydrogenCodeStub(isolate) {}
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
@@ -537,9 +545,12 @@ class NumberToStringStub V8_FINAL : public HydrogenCodeStub {
class FastNewClosureStub : public HydrogenCodeStub {
public:
- explicit FastNewClosureStub(StrictMode strict_mode, bool is_generator)
- : strict_mode_(strict_mode),
- is_generator_(is_generator) { }
+ FastNewClosureStub(Isolate* isolate,
+ StrictMode strict_mode,
+ bool is_generator)
+ : HydrogenCodeStub(isolate),
+ strict_mode_(strict_mode),
+ is_generator_(is_generator) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -571,7 +582,8 @@ class FastNewContextStub V8_FINAL : public HydrogenCodeStub {
public:
static const int kMaximumSlots = 64;
- explicit FastNewContextStub(int slots) : slots_(slots) {
+ FastNewContextStub(Isolate* isolate, int slots)
+ : HydrogenCodeStub(isolate), slots_(slots) {
ASSERT(slots_ > 0 && slots_ <= kMaximumSlots);
}
@@ -610,10 +622,12 @@ class FastCloneShallowArrayStub : public HydrogenCodeStub {
static const int kFastCloneModeCount = LAST_CLONE_MODE + 1;
- FastCloneShallowArrayStub(Mode mode,
+ FastCloneShallowArrayStub(Isolate* isolate,
+ Mode mode,
AllocationSiteMode allocation_site_mode,
int length)
- : mode_(mode),
+ : HydrogenCodeStub(isolate),
+ mode_(mode),
allocation_site_mode_(allocation_site_mode),
length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) {
ASSERT_GE(length_, 0);
@@ -674,7 +688,8 @@ class FastCloneShallowObjectStub : public HydrogenCodeStub {
// Maximum number of properties in copied object.
static const int kMaximumClonedProperties = 6;
- explicit FastCloneShallowObjectStub(int length) : length_(length) {
+ FastCloneShallowObjectStub(Isolate* isolate, int length)
+ : HydrogenCodeStub(isolate), length_(length) {
ASSERT_GE(length_, 0);
ASSERT_LE(length_, kMaximumClonedProperties);
}
@@ -699,7 +714,8 @@ class FastCloneShallowObjectStub : public HydrogenCodeStub {
class CreateAllocationSiteStub : public HydrogenCodeStub {
public:
- explicit CreateAllocationSiteStub() { }
+ explicit CreateAllocationSiteStub(Isolate* isolate)
+ : HydrogenCodeStub(isolate) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -726,7 +742,8 @@ class InstanceofStub: public PlatformCodeStub {
kReturnTrueFalseObject = 1 << 2
};
- explicit InstanceofStub(Flags flags) : flags_(flags) { }
+ InstanceofStub(Isolate* isolate, Flags flags)
+ : PlatformCodeStub(isolate), flags_(flags) { }
static Register left();
static Register right();
@@ -800,8 +817,8 @@ class MathPowStub: public PlatformCodeStub {
public:
enum ExponentType { INTEGER, DOUBLE, TAGGED, ON_STACK };
- explicit MathPowStub(ExponentType exponent_type)
- : exponent_type_(exponent_type) { }
+ MathPowStub(Isolate* isolate, ExponentType exponent_type)
+ : PlatformCodeStub(isolate), exponent_type_(exponent_type) { }
virtual void Generate(MacroAssembler* masm);
private:
@@ -814,7 +831,8 @@ class MathPowStub: public PlatformCodeStub {
class ICStub: public PlatformCodeStub {
public:
- explicit ICStub(Code::Kind kind) : kind_(kind) { }
+ ICStub(Isolate* isolate, Code::Kind kind)
+ : PlatformCodeStub(isolate), kind_(kind) { }
virtual Code::Kind GetCodeKind() const { return kind_; }
virtual InlineCacheState GetICState() { return MONOMORPHIC; }
@@ -840,7 +858,8 @@ class ICStub: public PlatformCodeStub {
class FunctionPrototypeStub: public ICStub {
public:
- explicit FunctionPrototypeStub(Code::Kind kind) : ICStub(kind) { }
+ FunctionPrototypeStub(Isolate* isolate, Code::Kind kind)
+ : ICStub(isolate, kind) { }
virtual void Generate(MacroAssembler* masm);
private:
@@ -850,8 +869,8 @@ class FunctionPrototypeStub: public ICStub {
class StoreICStub: public ICStub {
public:
- StoreICStub(Code::Kind kind, StrictMode strict_mode)
- : ICStub(kind), strict_mode_(strict_mode) { }
+ StoreICStub(Isolate* isolate, Code::Kind kind, StrictMode strict_mode)
+ : ICStub(isolate, kind), strict_mode_(strict_mode) { }
protected:
virtual ExtraICState GetExtraICState() {
@@ -871,6 +890,7 @@ class StoreICStub: public ICStub {
class HICStub: public HydrogenCodeStub {
public:
+ explicit HICStub(Isolate* isolate) : HydrogenCodeStub(isolate) { }
virtual Code::Kind GetCodeKind() const { return kind(); }
virtual InlineCacheState GetICState() { return MONOMORPHIC; }
@@ -886,7 +906,7 @@ class HandlerStub: public HICStub {
virtual ExtraICState GetExtraICState() { return kind(); }
protected:
- HandlerStub() : HICStub() { }
+ explicit HandlerStub(Isolate* isolate) : HICStub(isolate) { }
virtual int NotMissMinorKey() { return bit_field_; }
int bit_field_;
};
@@ -894,7 +914,10 @@ class HandlerStub: public HICStub {
class LoadFieldStub: public HandlerStub {
public:
- LoadFieldStub(bool inobject, int index, Representation representation) {
+ LoadFieldStub(Isolate* isolate,
+ bool inobject,
+ int index, Representation representation)
+ : HandlerStub(isolate) {
Initialize(Code::LOAD_IC, inobject, index, representation);
}
@@ -931,7 +954,7 @@ class LoadFieldStub: public HandlerStub {
virtual Code::StubType GetStubType() { return Code::FAST; }
protected:
- LoadFieldStub() : HandlerStub() { }
+ explicit LoadFieldStub(Isolate* isolate) : HandlerStub(isolate) { }
void Initialize(Code::Kind kind,
bool inobject,
@@ -954,7 +977,7 @@ class LoadFieldStub: public HandlerStub {
class StringLengthStub: public HandlerStub {
public:
- explicit StringLengthStub() : HandlerStub() {
+ explicit StringLengthStub(Isolate* isolate) : HandlerStub(isolate) {
Initialize(Code::LOAD_IC);
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -978,7 +1001,7 @@ class StringLengthStub: public HandlerStub {
class KeyedStringLengthStub: public StringLengthStub {
public:
- explicit KeyedStringLengthStub() : StringLengthStub() {
+ explicit KeyedStringLengthStub(Isolate* isolate) : StringLengthStub(isolate) {
Initialize(Code::KEYED_LOAD_IC);
}
virtual void InitializeInterfaceDescriptor(
@@ -992,7 +1015,8 @@ class KeyedStringLengthStub: public StringLengthStub {
class StoreGlobalStub : public HandlerStub {
public:
- explicit StoreGlobalStub(bool is_constant, bool check_global) {
+ StoreGlobalStub(Isolate* isolate, bool is_constant, bool check_global)
+ : HandlerStub(isolate) {
bit_field_ = IsConstantBits::encode(is_constant) |
CheckGlobalBits::encode(check_global);
}
@@ -1055,9 +1079,10 @@ class StoreGlobalStub : public HandlerStub {
class CallApiFunctionStub : public PlatformCodeStub {
public:
- CallApiFunctionStub(bool is_store,
+ CallApiFunctionStub(Isolate* isolate,
+ bool is_store,
bool call_data_undefined,
- int argc) {
+ int argc) : PlatformCodeStub(isolate) {
bit_field_ =
IsStoreBits::encode(is_store) |
CallDataUndefinedBits::encode(call_data_undefined) |
@@ -1082,7 +1107,7 @@ class CallApiFunctionStub : public PlatformCodeStub {
class CallApiGetterStub : public PlatformCodeStub {
public:
- CallApiGetterStub() {}
+ explicit CallApiGetterStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
private:
virtual void Generate(MacroAssembler* masm) V8_OVERRIDE;
@@ -1095,8 +1120,10 @@ class CallApiGetterStub : public PlatformCodeStub {
class KeyedLoadFieldStub: public LoadFieldStub {
public:
- KeyedLoadFieldStub(bool inobject, int index, Representation representation)
- : LoadFieldStub() {
+ KeyedLoadFieldStub(Isolate* isolate,
+ bool inobject,
+ int index, Representation representation)
+ : LoadFieldStub(isolate) {
Initialize(Code::KEYED_LOAD_IC, inobject, index, representation);
}
@@ -1111,10 +1138,11 @@ class KeyedLoadFieldStub: public LoadFieldStub {
class BinaryOpICStub : public HydrogenCodeStub {
public:
- BinaryOpICStub(Token::Value op, OverwriteMode mode)
- : HydrogenCodeStub(UNINITIALIZED), state_(op, mode) {}
+ BinaryOpICStub(Isolate* isolate, Token::Value op, OverwriteMode mode)
+ : HydrogenCodeStub(isolate, UNINITIALIZED), state_(op, mode) {}
- explicit BinaryOpICStub(const BinaryOpIC::State& state) : state_(state) {}
+ BinaryOpICStub(Isolate* isolate, const BinaryOpIC::State& state)
+ : HydrogenCodeStub(isolate), state_(state) {}
static void GenerateAheadOfTime(Isolate* isolate);
@@ -1168,8 +1196,9 @@ class BinaryOpICStub : public HydrogenCodeStub {
// call support for stubs in Hydrogen.
class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub {
public:
- explicit BinaryOpICWithAllocationSiteStub(const BinaryOpIC::State& state)
- : state_(state) {}
+ BinaryOpICWithAllocationSiteStub(Isolate* isolate,
+ const BinaryOpIC::State& state)
+ : PlatformCodeStub(isolate), state_(state) {}
static void GenerateAheadOfTime(Isolate* isolate);
@@ -1215,11 +1244,14 @@ class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub {
class BinaryOpWithAllocationSiteStub V8_FINAL : public BinaryOpICStub {
public:
- BinaryOpWithAllocationSiteStub(Token::Value op, OverwriteMode mode)
- : BinaryOpICStub(op, mode) {}
+ BinaryOpWithAllocationSiteStub(Isolate* isolate,
+ Token::Value op,
+ OverwriteMode mode)
+ : BinaryOpICStub(isolate, op, mode) {}
- explicit BinaryOpWithAllocationSiteStub(const BinaryOpIC::State& state)
- : BinaryOpICStub(state) {}
+ BinaryOpWithAllocationSiteStub(Isolate* isolate,
+ const BinaryOpIC::State& state)
+ : BinaryOpICStub(isolate, state) {}
virtual void InitializeInterfaceDescriptor(
Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
@@ -1257,8 +1289,11 @@ enum StringAddFlags {
class StringAddStub V8_FINAL : public HydrogenCodeStub {
public:
- StringAddStub(StringAddFlags flags, PretenureFlag pretenure_flag)
- : bit_field_(StringAddFlagsBits::encode(flags) |
+ StringAddStub(Isolate* isolate,
+ StringAddFlags flags,
+ PretenureFlag pretenure_flag)
+ : HydrogenCodeStub(isolate),
+ bit_field_(StringAddFlagsBits::encode(flags) |
PretenureFlagBits::encode(pretenure_flag)) {}
StringAddFlags flags() const {
@@ -1301,11 +1336,13 @@ class StringAddStub V8_FINAL : public HydrogenCodeStub {
class ICCompareStub: public PlatformCodeStub {
public:
- ICCompareStub(Token::Value op,
+ ICCompareStub(Isolate* isolate,
+ Token::Value op,
CompareIC::State left,
CompareIC::State right,
CompareIC::State handler)
- : op_(op),
+ : PlatformCodeStub(isolate),
+ op_(op),
left_(left),
right_(right),
state_(handler) {
@@ -1369,18 +1406,20 @@ class CompareNilICStub : public HydrogenCodeStub {
Type* GetType(Zone* zone, Handle<Map> map = Handle<Map>());
Type* GetInputType(Zone* zone, Handle<Map> map);
- explicit CompareNilICStub(NilValue nil) : nil_value_(nil) { }
+ CompareNilICStub(Isolate* isolate, NilValue nil)
+ : HydrogenCodeStub(isolate), nil_value_(nil) { }
- CompareNilICStub(ExtraICState ic_state,
+ CompareNilICStub(Isolate* isolate,
+ ExtraICState ic_state,
InitializationState init_state = INITIALIZED)
- : HydrogenCodeStub(init_state),
+ : HydrogenCodeStub(isolate, init_state),
nil_value_(NilValueField::decode(ic_state)),
state_(State(TypesField::decode(ic_state))) {
}
static Handle<Code> GetUninitialized(Isolate* isolate,
NilValue nil) {
- return CompareNilICStub(nil, UNINITIALIZED).GetCode(isolate);
+ return CompareNilICStub(isolate, nil, UNINITIALIZED).GetCode(isolate);
}
virtual void InitializeInterfaceDescriptor(
@@ -1388,7 +1427,7 @@ class CompareNilICStub : public HydrogenCodeStub {
CodeStubInterfaceDescriptor* descriptor);
static void InstallDescriptors(Isolate* isolate) {
- CompareNilICStub compare_stub(kNullValue, UNINITIALIZED);
+ CompareNilICStub compare_stub(isolate, kNullValue, UNINITIALIZED);
compare_stub.InitializeInterfaceDescriptor(
isolate,
isolate->code_stub_interface_descriptor(CodeStub::CompareNilIC));
@@ -1446,8 +1485,10 @@ class CompareNilICStub : public HydrogenCodeStub {
void Print(StringStream* stream) const;
};
- CompareNilICStub(NilValue nil, InitializationState init_state)
- : HydrogenCodeStub(init_state), nil_value_(nil) { }
+ CompareNilICStub(Isolate* isolate,
+ NilValue nil,
+ InitializationState init_state)
+ : HydrogenCodeStub(isolate, init_state), nil_value_(nil) { }
class NilValueField : public BitField<NilValue, 0, 1> {};
class TypesField : public BitField<byte, 1, NUMBER_OF_TYPES> {};
@@ -1464,9 +1505,12 @@ class CompareNilICStub : public HydrogenCodeStub {
class CEntryStub : public PlatformCodeStub {
public:
- explicit CEntryStub(int result_size,
- SaveFPRegsMode save_doubles = kDontSaveFPRegs)
- : result_size_(result_size), save_doubles_(save_doubles) { }
+ CEntryStub(Isolate* isolate,
+ int result_size,
+ SaveFPRegsMode save_doubles = kDontSaveFPRegs)
+ : PlatformCodeStub(isolate),
+ result_size_(result_size),
+ save_doubles_(save_doubles) { }
void Generate(MacroAssembler* masm);
@@ -1496,7 +1540,7 @@ class CEntryStub : public PlatformCodeStub {
class JSEntryStub : public PlatformCodeStub {
public:
- JSEntryStub() { }
+ explicit JSEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) { }
void Generate(MacroAssembler* masm) { GenerateBody(masm, false); }
@@ -1515,7 +1559,7 @@ class JSEntryStub : public PlatformCodeStub {
class JSConstructEntryStub : public JSEntryStub {
public:
- JSConstructEntryStub() { }
+ explicit JSConstructEntryStub(Isolate* isolate) : JSEntryStub(isolate) { }
void Generate(MacroAssembler* masm) { GenerateBody(masm, true); }
@@ -1537,7 +1581,8 @@ class ArgumentsAccessStub: public PlatformCodeStub {
NEW_STRICT
};
- explicit ArgumentsAccessStub(Type type) : type_(type) { }
+ ArgumentsAccessStub(Isolate* isolate, Type type)
+ : PlatformCodeStub(isolate), type_(type) { }
private:
Type type_;
@@ -1557,7 +1602,7 @@ class ArgumentsAccessStub: public PlatformCodeStub {
class RegExpExecStub: public PlatformCodeStub {
public:
- RegExpExecStub() { }
+ explicit RegExpExecStub(Isolate* isolate) : PlatformCodeStub(isolate) { }
private:
Major MajorKey() { return RegExpExec; }
@@ -1569,7 +1614,8 @@ class RegExpExecStub: public PlatformCodeStub {
class RegExpConstructResultStub V8_FINAL : public HydrogenCodeStub {
public:
- RegExpConstructResultStub() { }
+ explicit RegExpConstructResultStub(Isolate* isolate)
+ : HydrogenCodeStub(isolate) { }
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
@@ -1594,8 +1640,8 @@ class RegExpConstructResultStub V8_FINAL : public HydrogenCodeStub {
class CallFunctionStub: public PlatformCodeStub {
public:
- CallFunctionStub(int argc, CallFunctionFlags flags)
- : argc_(argc), flags_(flags) { }
+ CallFunctionStub(Isolate* isolate, int argc, CallFunctionFlags flags)
+ : PlatformCodeStub(isolate), argc_(argc), flags_(flags) { }
void Generate(MacroAssembler* masm);
@@ -1639,7 +1685,8 @@ class CallFunctionStub: public PlatformCodeStub {
class CallConstructStub: public PlatformCodeStub {
public:
- explicit CallConstructStub(CallFunctionFlags flags) : flags_(flags) {}
+ CallConstructStub(Isolate* isolate, CallFunctionFlags flags)
+ : PlatformCodeStub(isolate), flags_(flags) {}
void Generate(MacroAssembler* masm);
@@ -1841,7 +1888,8 @@ class StringCharAtGenerator {
class KeyedLoadDictionaryElementStub : public HydrogenCodeStub {
public:
- KeyedLoadDictionaryElementStub() {}
+ explicit KeyedLoadDictionaryElementStub(Isolate* isolate)
+ : HydrogenCodeStub(isolate) {}
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
@@ -1859,7 +1907,8 @@ class KeyedLoadDictionaryElementStub : public HydrogenCodeStub {
class KeyedLoadDictionaryElementPlatformStub : public PlatformCodeStub {
public:
- KeyedLoadDictionaryElementPlatformStub() {}
+ explicit KeyedLoadDictionaryElementPlatformStub(Isolate* isolate)
+ : PlatformCodeStub(isolate) {}
void Generate(MacroAssembler* masm);
@@ -1873,11 +1922,13 @@ class KeyedLoadDictionaryElementPlatformStub : public PlatformCodeStub {
class DoubleToIStub : public PlatformCodeStub {
public:
- DoubleToIStub(Register source,
+ DoubleToIStub(Isolate* isolate,
+ Register source,
Register destination,
int offset,
bool is_truncating,
- bool skip_fastpath = false) : bit_field_(0) {
+ bool skip_fastpath = false)
+ : PlatformCodeStub(isolate), bit_field_(0) {
bit_field_ = SourceRegisterBits::encode(source.code()) |
DestinationRegisterBits::encode(destination.code()) |
OffsetBits::encode(offset) |
@@ -1944,7 +1995,10 @@ class DoubleToIStub : public PlatformCodeStub {
class KeyedLoadFastElementStub : public HydrogenCodeStub {
public:
- KeyedLoadFastElementStub(bool is_js_array, ElementsKind elements_kind) {
+ KeyedLoadFastElementStub(Isolate* isolate,
+ bool is_js_array,
+ ElementsKind elements_kind)
+ : HydrogenCodeStub(isolate) {
bit_field_ = ElementsKindBits::encode(elements_kind) |
IsJSArrayBits::encode(is_js_array);
}
@@ -1977,9 +2031,11 @@ class KeyedLoadFastElementStub : public HydrogenCodeStub {
class KeyedStoreFastElementStub : public HydrogenCodeStub {
public:
- KeyedStoreFastElementStub(bool is_js_array,
+ KeyedStoreFastElementStub(Isolate* isolate,
+ bool is_js_array,
ElementsKind elements_kind,
- KeyedAccessStoreMode mode) {
+ KeyedAccessStoreMode mode)
+ : HydrogenCodeStub(isolate) {
bit_field_ = ElementsKindBits::encode(elements_kind) |
IsJSArrayBits::encode(is_js_array) |
StoreModeBits::encode(mode);
@@ -2018,9 +2074,10 @@ class KeyedStoreFastElementStub : public HydrogenCodeStub {
class TransitionElementsKindStub : public HydrogenCodeStub {
public:
- TransitionElementsKindStub(ElementsKind from_kind,
+ TransitionElementsKindStub(Isolate* isolate,
+ ElementsKind from_kind,
ElementsKind to_kind,
- bool is_js_array) {
+ bool is_js_array) : HydrogenCodeStub(isolate) {
bit_field_ = FromKindBits::encode(from_kind) |
ToKindBits::encode(to_kind) |
IsJSArrayBits::encode(is_js_array);
@@ -2059,8 +2116,10 @@ class TransitionElementsKindStub : public HydrogenCodeStub {
class ArrayConstructorStubBase : public HydrogenCodeStub {
public:
- ArrayConstructorStubBase(ElementsKind kind,
- AllocationSiteOverrideMode override_mode) {
+ ArrayConstructorStubBase(Isolate* isolate,
+ ElementsKind kind,
+ AllocationSiteOverrideMode override_mode)
+ : HydrogenCodeStub(isolate) {
// It only makes sense to override local allocation site behavior
// if there is a difference between the global allocation site policy
// for an ElementsKind and the desired usage of the stub.
@@ -2106,9 +2165,10 @@ class ArrayConstructorStubBase : public HydrogenCodeStub {
class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase {
public:
ArrayNoArgumentConstructorStub(
+ Isolate* isolate,
ElementsKind kind,
AllocationSiteOverrideMode override_mode = DONT_OVERRIDE)
- : ArrayConstructorStubBase(kind, override_mode) {
+ : ArrayConstructorStubBase(isolate, kind, override_mode) {
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -2131,9 +2191,10 @@ class ArrayNoArgumentConstructorStub : public ArrayConstructorStubBase {
class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase {
public:
ArraySingleArgumentConstructorStub(
+ Isolate* isolate,
ElementsKind kind,
AllocationSiteOverrideMode override_mode = DONT_OVERRIDE)
- : ArrayConstructorStubBase(kind, override_mode) {
+ : ArrayConstructorStubBase(isolate, kind, override_mode) {
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -2156,9 +2217,10 @@ class ArraySingleArgumentConstructorStub : public ArrayConstructorStubBase {
class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase {
public:
ArrayNArgumentsConstructorStub(
+ Isolate* isolate,
ElementsKind kind,
AllocationSiteOverrideMode override_mode = DONT_OVERRIDE)
- : ArrayConstructorStubBase(kind, override_mode) {
+ : ArrayConstructorStubBase(isolate, kind, override_mode) {
}
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -2180,7 +2242,8 @@ class ArrayNArgumentsConstructorStub : public ArrayConstructorStubBase {
class InternalArrayConstructorStubBase : public HydrogenCodeStub {
public:
- explicit InternalArrayConstructorStubBase(ElementsKind kind) {
+ InternalArrayConstructorStubBase(Isolate* isolate, ElementsKind kind)
+ : HydrogenCodeStub(isolate) {
kind_ = kind;
}
@@ -2204,8 +2267,9 @@ class InternalArrayConstructorStubBase : public HydrogenCodeStub {
class InternalArrayNoArgumentConstructorStub : public
InternalArrayConstructorStubBase {
public:
- explicit InternalArrayNoArgumentConstructorStub(ElementsKind kind)
- : InternalArrayConstructorStubBase(kind) { }
+ InternalArrayNoArgumentConstructorStub(Isolate* isolate,
+ ElementsKind kind)
+ : InternalArrayConstructorStubBase(isolate, kind) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -2223,8 +2287,9 @@ class InternalArrayNoArgumentConstructorStub : public
class InternalArraySingleArgumentConstructorStub : public
InternalArrayConstructorStubBase {
public:
- explicit InternalArraySingleArgumentConstructorStub(ElementsKind kind)
- : InternalArrayConstructorStubBase(kind) { }
+ InternalArraySingleArgumentConstructorStub(Isolate* isolate,
+ ElementsKind kind)
+ : InternalArrayConstructorStubBase(isolate, kind) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -2242,8 +2307,8 @@ class InternalArraySingleArgumentConstructorStub : public
class InternalArrayNArgumentsConstructorStub : public
InternalArrayConstructorStubBase {
public:
- explicit InternalArrayNArgumentsConstructorStub(ElementsKind kind)
- : InternalArrayConstructorStubBase(kind) { }
+ InternalArrayNArgumentsConstructorStub(Isolate* isolate, ElementsKind kind)
+ : InternalArrayConstructorStubBase(isolate, kind) { }
virtual Handle<Code> GenerateCode(Isolate* isolate);
@@ -2260,10 +2325,12 @@ class InternalArrayNArgumentsConstructorStub : public
class KeyedStoreElementStub : public PlatformCodeStub {
public:
- KeyedStoreElementStub(bool is_js_array,
+ KeyedStoreElementStub(Isolate* isolate,
+ bool is_js_array,
ElementsKind elements_kind,
KeyedAccessStoreMode store_mode)
- : is_js_array_(is_js_array),
+ : PlatformCodeStub(isolate),
+ is_js_array_(is_js_array),
elements_kind_(elements_kind),
store_mode_(store_mode),
fp_registers_(CanUseFPRegisters()) { }
@@ -2326,10 +2393,10 @@ class ToBooleanStub: public HydrogenCodeStub {
static Types Generic() { return Types((1 << NUMBER_OF_TYPES) - 1); }
};
- explicit ToBooleanStub(Types types = Types())
- : types_(types) { }
- explicit ToBooleanStub(ExtraICState state)
- : types_(static_cast<byte>(state)) { }
+ ToBooleanStub(Isolate* isolate, Types types = Types())
+ : HydrogenCodeStub(isolate), types_(types) { }
+ ToBooleanStub(Isolate* isolate, ExtraICState state)
+ : HydrogenCodeStub(isolate), types_(static_cast<byte>(state)) { }
bool UpdateStatus(Handle<Object> object);
Types GetTypes() { return types_; }
@@ -2345,14 +2412,14 @@ class ToBooleanStub: public HydrogenCodeStub {
virtual bool SometimesSetsUpAFrame() { return false; }
static void InstallDescriptors(Isolate* isolate) {
- ToBooleanStub stub;
+ ToBooleanStub stub(isolate);
stub.InitializeInterfaceDescriptor(
isolate,
isolate->code_stub_interface_descriptor(CodeStub::ToBoolean));
}
static Handle<Code> GetUninitialized(Isolate* isolate) {
- return ToBooleanStub(UNINITIALIZED).GetCode(isolate);
+ return ToBooleanStub(isolate, UNINITIALIZED).GetCode(isolate);
}
virtual ExtraICState GetExtraICState() {
@@ -2371,8 +2438,8 @@ class ToBooleanStub: public HydrogenCodeStub {
Major MajorKey() { return ToBoolean; }
int NotMissMinorKey() { return GetExtraICState(); }
- explicit ToBooleanStub(InitializationState init_state) :
- HydrogenCodeStub(init_state) {}
+ ToBooleanStub(Isolate* isolate, InitializationState init_state) :
+ HydrogenCodeStub(isolate, init_state) {}
Types types_;
};
@@ -2380,11 +2447,13 @@ class ToBooleanStub: public HydrogenCodeStub {
class ElementsTransitionAndStoreStub : public HydrogenCodeStub {
public:
- ElementsTransitionAndStoreStub(ElementsKind from_kind,
+ ElementsTransitionAndStoreStub(Isolate* isolate,
+ ElementsKind from_kind,
ElementsKind to_kind,
bool is_jsarray,
KeyedAccessStoreMode store_mode)
- : from_kind_(from_kind),
+ : HydrogenCodeStub(isolate),
+ from_kind_(from_kind),
to_kind_(to_kind),
is_jsarray_(is_jsarray),
store_mode_(store_mode) {}
@@ -2425,8 +2494,8 @@ class ElementsTransitionAndStoreStub : public HydrogenCodeStub {
class StoreArrayLiteralElementStub : public PlatformCodeStub {
public:
- StoreArrayLiteralElementStub()
- : fp_registers_(CanUseFPRegisters()) { }
+ explicit StoreArrayLiteralElementStub(Isolate* isolate)
+ : PlatformCodeStub(isolate), fp_registers_(CanUseFPRegisters()) { }
private:
class FPRegisters: public BitField<bool, 0, 1> {};
@@ -2444,8 +2513,10 @@ class StoreArrayLiteralElementStub : public PlatformCodeStub {
class StubFailureTrampolineStub : public PlatformCodeStub {
public:
- explicit StubFailureTrampolineStub(StubFunctionMode function_mode)
- : fp_registers_(CanUseFPRegisters()), function_mode_(function_mode) {}
+ StubFailureTrampolineStub(Isolate* isolate, StubFunctionMode function_mode)
+ : PlatformCodeStub(isolate),
+ fp_registers_(CanUseFPRegisters()),
+ function_mode_(function_mode) {}
static void GenerateAheadOfTime(Isolate* isolate);
@@ -2470,7 +2541,7 @@ class StubFailureTrampolineStub : public PlatformCodeStub {
class ProfileEntryHookStub : public PlatformCodeStub {
public:
- explicit ProfileEntryHookStub() {}
+ explicit ProfileEntryHookStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
// The profile entry hook function is not allowed to cause a GC.
virtual bool SometimesSetsUpAFrame() { return false; }
« no previous file with comments | « src/arm64/stub-cache-arm64.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698