Index: src/stub-cache.cc |
diff --git a/src/stub-cache.cc b/src/stub-cache.cc |
index 52e7f4cf3dfa8fc7581c63dca111b718fd86b96d..8368e9b9ef6c18fde69ea4e34b1b261175eeb9e0 100644 |
--- a/src/stub-cache.cc |
+++ b/src/stub-cache.cc |
@@ -1118,6 +1118,30 @@ Handle<Code> StoreStubCompiler::CompileStoreField(Handle<JSObject> object, |
} |
+Handle<Code> StoreStubCompiler::CompileStoreArrayLength(Handle<JSObject> object, |
+ LookupResult* lookup, |
+ Handle<Name> name) { |
+ // This accepts as a receiver anything JSArray::SetElementsLength accepts |
+ // (currently anything except for external arrays which means anything with |
+ // elements of FixedArray type). Value must be a number, but only smis are |
+ // accepted as the most common case. |
+ Label miss; |
+ |
+ // Check that value is a smi. |
+ __ JumpIfNotSmi(value(), &miss); |
+ |
+ // Generate tail call to StoreIC_ArrayLength. |
+ GenerateStoreArrayLength(); |
+ |
+ // Handle miss case. |
+ __ bind(&miss); |
+ TailCallBuiltin(masm(), MissBuiltin(kind())); |
+ |
+ // Return the generated code. |
+ return GetCode(kind(), Code::FAST, name); |
+} |
+ |
+ |
Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
Handle<JSObject> object, |
Handle<JSObject> holder, |