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

Unified Diff: src/code-stubs.h

Issue 106313003: Reland "Allocation site support for monomorphic StringAdds in BinaryOps". (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 12 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/ast.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 4e49680652fbd5518b983a47447d8be85d1db89c..bb9ff78f47f0d42af112f1c9468ebb92ddca9873 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -42,6 +42,8 @@ namespace internal {
V(CallFunction) \
V(CallConstruct) \
V(BinaryOpIC) \
+ V(BinaryOpICWithAllocationSite) \
+ V(BinaryOpWithAllocationSite) \
V(StringAdd) \
V(NewStringAdd) \
V(SubString) \
@@ -1062,7 +1064,7 @@ class KeyedArrayCallStub: public HICStub {
};
-class BinaryOpICStub V8_FINAL : public HydrogenCodeStub {
+class BinaryOpICStub : public HydrogenCodeStub {
public:
BinaryOpICStub(Token::Value op, OverwriteMode mode)
: HydrogenCodeStub(UNINITIALIZED), state_(op, mode) {}
@@ -1080,15 +1082,15 @@ class BinaryOpICStub V8_FINAL : public HydrogenCodeStub {
return Code::BINARY_OP_IC;
}
- virtual InlineCacheState GetICState() V8_OVERRIDE {
+ virtual InlineCacheState GetICState() V8_FINAL V8_OVERRIDE {
return state_.GetICState();
}
- virtual ExtraICState GetExtraICState() V8_OVERRIDE {
+ virtual ExtraICState GetExtraICState() V8_FINAL V8_OVERRIDE {
return state_.GetExtraICState();
}
- virtual void VerifyPlatformFeatures(Isolate* isolate) V8_OVERRIDE {
+ virtual void VerifyPlatformFeatures(Isolate* isolate) V8_FINAL V8_OVERRIDE {
ASSERT(CpuFeatures::VerifyCrossCompiling(SSE2));
}
@@ -1096,7 +1098,12 @@ class BinaryOpICStub V8_FINAL : public HydrogenCodeStub {
const BinaryOpIC::State& state() const { return state_; }
- virtual void PrintState(StringStream* stream) V8_OVERRIDE;
+ virtual void PrintState(StringStream* stream) V8_FINAL V8_OVERRIDE;
+
+ virtual Major MajorKey() V8_OVERRIDE { return BinaryOpIC; }
+ virtual int NotMissMinorKey() V8_FINAL V8_OVERRIDE {
+ return GetExtraICState();
+ }
// Parameters accessed via CodeStubGraphBuilder::GetParameter()
static const int kLeft = 0;
@@ -1106,15 +1113,89 @@ class BinaryOpICStub V8_FINAL : public HydrogenCodeStub {
static void GenerateAheadOfTime(Isolate* isolate,
const BinaryOpIC::State& state);
- virtual Major MajorKey() V8_OVERRIDE { return BinaryOpIC; }
- virtual int NotMissMinorKey() V8_OVERRIDE { return GetExtraICState(); }
-
BinaryOpIC::State state_;
DISALLOW_COPY_AND_ASSIGN(BinaryOpICStub);
};
+// TODO(bmeurer): Merge this into the BinaryOpICStub once we have proper tail
+// call support for stubs in Hydrogen.
+class BinaryOpICWithAllocationSiteStub V8_FINAL : public PlatformCodeStub {
+ public:
+ explicit BinaryOpICWithAllocationSiteStub(const BinaryOpIC::State& state)
+ : state_(state) {}
+
+ static void GenerateAheadOfTime(Isolate* isolate);
+
+ Handle<Code> GetCodeCopyFromTemplate(Isolate* isolate,
+ Handle<AllocationSite> allocation_site) {
+ Handle<Code> code = CodeStub::GetCodeCopyFromTemplate(isolate);
+ // Replace the placeholder oddball with the actual allocation site.
+ code->ReplaceNthObject(1, isolate->heap()->oddball_map(), *allocation_site);
+ return code;
+ }
+
+ virtual Code::Kind GetCodeKind() const V8_OVERRIDE {
+ return Code::BINARY_OP_IC;
+ }
+
+ virtual InlineCacheState GetICState() V8_OVERRIDE {
+ return state_.GetICState();
+ }
+
+ virtual ExtraICState GetExtraICState() V8_OVERRIDE {
+ return state_.GetExtraICState();
+ }
+
+ virtual void VerifyPlatformFeatures(Isolate* isolate) V8_OVERRIDE {
+ ASSERT(CpuFeatures::VerifyCrossCompiling(SSE2));
+ }
+
+ virtual void Generate(MacroAssembler* masm) V8_OVERRIDE;
+
+ virtual void PrintState(StringStream* stream) V8_OVERRIDE;
+
+ virtual Major MajorKey() V8_OVERRIDE { return BinaryOpICWithAllocationSite; }
+ virtual int MinorKey() V8_OVERRIDE { return GetExtraICState(); }
+
+ private:
+ static void GenerateAheadOfTime(Isolate* isolate,
+ const BinaryOpIC::State& state);
+
+ BinaryOpIC::State state_;
+
+ DISALLOW_COPY_AND_ASSIGN(BinaryOpICWithAllocationSiteStub);
+};
+
+
+class BinaryOpWithAllocationSiteStub V8_FINAL : public BinaryOpICStub {
+ public:
+ explicit BinaryOpWithAllocationSiteStub(const BinaryOpIC::State& state)
+ : BinaryOpICStub(state) {}
+
+ virtual void InitializeInterfaceDescriptor(
+ Isolate* isolate, CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
+
+ static void InstallDescriptors(Isolate* isolate);
+
+ virtual Code::Kind GetCodeKind() const V8_FINAL V8_OVERRIDE {
+ return Code::STUB;
+ }
+
+ virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
+
+ virtual Major MajorKey() V8_OVERRIDE {
+ return BinaryOpWithAllocationSite;
+ }
+
+ // Parameters accessed via CodeStubGraphBuilder::GetParameter()
+ static const int kAllocationSite = 0;
+ static const int kLeft = 1;
+ static const int kRight = 2;
+};
+
+
// TODO(bmeurer): Rename to StringAddStub once we dropped the old StringAddStub.
class NewStringAddStub V8_FINAL : public HydrogenCodeStub {
public:
@@ -1130,6 +1211,10 @@ class NewStringAddStub V8_FINAL : public HydrogenCodeStub {
return PretenureFlagBits::decode(bit_field_);
}
+ virtual void VerifyPlatformFeatures(Isolate* isolate) V8_OVERRIDE {
+ ASSERT(CpuFeatures::VerifyCrossCompiling(SSE2));
+ }
+
virtual Handle<Code> GenerateCode(Isolate* isolate) V8_OVERRIDE;
virtual void InitializeInterfaceDescriptor(
« no previous file with comments | « src/ast.h ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698