Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: src/x64/codegen-x64.cc

Issue 6515005: Strict mode delete. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 7212 matching lines...) Expand 10 before | Expand all | Expand 10 after
7223 destination()->Invert(); 7223 destination()->Invert();
7224 LoadCondition(node->expression(), destination(), true); 7224 LoadCondition(node->expression(), destination(), true);
7225 // Swap the labels back. 7225 // Swap the labels back.
7226 destination()->Invert(); 7226 destination()->Invert();
7227 7227
7228 } else if (op == Token::DELETE) { 7228 } else if (op == Token::DELETE) {
7229 Property* property = node->expression()->AsProperty(); 7229 Property* property = node->expression()->AsProperty();
7230 if (property != NULL) { 7230 if (property != NULL) {
7231 Load(property->obj()); 7231 Load(property->obj());
7232 Load(property->key()); 7232 Load(property->key());
7233 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, 2); 7233 frame_->Push(Smi::FromInt(strict_mode_flag()));
7234 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, 3);
7234 frame_->Push(&answer); 7235 frame_->Push(&answer);
7235 return; 7236 return;
7236 } 7237 }
7237 7238
7238 Variable* variable = node->expression()->AsVariableProxy()->AsVariable(); 7239 Variable* variable = node->expression()->AsVariableProxy()->AsVariable();
7239 if (variable != NULL) { 7240 if (variable != NULL) {
7241 ASSERT(strict_mode_flag() == kNonStrictMode);
7240 Slot* slot = variable->AsSlot(); 7242 Slot* slot = variable->AsSlot();
7241 if (variable->is_global()) { 7243 if (variable->is_global()) {
7242 LoadGlobal(); 7244 LoadGlobal();
7243 frame_->Push(variable->name()); 7245 frame_->Push(variable->name());
7246 frame_->Push(Smi::FromInt(kNonStrictMode));
7244 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, 7247 Result answer = frame_->InvokeBuiltin(Builtins::DELETE,
7245 CALL_FUNCTION, 2); 7248 CALL_FUNCTION, 3);
7246 frame_->Push(&answer); 7249 frame_->Push(&answer);
7247 return; 7250 return;
7248 7251
7249 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { 7252 } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
7250 // Call the runtime to delete from the context holding the named 7253 // Call the runtime to delete from the context holding the named
7251 // variable. Sync the virtual frame eagerly so we can push the 7254 // variable. Sync the virtual frame eagerly so we can push the
7252 // arguments directly into place. 7255 // arguments directly into place.
7253 frame_->SyncRange(0, frame_->element_count() - 1); 7256 frame_->SyncRange(0, frame_->element_count() - 1);
7254 frame_->EmitPush(rsi); 7257 frame_->EmitPush(rsi);
7255 frame_->EmitPush(variable->name()); 7258 frame_->EmitPush(variable->name());
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after
8810 } 8813 }
8811 8814
8812 #endif 8815 #endif
8813 8816
8814 8817
8815 #undef __ 8818 #undef __
8816 8819
8817 } } // namespace v8::internal 8820 } } // namespace v8::internal
8818 8821
8819 #endif // V8_TARGET_ARCH_X64 8822 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698