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

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

Issue 6280013: Fix a bug in delete for lookup slots. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 11 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 8212 matching lines...) Expand 10 before | Expand all | Expand 10 after
8223 Slot* slot = variable->AsSlot(); 8223 Slot* slot = variable->AsSlot();
8224 if (variable->is_global()) { 8224 if (variable->is_global()) {
8225 LoadGlobal(); 8225 LoadGlobal();
8226 frame_->Push(variable->name()); 8226 frame_->Push(variable->name());
8227 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, 8227 Result answer = frame_->InvokeBuiltin(Builtins::DELETE,
8228 CALL_FUNCTION, 2); 8228 CALL_FUNCTION, 2);
8229 frame_->Push(&answer); 8229 frame_->Push(&answer);
8230 return; 8230 return;
8231 8231
8232 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { 8232 } else if (slot != NULL && slot->type() == Slot::LOOKUP) {
8233 // Call the runtime to look up the context holding the named 8233 // Call the runtime to delete from the context holding the named
8234 // variable. Sync the virtual frame eagerly so we can push the 8234 // variable. Sync the virtual frame eagerly so we can push the
8235 // arguments directly into place. 8235 // arguments directly into place.
8236 frame_->SyncRange(0, frame_->element_count() - 1); 8236 frame_->SyncRange(0, frame_->element_count() - 1);
8237 frame_->EmitPush(esi); 8237 frame_->EmitPush(esi);
8238 frame_->EmitPush(Immediate(variable->name())); 8238 frame_->EmitPush(Immediate(variable->name()));
8239 Result context = frame_->CallRuntime(Runtime::kLookupContext, 2); 8239 Result answer = frame_->CallRuntime(Runtime::kDeleteContextSlot, 2);
8240 ASSERT(context.is_register());
8241 frame_->EmitPush(context.reg());
8242 context.Unuse();
8243 frame_->EmitPush(Immediate(variable->name()));
8244 Result answer = frame_->InvokeBuiltin(Builtins::DELETE,
8245 CALL_FUNCTION, 2);
8246 frame_->Push(&answer); 8240 frame_->Push(&answer);
8247 return; 8241 return;
8248 } 8242 }
8249 8243
8250 // Default: Result of deleting non-global, not dynamically 8244 // Default: Result of deleting non-global, not dynamically
8251 // introduced variables is false. 8245 // introduced variables is false.
8252 frame_->Push(Factory::false_value()); 8246 frame_->Push(Factory::false_value());
8253 8247
8254 } else { 8248 } else {
8255 // Default: Result of deleting expressions is true. 8249 // Default: Result of deleting expressions is true.
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after
10316 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); 10310 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size);
10317 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); 10311 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size);
10318 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress()); 10312 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress());
10319 } 10313 }
10320 10314
10321 #undef __ 10315 #undef __
10322 10316
10323 } } // namespace v8::internal 10317 } } // namespace v8::internal
10324 10318
10325 #endif // V8_TARGET_ARCH_IA32 10319 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698