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 7217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7228 Slot* slot = variable->AsSlot(); | 7228 Slot* slot = variable->AsSlot(); |
7229 if (variable->is_global()) { | 7229 if (variable->is_global()) { |
7230 LoadGlobal(); | 7230 LoadGlobal(); |
7231 frame_->Push(variable->name()); | 7231 frame_->Push(variable->name()); |
7232 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, | 7232 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, |
7233 CALL_FUNCTION, 2); | 7233 CALL_FUNCTION, 2); |
7234 frame_->Push(&answer); | 7234 frame_->Push(&answer); |
7235 return; | 7235 return; |
7236 | 7236 |
7237 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { | 7237 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { |
7238 // Call the runtime to look up the context holding the named | 7238 // Call the runtime to delete from the context holding the named |
7239 // variable. Sync the virtual frame eagerly so we can push the | 7239 // variable. Sync the virtual frame eagerly so we can push the |
7240 // arguments directly into place. | 7240 // arguments directly into place. |
7241 frame_->SyncRange(0, frame_->element_count() - 1); | 7241 frame_->SyncRange(0, frame_->element_count() - 1); |
7242 frame_->EmitPush(rsi); | 7242 frame_->EmitPush(rsi); |
7243 frame_->EmitPush(variable->name()); | 7243 frame_->EmitPush(variable->name()); |
7244 Result context = frame_->CallRuntime(Runtime::kLookupContext, 2); | 7244 Result answer = frame_->CallRuntime(Runtime::kDeleteContextSlot, 2); |
7245 ASSERT(context.is_register()); | |
7246 frame_->EmitPush(context.reg()); | |
7247 context.Unuse(); | |
7248 frame_->EmitPush(variable->name()); | |
7249 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, | |
7250 CALL_FUNCTION, 2); | |
7251 frame_->Push(&answer); | 7245 frame_->Push(&answer); |
7252 return; | 7246 return; |
7253 } | 7247 } |
7254 | 7248 |
7255 // Default: Result of deleting non-global, not dynamically | 7249 // Default: Result of deleting non-global, not dynamically |
7256 // introduced variables is false. | 7250 // introduced variables is false. |
7257 frame_->Push(Factory::false_value()); | 7251 frame_->Push(Factory::false_value()); |
7258 | 7252 |
7259 } else { | 7253 } else { |
7260 // Default: Result of deleting expressions is true. | 7254 // Default: Result of deleting expressions is true. |
(...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8804 } | 8798 } |
8805 | 8799 |
8806 #endif | 8800 #endif |
8807 | 8801 |
8808 | 8802 |
8809 #undef __ | 8803 #undef __ |
8810 | 8804 |
8811 } } // namespace v8::internal | 8805 } } // namespace v8::internal |
8812 | 8806 |
8813 #endif // V8_TARGET_ARCH_X64 | 8807 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |