| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1591 } | 1591 } |
| 1592 } | 1592 } |
| 1593 | 1593 |
| 1594 | 1594 |
| 1595 void CodeGenerator::VisitWithEnterStatement(WithEnterStatement* node) { | 1595 void CodeGenerator::VisitWithEnterStatement(WithEnterStatement* node) { |
| 1596 ASSERT(!in_spilled_code()); | 1596 ASSERT(!in_spilled_code()); |
| 1597 VirtualFrame::SpilledScope spilled_scope(this); | 1597 VirtualFrame::SpilledScope spilled_scope(this); |
| 1598 Comment cmnt(masm_, "[ WithEnterStatement"); | 1598 Comment cmnt(masm_, "[ WithEnterStatement"); |
| 1599 CodeForStatement(node); | 1599 CodeForStatement(node); |
| 1600 LoadAndSpill(node->expression()); | 1600 LoadAndSpill(node->expression()); |
| 1601 frame_->CallRuntime(Runtime::kPushContext, 1); | 1601 if (node->is_catch_block()) { |
| 1602 frame_->CallRuntime(Runtime::kPushCatchContext, 1); |
| 1603 } else { |
| 1604 frame_->CallRuntime(Runtime::kPushContext, 1); |
| 1605 } |
| 1602 | 1606 |
| 1603 if (kDebug) { | 1607 if (kDebug) { |
| 1604 JumpTarget verified_true(this); | 1608 JumpTarget verified_true(this); |
| 1605 // Verify eax and esi are the same in debug mode | 1609 // Verify eax and esi are the same in debug mode |
| 1606 __ cmp(eax, Operand(esi)); | 1610 __ cmp(eax, Operand(esi)); |
| 1607 verified_true.Branch(equal); | 1611 verified_true.Branch(equal); |
| 1608 __ int3(); | 1612 __ int3(); |
| 1609 verified_true.Bind(); | 1613 verified_true.Bind(); |
| 1610 } | 1614 } |
| 1611 | 1615 |
| (...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4201 } | 4205 } |
| 4202 frame->EmitPush(eax); // IC call leaves result in eax, push it out | 4206 frame->EmitPush(eax); // IC call leaves result in eax, push it out |
| 4203 break; | 4207 break; |
| 4204 } | 4208 } |
| 4205 | 4209 |
| 4206 case KEYED: { | 4210 case KEYED: { |
| 4207 // TODO(1241834): Make sure that this it is safe to ignore the | 4211 // TODO(1241834): Make sure that this it is safe to ignore the |
| 4208 // distinction between expressions in a typeof and not in a typeof. | 4212 // distinction between expressions in a typeof and not in a typeof. |
| 4209 VirtualFrame::SpilledScope spilled_scope(cgen_); | 4213 VirtualFrame::SpilledScope spilled_scope(cgen_); |
| 4210 Comment cmnt(masm, "[ Load from keyed Property"); | 4214 Comment cmnt(masm, "[ Load from keyed Property"); |
| 4211 Property* property = expression_->AsProperty(); | |
| 4212 ASSERT(property != NULL); | |
| 4213 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); | 4215 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); |
| 4214 | 4216 |
| 4215 Variable* var = expression_->AsVariableProxy()->AsVariable(); | 4217 Variable* var = expression_->AsVariableProxy()->AsVariable(); |
| 4216 if (var != NULL) { | 4218 if (var != NULL) { |
| 4217 ASSERT(var->is_global()); | 4219 ASSERT(var->is_global()); |
| 4218 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET_CONTEXT, 0); | 4220 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET_CONTEXT, 0); |
| 4219 } else { | 4221 } else { |
| 4220 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 4222 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
| 4221 } | 4223 } |
| 4222 frame->EmitPush(eax); // IC call leaves result in eax, push it out | 4224 frame->EmitPush(eax); // IC call leaves result in eax, push it out |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4254 // Setup the name register. | 4256 // Setup the name register. |
| 4255 __ mov(ecx, name); | 4257 __ mov(ecx, name); |
| 4256 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 4258 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
| 4257 frame->EmitPush(eax); // IC call leaves result in eax, push it out | 4259 frame->EmitPush(eax); // IC call leaves result in eax, push it out |
| 4258 break; | 4260 break; |
| 4259 } | 4261 } |
| 4260 | 4262 |
| 4261 case KEYED: { | 4263 case KEYED: { |
| 4262 VirtualFrame::SpilledScope spilled_scope(cgen_); | 4264 VirtualFrame::SpilledScope spilled_scope(cgen_); |
| 4263 Comment cmnt(masm, "[ Store to keyed Property"); | 4265 Comment cmnt(masm, "[ Store to keyed Property"); |
| 4264 Property* property = expression_->AsProperty(); | |
| 4265 ASSERT(property != NULL); | |
| 4266 // Call IC code. | 4266 // Call IC code. |
| 4267 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); | 4267 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); |
| 4268 // TODO(1222589): Make the IC grab the values from the stack. | 4268 // TODO(1222589): Make the IC grab the values from the stack. |
| 4269 frame->EmitPop(eax); | 4269 frame->EmitPop(eax); |
| 4270 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); | 4270 frame->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); |
| 4271 frame->EmitPush(eax); // IC call leaves result in eax, push it out | 4271 frame->EmitPush(eax); // IC call leaves result in eax, push it out |
| 4272 break; | 4272 break; |
| 4273 } | 4273 } |
| 4274 | 4274 |
| 4275 default: | 4275 default: |
| (...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5652 | 5652 |
| 5653 // Slow-case: Go through the JavaScript implementation. | 5653 // Slow-case: Go through the JavaScript implementation. |
| 5654 __ bind(&slow); | 5654 __ bind(&slow); |
| 5655 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 5655 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
| 5656 } | 5656 } |
| 5657 | 5657 |
| 5658 | 5658 |
| 5659 #undef __ | 5659 #undef __ |
| 5660 | 5660 |
| 5661 } } // namespace v8::internal | 5661 } } // namespace v8::internal |
| OLD | NEW |