Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index 7017ab8faedd21e09ec43244e3f6968ff101de65..01f83ed54f5f7afa5274919620643b7521458fca 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -76,6 +76,7 @@ namespace internal { |
V(CallApiGetter) \ |
/* IC Handler stubs */ \ |
V(LoadField) \ |
+ V(LoadConstant) \ |
V(StringLength) |
// List of code stubs only used on ARM 32 bits platforms. |
@@ -903,6 +904,9 @@ class HandlerStub : public HydrogenCodeStub { |
virtual ExtraICState GetExtraICState() const { return kind(); } |
virtual InlineCacheState GetICState() { return MONOMORPHIC; } |
+ virtual void InitializeInterfaceDescriptor( |
+ CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
+ |
protected: |
explicit HandlerStub(Isolate* isolate) |
: HydrogenCodeStub(isolate), bit_field_(0) {} |
@@ -922,9 +926,6 @@ class LoadFieldStub: public HandlerStub { |
virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
- virtual void InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
- |
Representation representation() { |
if (unboxed_double()) return Representation::Double(); |
return Representation::Tagged(); |
@@ -945,12 +946,30 @@ class LoadFieldStub: public HandlerStub { |
}; |
+class LoadConstantStub : public HandlerStub { |
+ public: |
+ LoadConstantStub(Isolate* isolate, int descriptor) : HandlerStub(isolate) { |
+ bit_field_ = descriptor; |
+ } |
+ |
+ virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
+ |
+ int descriptor() const { return bit_field_; } |
+ |
+ protected: |
+ explicit LoadConstantStub(Isolate* isolate); |
+ virtual Code::Kind kind() const { return Code::LOAD_IC; } |
+ virtual Code::StubType GetStubType() { return Code::FAST; } |
+ |
+ private: |
+ virtual CodeStub::Major MajorKey() const { return LoadConstant; } |
+}; |
+ |
+ |
class StringLengthStub: public HandlerStub { |
public: |
explicit StringLengthStub(Isolate* isolate) : HandlerStub(isolate) {} |
virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
- virtual void InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
protected: |
virtual Code::Kind kind() const { return Code::LOAD_IC; } |
@@ -992,9 +1011,6 @@ class StoreGlobalStub : public HandlerStub { |
virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
- virtual void InitializeInterfaceDescriptor( |
- CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
- |
bool is_constant() const { |
return IsConstantBits::decode(bit_field_); |
} |