Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 1badca7bc574f4c76225c02784ba0ef0cf6f8915..e48c676b4f97a39fe45a8b0663e1cd862dfabd17 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -218,12 +218,12 @@ static MaybeObject* ArrayCodeGenericCommon(Arguments* args, |
if (obj->IsSmi()) { |
int len = Smi::cast(obj)->value(); |
if (len >= 0 && len < JSObject::kInitialMaxFastElementArray) { |
- Object* obj; |
+ Object* fixed_array; |
{ MaybeObject* maybe_obj = heap->AllocateFixedArrayWithHoles(len); |
- if (!maybe_obj->ToObject(&obj)) return maybe_obj; |
+ if (!maybe_obj->ToObject(&fixed_array)) return maybe_obj; |
} |
- MaybeObject* maybe_obj = array->SetContent(FixedArray::cast(obj)); |
- if (maybe_obj->IsFailure()) return maybe_obj; |
+ array->set_elements(FixedArray::cast(fixed_array)); |
danno
2012/02/15 12:08:11
Add a comment why SetContent isn't a good idea her
|
+ array->set_length(Smi::cast(obj)); |
return array; |
} |
} |