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

Unified Diff: src/code-stubs.h

Issue 12340112: Polymorphism support for load IC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added ARM port, introduced GenerateTailCall Created 7 years, 10 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.h ('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 0cb3d423f3740ce66cf767c0d50a4a0bb68a8f9c..f7a4eaaf4aa3234b5b517fb9bea79b6b6db57290 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -83,7 +83,9 @@ namespace internal {
V(TransitionElementsKind) \
V(StoreArrayLiteralElement) \
V(StubFailureTrampoline) \
- V(ProfileEntryHook)
+ V(ProfileEntryHook) \
+ /* IC Handler stubs */ \
+ V(LoadField)
// List of code stubs only used on ARM platforms.
#ifdef V8_TARGET_ARCH_ARM
@@ -188,6 +190,9 @@ class CodeStub BASE_EMBEDDED {
virtual Code::ExtraICState GetExtraICState() {
return Code::kNoExtraICState;
}
+ virtual Code::StubType GetStubType() {
+ return Code::NORMAL;
+ }
// Returns whether the code generated for this stub needs to be allocated as
// a fixed (non-moveable) code object.
@@ -611,6 +616,7 @@ class StringLengthStub: public ICStub {
virtual void Generate(MacroAssembler* masm);
private:
+ STATIC_ASSERT(KindBits::kSize == 4);
class WrapperModeBits: public BitField<bool, 4, 1> {};
virtual CodeStub::Major MajorKey() { return StringLength; }
virtual int MinorKey() {
@@ -632,6 +638,7 @@ class StoreICStub: public ICStub {
}
private:
+ STATIC_ASSERT(KindBits::kSize == 4);
class StrictModeBits: public BitField<bool, 4, 1> {};
virtual int MinorKey() {
return KindBits::encode(kind()) | StrictModeBits::encode(strict_mode_);
@@ -652,6 +659,48 @@ class StoreArrayLengthStub: public StoreICStub {
};
+class HandlerStub: public ICStub {
+ public:
+ explicit HandlerStub(Code::Kind kind) : ICStub(kind) { }
+
+ protected:
+ virtual Code::ExtraICState GetExtraICState() {
+ return Code::HANDLER_FRAGMENT;
+ }
+};
+
+
+class LoadFieldStub: public HandlerStub {
+ public:
+ LoadFieldStub(Register reg, bool inobject, int index)
+ : HandlerStub(Code::LOAD_IC),
+ reg_(reg),
+ inobject_(inobject),
+ index_(index) { }
+ virtual void Generate(MacroAssembler* masm);
+
+ protected:
+ virtual Code::StubType GetStubType() { return Code::FIELD; }
+
+ private:
+ STATIC_ASSERT(KindBits::kSize == 4);
+ class RegisterBits: public BitField<int, 4, 6> {};
+ class InobjectBits: public BitField<bool, 10, 1> {};
+ class IndexBits: public BitField<int, 11, 11> {};
+ virtual CodeStub::Major MajorKey() { return LoadField; }
+ virtual int MinorKey() {
+ return KindBits::encode(kind())
+ | RegisterBits::encode(reg_.code())
+ | InobjectBits::encode(inobject_)
+ | IndexBits::encode(index_);
+ }
+
+ Register reg_;
+ bool inobject_;
+ int index_;
+};
+
+
class BinaryOpStub: public PlatformCodeStub {
public:
BinaryOpStub(Token::Value op, OverwriteMode mode)
« no previous file with comments | « src/builtins.h ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698