Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index 41fc8eaf3e38df11d5413ad0c047275a54990d40..1e35bf406d00a9228bd0d3fa9bb7eb2d66ff3005 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -19,6 +19,7 @@ namespace v8 { |
namespace internal { |
// Forward declarations. |
+class ArrayLiteral; |
class CodeStubAssembler; |
class ObjectLiteral; |
namespace compiler { |
@@ -923,6 +924,11 @@ class FastCloneRegExpStub final : public TurboFanCodeStub { |
class FastCloneShallowArrayStub : public TurboFanCodeStub { |
public: |
+ // Maximum number of elements in copied array (chosen so that even an array |
+ // backed by a double backing store will fit into new-space). |
+ static const int kMaximumClonedElements = |
+ JSArray::kInitialMaxFastElementArray * kPointerSize / kDoubleSize; |
+ |
FastCloneShallowArrayStub(Isolate* isolate, |
AllocationSiteMode allocation_site_mode) |
: TurboFanCodeStub(isolate) { |
@@ -936,6 +942,8 @@ class FastCloneShallowArrayStub : public TurboFanCodeStub { |
compiler::CodeAssemblerLabel* call_runtime, |
AllocationSiteMode allocation_site_mode); |
+ static bool IsSupported(ArrayLiteral* expr); |
+ |
AllocationSiteMode allocation_site_mode() const { |
return AllocationSiteModeBits::decode(minor_key_); |
} |