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

Unified Diff: src/code-stubs.h

Issue 172523002: Create a function call IC (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Comments addressed. Created 6 years, 9 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
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 03849aae5c600e71ef47b69719dcada0ef690fc8..d5e3bb0482ea5d316266dfd4f9d06a9c31bd4567 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -52,6 +52,7 @@ namespace internal {
V(CompareNilIC) \
V(MathPow) \
V(StringLength) \
+ V(CallIC) \
V(FunctionPrototype) \
V(StoreArrayLength) \
V(RecordWrite) \
@@ -824,6 +825,59 @@ class ICStub: public PlatformCodeStub {
};
+class CallICStub: public PlatformCodeStub {
+ public:
+ explicit CallICStub(const CallIC::State& state)
+ : state_(state) {}
+
+ int arg_count() const { return state_.arg_count(); }
+ CallIC::CallType call_type() const { return state_.call_type(); }
+ CallIC::StubType stub_type() const { return state_.stub_type(); }
+ CallIC::ArgumentCheck argument_check() const {
+ return state_.argument_check();
+ }
+ CallIC::FunctionAttributes function_attributes() const {
+ return state_.function_attributes();
+ }
+
+ static int ExtractArgcFromMinorKey(int minor_key) {
+ CallIC::State state((ExtraICState) minor_key);
+ return state.arg_count();
+ }
+
+ virtual void Generate(MacroAssembler* masm);
+
+ virtual Code::Kind GetCodeKind() const V8_OVERRIDE {
+ return Code::CALL_IC;
+ }
+
+ virtual InlineCacheState GetICState() V8_FINAL V8_OVERRIDE {
+ return state_.GetICState();
+ }
+
+ virtual ExtraICState GetExtraICState() V8_FINAL V8_OVERRIDE {
+ return state_.GetExtraICState();
+ }
+
+ static void GenerateAheadOfTime(Isolate* isolate);
+
+ protected:
+ virtual int MinorKey() { return GetExtraICState(); }
+ virtual void PrintState(StringStream* stream) V8_FINAL V8_OVERRIDE;
+
+ private:
+ virtual CodeStub::Major MajorKey() { return CallIC; }
+
+ // Code generation helpers.
+ void GenerateCall(MacroAssembler* masm, CallIC::StubType stub_type,
+ CallIC::ArgumentCheck argument_check,
+ CallIC::FunctionAttributes attributes);
+ void GenerateMiss(MacroAssembler* masm);
+
+ CallIC::State state_;
+};
+
+
class FunctionPrototypeStub: public ICStub {
public:
explicit FunctionPrototypeStub(Code::Kind kind) : ICStub(kind) { }
@@ -1586,7 +1640,10 @@ class RegExpConstructResultStub V8_FINAL : public HydrogenCodeStub {
class CallFunctionStub: public PlatformCodeStub {
public:
CallFunctionStub(int argc, CallFunctionFlags flags)
- : argc_(argc), flags_(flags) { }
+ : argc_(argc), flags_(flags) {
+ // CallFunctionStub no longer supports RECORD_CALL_TARGET.
+ ASSERT(flags != RECORD_CALL_TARGET);
+ }
void Generate(MacroAssembler* masm);
« no previous file with comments | « src/builtins.cc ('k') | src/code-stubs.cc » ('j') | src/ia32/code-stubs-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698