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 8216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8227 Load(property->key()); | 8227 Load(property->key()); |
8228 frame_->Push(Smi::FromInt(strict_mode_flag())); | 8228 frame_->Push(Smi::FromInt(strict_mode_flag())); |
8229 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, 3); | 8229 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, 3); |
8230 frame_->Push(&answer); | 8230 frame_->Push(&answer); |
8231 return; | 8231 return; |
8232 } | 8232 } |
8233 | 8233 |
8234 Variable* variable = node->expression()->AsVariableProxy()->AsVariable(); | 8234 Variable* variable = node->expression()->AsVariableProxy()->AsVariable(); |
8235 if (variable != NULL) { | 8235 if (variable != NULL) { |
8236 // Delete of an unqualified identifier is disallowed in strict mode | 8236 // Delete of an unqualified identifier is disallowed in strict mode |
8237 // so this code can only be reached in non-strict mode. | 8237 // (but "delete this" is). |
8238 ASSERT(strict_mode_flag() == kNonStrictMode); | 8238 ASSERT(strict_mode_flag() == kNonStrictMode || variable->is_this()); |
Martin Maly
2011/02/21 20:18:36
It is not the absolutely most paranoid version of
| |
8239 Slot* slot = variable->AsSlot(); | 8239 Slot* slot = variable->AsSlot(); |
8240 if (variable->is_global()) { | 8240 if (variable->is_global()) { |
8241 LoadGlobal(); | 8241 LoadGlobal(); |
8242 frame_->Push(variable->name()); | 8242 frame_->Push(variable->name()); |
8243 frame_->Push(Smi::FromInt(kNonStrictMode)); | 8243 frame_->Push(Smi::FromInt(kNonStrictMode)); |
8244 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, | 8244 Result answer = frame_->InvokeBuiltin(Builtins::DELETE, |
8245 CALL_FUNCTION, 3); | 8245 CALL_FUNCTION, 3); |
8246 frame_->Push(&answer); | 8246 frame_->Push(&answer); |
8247 return; | |
8248 | 8247 |
8249 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { | 8248 } else if (slot != NULL && slot->type() == Slot::LOOKUP) { |
8250 // Call the runtime to delete from the context holding the named | 8249 // Call the runtime to delete from the context holding the named |
8251 // variable. Sync the virtual frame eagerly so we can push the | 8250 // variable. Sync the virtual frame eagerly so we can push the |
8252 // arguments directly into place. | 8251 // arguments directly into place. |
8253 frame_->SyncRange(0, frame_->element_count() - 1); | 8252 frame_->SyncRange(0, frame_->element_count() - 1); |
8254 frame_->EmitPush(esi); | 8253 frame_->EmitPush(esi); |
8255 frame_->EmitPush(Immediate(variable->name())); | 8254 frame_->EmitPush(Immediate(variable->name())); |
8256 Result answer = frame_->CallRuntime(Runtime::kDeleteContextSlot, 2); | 8255 Result answer = frame_->CallRuntime(Runtime::kDeleteContextSlot, 2); |
8257 frame_->Push(&answer); | 8256 frame_->Push(&answer); |
8258 return; | 8257 } else { |
8258 // Default: Result of deleting non-global, not dynamically | |
8259 // introduced variables is false. | |
8260 frame_->Push(Factory::false_value()); | |
Martin Maly
2011/02/21 20:18:36
aligning the code layout of ia32, x64 and arm code
Mads Ager (chromium)
2011/02/22 07:42:28
Thanks.
| |
8259 } | 8261 } |
8260 | |
8261 // Default: Result of deleting non-global, not dynamically | |
8262 // introduced variables is false. | |
8263 frame_->Push(Factory::false_value()); | |
8264 | |
8265 } else { | 8262 } else { |
8266 // Default: Result of deleting expressions is true. | 8263 // Default: Result of deleting expressions is true. |
8267 Load(node->expression()); // may have side-effects | 8264 Load(node->expression()); // may have side-effects |
8268 frame_->SetElementAt(0, Factory::true_value()); | 8265 frame_->SetElementAt(0, Factory::true_value()); |
8269 } | 8266 } |
8270 | 8267 |
8271 } else if (op == Token::TYPEOF) { | 8268 } else if (op == Token::TYPEOF) { |
8272 // Special case for loading the typeof expression; see comment on | 8269 // Special case for loading the typeof expression; see comment on |
8273 // LoadTypeofExpression(). | 8270 // LoadTypeofExpression(). |
8274 LoadTypeofExpression(node->expression()); | 8271 LoadTypeofExpression(node->expression()); |
(...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10327 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); | 10324 memcpy(chunk->GetStartAddress(), desc.buffer, desc.instr_size); |
10328 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); | 10325 CPU::FlushICache(chunk->GetStartAddress(), desc.instr_size); |
10329 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress()); | 10326 return FUNCTION_CAST<MemCopyFunction>(chunk->GetStartAddress()); |
10330 } | 10327 } |
10331 | 10328 |
10332 #undef __ | 10329 #undef __ |
10333 | 10330 |
10334 } } // namespace v8::internal | 10331 } } // namespace v8::internal |
10335 | 10332 |
10336 #endif // V8_TARGET_ARCH_IA32 | 10333 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |