Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index 8cba9661917c64c9745ec44a9a494a5ec7ba3ae9..68e90d97ef99432944cc67dccd071be2931f9505 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -47,6 +47,7 @@ namespace internal { |
V(Compare) \ |
V(CompareIC) \ |
V(MathPow) \ |
+ V(StringLength) \ |
V(RecordWrite) \ |
V(StoreBufferOverflow) \ |
V(RegExpExec) \ |
@@ -539,6 +540,43 @@ class MathPowStub: public PlatformCodeStub { |
}; |
+class ICStub: public PlatformCodeStub { |
+ public: |
+ explicit ICStub(Code::Kind kind) : kind_(kind) { } |
+ virtual int GetCodeKind() { return kind_; } |
+ virtual InlineCacheState GetICState() { return MONOMORPHIC; } |
+ |
+ bool Describes(Code* code) { |
+ return GetMajorKey(code) == MajorKey() && code->stub_info() == MinorKey(); |
+ } |
+ |
+ protected: |
+ class KindBits: public BitField<Code::Kind, 0, 4> {}; |
+ virtual void FinishCode(Handle<Code> code) { |
+ code->set_stub_info(MinorKey()); |
+ } |
+ |
+ Code::Kind kind_; |
Jakob Kummerow
2013/01/21 14:41:39
protected data members are frowned upon. Please ma
Toon Verwaest
2013/01/21 14:51:17
Done.
|
+}; |
+ |
+ |
+class StringLengthStub: public ICStub { |
+ public: |
+ StringLengthStub(Code::Kind kind, bool support_wrapper) |
+ : ICStub(kind), support_wrapper_(support_wrapper) { } |
+ virtual void Generate(MacroAssembler* masm); |
+ |
+ private: |
+ class WrapperModeBits: public BitField<bool, 4, 1> {}; |
+ virtual CodeStub::Major MajorKey() { return StringLength; } |
+ virtual int MinorKey() { |
+ return KindBits::encode(kind_) | WrapperModeBits::encode(support_wrapper_); |
+ } |
+ |
+ bool support_wrapper_; |
+}; |
+ |
+ |
class BinaryOpStub: public PlatformCodeStub { |
public: |
BinaryOpStub(Token::Value op, OverwriteMode mode) |