Chromium Code Reviews| Index: src/ia32/codegen-ia32.cc |
| diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc |
| index 02e29191dc60031b97cf48ab3059f1d4a32e266c..ecdc8f2fd3fed48793056877746de37923773932 100644 |
| --- a/src/ia32/codegen-ia32.cc |
| +++ b/src/ia32/codegen-ia32.cc |
| @@ -8234,8 +8234,8 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) { |
| Variable* variable = node->expression()->AsVariableProxy()->AsVariable(); |
| if (variable != NULL) { |
| // Delete of an unqualified identifier is disallowed in strict mode |
| - // so this code can only be reached in non-strict mode. |
| - ASSERT(strict_mode_flag() == kNonStrictMode); |
| + // (but "delete this" is). |
| + ASSERT(strict_mode_flag() == kNonStrictMode || variable->is_this()); |
|
Martin Maly
2011/02/21 20:18:36
It is not the absolutely most paranoid version of
|
| Slot* slot = variable->AsSlot(); |
| if (variable->is_global()) { |
| LoadGlobal(); |
| @@ -8244,7 +8244,6 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) { |
| Result answer = frame_->InvokeBuiltin(Builtins::DELETE, |
| CALL_FUNCTION, 3); |
| frame_->Push(&answer); |
| - return; |
| } else if (slot != NULL && slot->type() == Slot::LOOKUP) { |
| // Call the runtime to delete from the context holding the named |
| @@ -8255,13 +8254,11 @@ void CodeGenerator::VisitUnaryOperation(UnaryOperation* node) { |
| frame_->EmitPush(Immediate(variable->name())); |
| Result answer = frame_->CallRuntime(Runtime::kDeleteContextSlot, 2); |
| frame_->Push(&answer); |
| - return; |
| + } else { |
| + // Default: Result of deleting non-global, not dynamically |
| + // introduced variables is false. |
| + frame_->Push(Factory::false_value()); |
|
Martin Maly
2011/02/21 20:18:36
aligning the code layout of ia32, x64 and arm code
Mads Ager (chromium)
2011/02/22 07:42:28
Thanks.
|
| } |
| - |
| - // Default: Result of deleting non-global, not dynamically |
| - // introduced variables is false. |
| - frame_->Push(Factory::false_value()); |
| - |
| } else { |
| // Default: Result of deleting expressions is true. |
| Load(node->expression()); // may have side-effects |