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

Unified Diff: src/code-stubs.h

Issue 12521011: Compile FastCloneShallowArrayStub using Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make this thing work with snapshots. Created 7 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
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | src/hydrogen.cc » ('J')
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 151a51ca31d03c123035dfc7a3c789b4a358eae9..e8c2ea83be15ce4500bdb96e13e7605c9da7c88a 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -442,7 +442,7 @@ class FastNewBlockContextStub : public PlatformCodeStub {
};
-class FastCloneShallowArrayStub : public PlatformCodeStub {
+class FastCloneShallowArrayStub : public HydrogenCodeStub {
public:
// Maximum length of copied elements array.
static const int kMaximumClonedLength = 8;
@@ -466,7 +466,31 @@ class FastCloneShallowArrayStub : public PlatformCodeStub {
ASSERT_LE(length_, kMaximumClonedLength);
}
- void Generate(MacroAssembler* masm);
+ Mode mode() const { return mode_; }
+ int length() const { return length_; }
+ AllocationSiteMode allocation_site_mode() const {
+ return allocation_site_mode_;
+ }
+
+ ElementsKind ComputeElementsKind() const {
+ switch (mode()) {
+ case CLONE_ELEMENTS:
+ case COPY_ON_WRITE_ELEMENTS:
+ return FAST_ELEMENTS;
+ case CLONE_DOUBLE_ELEMENTS:
+ return FAST_DOUBLE_ELEMENTS;
+ case CLONE_ANY_ELEMENTS:
+ /*fall-through*/;
+ }
+ UNREACHABLE();
+ return LAST_ELEMENTS_KIND;
+ }
+
+ virtual Handle<Code> GenerateCode();
+
+ virtual void InitializeInterfaceDescriptor(
+ Isolate* isolate,
+ CodeStubInterfaceDescriptor* descriptor);
private:
Mode mode_;
@@ -1573,18 +1597,26 @@ class StubFailureTrampolineStub : public PlatformCodeStub {
static const int kMaxExtraExpressionStackCount = 1;
explicit StubFailureTrampolineStub(int extra_expression_stack_count)
- : extra_expression_stack_count_(extra_expression_stack_count) {}
+ : fp_registers_(CanUseFPRegisters()),
+ extra_expression_stack_count_(extra_expression_stack_count) {}
virtual bool IsPregenerated() { return true; }
static void GenerateAheadOfTime(Isolate* isolate);
private:
+ class FPRegisters: public BitField<bool, 0, 1> {};
+ class ExtraStackCount: public BitField<int, 1, 1> {};
+
Major MajorKey() { return StubFailureTrampoline; }
- int MinorKey() { return extra_expression_stack_count_; }
+ int MinorKey() {
+ return FPRegisters::encode(fp_registers_) |
+ ExtraStackCount::encode(extra_expression_stack_count_);
+ }
void Generate(MacroAssembler* masm);
+ bool fp_registers_;
int extra_expression_stack_count_;
DISALLOW_COPY_AND_ASSIGN(StubFailureTrampolineStub);
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698