From 545c04b9bddfb15fd9cdf2db70a7fac93c638f6a Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Wed, 27 Aug 2014 10:00:06 +0000 Subject: [PATCH] Minor-key-ify BinaryOpICWithAllocationSiteStub. R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/506003002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23444 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/code-stubs-arm.cc | 2 +- src/arm64/code-stubs-arm64.cc | 2 +- src/code-stubs.cc | 2 +- src/code-stubs.h | 13 +++++++------ src/ia32/code-stubs-ia32.cc | 2 +- src/x64/code-stubs-x64.cc | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 73b68ae..3c9da2f 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -3723,7 +3723,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { // Tail call into the stub that handles binary operations with allocation // sites. - BinaryOpWithAllocationSiteStub stub(isolate(), state_); + BinaryOpWithAllocationSiteStub stub(isolate(), state()); __ TailCallStub(&stub); } diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc index 5daca9c..03c07f4 100644 --- a/src/arm64/code-stubs-arm64.cc +++ b/src/arm64/code-stubs-arm64.cc @@ -4332,7 +4332,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { // Tail call into the stub that handles binary operations with allocation // sites. - BinaryOpWithAllocationSiteStub stub(isolate(), state_); + BinaryOpWithAllocationSiteStub stub(isolate(), state()); __ TailCallStub(&stub); } diff --git a/src/code-stubs.cc b/src/code-stubs.cc index e347c13..e6209f5 100644 --- a/src/code-stubs.cc +++ b/src/code-stubs.cc @@ -291,7 +291,7 @@ void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { void BinaryOpICWithAllocationSiteStub::PrintState( OStream& os) const { // NOLINT - os << state_; + os << state(); } diff --git a/src/code-stubs.h b/src/code-stubs.h index 85314d0..613e637 100644 --- a/src/code-stubs.h +++ b/src/code-stubs.h @@ -1201,7 +1201,7 @@ class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub { public: BinaryOpICWithAllocationSiteStub(Isolate* isolate, const BinaryOpIC::State& state) - : PlatformCodeStub(isolate), state_(state) { + : PlatformCodeStub(isolate) { minor_key_ = state.GetExtraICState(); } @@ -1218,11 +1218,11 @@ class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub { } virtual InlineCacheState GetICState() const V8_OVERRIDE { - return state_.GetICState(); + return state().GetICState(); } virtual ExtraICState GetExtraICState() const V8_OVERRIDE { - return state_.GetExtraICState(); + return static_cast(minor_key_); } virtual void Generate(MacroAssembler* masm) V8_OVERRIDE; @@ -1232,14 +1232,15 @@ class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub { virtual Major MajorKey() const V8_OVERRIDE { return BinaryOpICWithAllocationSite; } - virtual uint32_t MinorKey() const V8_OVERRIDE { return GetExtraICState(); } private: + BinaryOpIC::State state() const { + return BinaryOpIC::State(isolate(), static_cast(minor_key_)); + } + static void GenerateAheadOfTime(Isolate* isolate, const BinaryOpIC::State& state); - BinaryOpIC::State state_; - DISALLOW_COPY_AND_ASSIGN(BinaryOpICWithAllocationSiteStub); }; diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index f6f2dff..bea150c 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -3626,7 +3626,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { // Tail call into the stub that handles binary operations with allocation // sites. - BinaryOpWithAllocationSiteStub stub(isolate(), state_); + BinaryOpWithAllocationSiteStub stub(isolate(), state()); __ TailCallStub(&stub); } diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc index 51e372c..b2e9297 100644 --- a/src/x64/code-stubs-x64.cc +++ b/src/x64/code-stubs-x64.cc @@ -3593,7 +3593,7 @@ void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { // Tail call into the stub that handles binary operations with allocation // sites. - BinaryOpWithAllocationSiteStub stub(isolate(), state_); + BinaryOpWithAllocationSiteStub stub(isolate(), state()); __ TailCallStub(&stub); } -- 2.7.4