Index: src/arm/codegen-arm.cc |
diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc |
index d32b009109ae8b9b95baac5c41ae58ab64ee6f1e..4f243eab015081234b7797d168d1fa16321e4e73 100644 |
--- a/src/arm/codegen-arm.cc |
+++ b/src/arm/codegen-arm.cc |
@@ -577,11 +577,13 @@ void CodeGenerator::LoadGlobalReceiver(Register scratch) { |
ArgumentsAllocationMode CodeGenerator::ArgumentsMode() { |
if (scope()->arguments() == NULL) return NO_ARGUMENTS_ALLOCATION; |
- ASSERT(scope()->arguments_shadow() != NULL); |
+ |
+ // In strict mode there is no need for shadow arguments. |
+ ASSERT(scope()->arguments_shadow() != NULL || scope()->is_strict_mode()); |
// We don't want to do lazy arguments allocation for functions that |
// have heap-allocated contexts, because it interfers with the |
// uninitialized const tracking in the context objects. |
- return (scope()->num_heap_slots() > 0) |
+ return (scope()->num_heap_slots() > 0 || scope()->is_strict_mode()) |
? EAGER_ARGUMENTS_ALLOCATION |
: LAZY_ARGUMENTS_ALLOCATION; |
} |
@@ -615,7 +617,9 @@ void CodeGenerator::StoreArgumentsObject(bool initial) { |
Variable* arguments = scope()->arguments(); |
Variable* shadow = scope()->arguments_shadow(); |
ASSERT(arguments != NULL && arguments->AsSlot() != NULL); |
- ASSERT(shadow != NULL && shadow->AsSlot() != NULL); |
+ ASSERT((shadow != NULL && shadow->AsSlot() != NULL) || |
+ scope()->is_strict_mode()); |
+ |
JumpTarget done; |
if (mode == LAZY_ARGUMENTS_ALLOCATION && !initial) { |
// We have to skip storing into the arguments slot if it has |
@@ -629,7 +633,9 @@ void CodeGenerator::StoreArgumentsObject(bool initial) { |
} |
StoreToSlot(arguments->AsSlot(), NOT_CONST_INIT); |
if (mode == LAZY_ARGUMENTS_ALLOCATION) done.Bind(); |
- StoreToSlot(shadow->AsSlot(), NOT_CONST_INIT); |
+ if (shadow != NULL) { |
+ StoreToSlot(shadow->AsSlot(), NOT_CONST_INIT); |
+ } |
} |