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

Unified Diff: src/code-stubs.h

Issue 11973008: Replace special IC builtins and stubs in the map's cache by codestubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 11 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/builtins.cc ('k') | src/ia32/code-stubs-ia32.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 8cba9661917c64c9745ec44a9a494a5ec7ba3ae9..7e2ebe4d52730bb7527284523cc310d54f22bd8a 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,45 @@ 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() { return kind_; }
+
+ private:
+ Code::Kind kind_;
+};
+
+
+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)
« no previous file with comments | « src/builtins.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698