| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 7218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7229 Slot* slot = variable->AsSlot(); | 7229 Slot* slot = variable->AsSlot(); |
| 7230 if (variable->is_global()) { | 7230 if (variable->is_global()) { |
| 7231 LoadGlobal(); | 7231 LoadGlobal(); |
| 7232 frame_->Push(variable->name()); | 7232 frame_->Push(variable->name()); |
| 7233 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, | 7233 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, |
| 7234 CALL_FUNCTION, 2); | 7234 CALL_FUNCTION, 2); |
| 7235 frame_->Push(&answer); | 7235 frame_->Push(&answer); |
| 7236 return; | 7236 return; |
| 7237 | 7237 |
| 7238 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { | 7238 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { |
| 7239 // Call the runtime to look up the context holding the named | 7239 // Call the runtime to delete from the context holding the named |
| 7240 // variable. Sync the virtual frame eagerly so we can push the | 7240 // variable. Sync the virtual frame eagerly so we can push the |
| 7241 // arguments directly into place. | 7241 // arguments directly into place. |
| 7242 frame_->SyncRange(0, frame_->element_count() - 1); | 7242 frame_->SyncRange(0, frame_->element_count() - 1); |
| 7243 frame_->EmitPush(rsi); | 7243 frame_->EmitPush(rsi); |
| 7244 frame_->EmitPush(variable->name()); | 7244 frame_->EmitPush(variable->name()); |
| 7245 Result context = frame_->CallRuntime(Runtime::kLookupContext, 2); | 7245 Result answer = frame_->CallRuntime(Runtime::kDeleteContextSlot, 2); |
| 7246 ASSERT(context.is_register()); | |
| 7247 frame_->EmitPush(context.reg()); | |
| 7248 context.Unuse(); | |
| 7249 frame_->EmitPush(variable->name()); | |
| 7250 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, | |
| 7251 CALL_FUNCTION, 2); | |
| 7252 frame_->Push(&answer); | 7246 frame_->Push(&answer); |
| 7253 return; | 7247 return; |
| 7254 } | 7248 } |
| 7255 | 7249 |
| 7256 // Default: Result of deleting non-global, not dynamically | 7250 // Default: Result of deleting non-global, not dynamically |
| 7257 // introduced variables is false. | 7251 // introduced variables is false. |
| 7258 frame_->Push(FACTORY->false_value()); | 7252 frame_->Push(FACTORY->false_value()); |
| 7259 | 7253 |
| 7260 } else { | 7254 } else { |
| 7261 // Default: Result of deleting expressions is true. | 7255 // Default: Result of deleting expressions is true. |
| (...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8808 } | 8802 } |
| 8809 | 8803 |
| 8810 #endif | 8804 #endif |
| 8811 | 8805 |
| 8812 | 8806 |
| 8813 #undef __ | 8807 #undef __ |
| 8814 | 8808 |
| 8815 } } // namespace v8::internal | 8809 } } // namespace v8::internal |
| 8816 | 8810 |
| 8817 #endif // V8_TARGET_ARCH_X64 | 8811 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |