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

Side by Side Diff: src/ia32/codegen-ia32.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 8207 matching lines...) Expand 10 before | Expand all | Expand 10 after
8218 destination()->Invert(); 8218 destination()->Invert();
8219 LoadCondition(node->expression(), destination(), true); 8219 LoadCondition(node->expression(), destination(), true);
8220 // Swap the labels back. 8220 // Swap the labels back.
8221 destination()->Invert(); 8221 destination()->Invert();
8222 8222
8223 } else if (op == Token::DELETE) { 8223 } else if (op == Token::DELETE) {
8224 Property* property = node->expression()->AsProperty(); 8224 Property* property = node->expression()->AsProperty();
8225 if (property != NULL) { 8225 if (property != NULL) {
8226 Load(property->obj()); 8226 Load(property->obj());
8227 Load(property->key()); 8227 Load(property->key());
8228 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, 2); 8228 frame_->Push(Smi::FromInt(strict_mode_flag()));
8229 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, 3);
8229 frame_->Push(&answer); 8230 frame_->Push(&answer);
8230 return; 8231 return;
8231 } 8232 }
8232 8233
8233 Variable* variable = node->expression()->AsVariableProxy()->AsVariable(); 8234 Variable* variable = node->expression()->AsVariableProxy()->AsVariable();
8234 if (variable != NULL) { 8235 if (variable != NULL) {
8236 ASSERT(strict_mode_flag() == kNonStrictMode);
8235 Slot* slot = variable->AsSlot(); 8237 Slot* slot = variable->AsSlot();
8236 if (variable->is_global()) { 8238 if (variable->is_global()) {
8237 LoadGlobal(); 8239 LoadGlobal();
8238 frame_->Push(variable->name()); 8240 frame_->Push(variable->name());
8241 frame_->Push(Smi::FromInt(kNonStrictMode));
8239 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, 8242 Result answer = frame_->InvokeBuiltin(Builtins::DELETE,
8240 CALL_FUNCTION, 2); 8243 CALL_FUNCTION, 3);
8241 frame_->Push(&answer); 8244 frame_->Push(&answer);
8242 return; 8245 return;
8243 8246
8244 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { 8247 } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
8245 // Call the runtime to delete from the context holding the named 8248 // Call the runtime to delete from the context holding the named
8246 // variable. Sync the virtual frame eagerly so we can push the 8249 // variable. Sync the virtual frame eagerly so we can push the
8247 // arguments directly into place. 8250 // arguments directly into place.
8248 frame_->SyncRange(0, frame_->element_count() - 1); 8251 frame_->SyncRange(0, frame_->element_count() - 1);
8249 frame_->EmitPush(esi); 8252 frame_->EmitPush(esi);
8250 frame_->EmitPush(Immediate(variable->name())); 8253 frame_->EmitPush(Immediate(variable->name()));
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after
10322 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); 10325 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
10323 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); 10326 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
10324 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress()); 10327 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress());
10325 } 10328 }
10326 10329
10327 #undef __ 10330 #undef __
10328 10331
10329 } } // namespace v8::internal 10332 } } // namespace v8::internal
10330 10333
10331 #endif // V8_TARGET_ARCH_IA32 10334 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698