Index: src/code-stubs.h |
diff --git a/src/code-stubs.h b/src/code-stubs.h |
index 16826db9e8e819a1be2f9ef41955ec799463ba20..63e292a51f60ac46de59e266181317a0d6c9ee9c 100644 |
--- a/src/code-stubs.h |
+++ b/src/code-stubs.h |
@@ -58,6 +58,7 @@ namespace internal { |
V(FastNewContext) \ |
V(FastNewBlockContext) \ |
V(FastCloneShallowArray) \ |
+ V(FastCloneShallowObject) \ |
V(ToBoolean) \ |
V(ToNumber) \ |
V(ArgumentsAccess) \ |
@@ -362,8 +363,8 @@ class FastCloneShallowArrayStub : public CodeStub { |
FastCloneShallowArrayStub(Mode mode, int length) |
: mode_(mode), |
length_((mode == COPY_ON_WRITE_ELEMENTS) ? 0 : length) { |
- ASSERT(length_ >= 0); |
- ASSERT(length_ <= kMaximumClonedLength); |
+ ASSERT_GE(length_, 0); |
+ ASSERT_LE(length_, kMaximumClonedLength); |
} |
void Generate(MacroAssembler* masm); |
@@ -380,6 +381,26 @@ class FastCloneShallowArrayStub : public CodeStub { |
}; |
+class FastCloneShallowObjectStub : public CodeStub { |
+ public: |
+ // Maximum number of properties in copied object. |
+ static const int kMaximumClonedProperties = 6; |
+ |
+ FastCloneShallowObjectStub(int length) : length_(length) { |
+ ASSERT_GE(length_, 0); |
+ ASSERT_LE(length_, kMaximumClonedProperties); |
+ } |
+ |
+ void Generate(MacroAssembler* masm); |
+ |
+ private: |
+ int length_; |
+ |
+ Major MajorKey() { return FastCloneShallowObject; } |
+ int MinorKey() { return length_; } |
+}; |
+ |
+ |
class InstanceofStub: public CodeStub { |
public: |
enum Flags { |