| 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 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 Comment cmnt(masm_, "[ BreakStatement"); | 1283 Comment cmnt(masm_, "[ BreakStatement"); |
| 1284 CodeForStatementPosition(node); | 1284 CodeForStatementPosition(node); |
| 1285 CleanStack(break_stack_height_ - node->target()->break_stack_height()); | 1285 CleanStack(break_stack_height_ - node->target()->break_stack_height()); |
| 1286 node->target()->break_target()->Jump(); | 1286 node->target()->break_target()->Jump(); |
| 1287 } | 1287 } |
| 1288 | 1288 |
| 1289 | 1289 |
| 1290 void CodeGenerator::VisitReturnStatement(ReturnStatement* node) { | 1290 void CodeGenerator::VisitReturnStatement(ReturnStatement* node) { |
| 1291 VirtualFrame::SpilledScope spilled_scope(this); | 1291 VirtualFrame::SpilledScope spilled_scope(this); |
| 1292 Comment cmnt(masm_, "[ ReturnStatement"); | 1292 Comment cmnt(masm_, "[ ReturnStatement"); |
| 1293 CodeForStatementPosition(node); | |
| 1294 LoadAndSpill(node->expression()); | |
| 1295 // Move the function result into r0. | |
| 1296 frame_->EmitPop(r0); | |
| 1297 | 1293 |
| 1298 function_return_.Jump(); | 1294 if (function_return_is_shadowed_) { |
| 1295 CodeForStatementPosition(node); |
| 1296 LoadAndSpill(node->expression()); |
| 1297 frame_->EmitPop(r0); |
| 1298 function_return_.Jump(); |
| 1299 } else { |
| 1300 // Load the returned value. |
| 1301 CodeForStatementPosition(node); |
| 1302 LoadAndSpill(node->expression()); |
| 1303 |
| 1304 // Pop the result from the frame and prepare the frame for |
| 1305 // returning thus making it easier to merge. |
| 1306 frame_->EmitPop(r0); |
| 1307 frame_->PrepareForReturn(); |
| 1308 |
| 1309 function_return_.Jump(); |
| 1310 } |
| 1299 } | 1311 } |
| 1300 | 1312 |
| 1301 | 1313 |
| 1302 void CodeGenerator::VisitWithEnterStatement(WithEnterStatement* node) { | 1314 void CodeGenerator::VisitWithEnterStatement(WithEnterStatement* node) { |
| 1303 VirtualFrame::SpilledScope spilled_scope(this); | 1315 VirtualFrame::SpilledScope spilled_scope(this); |
| 1304 Comment cmnt(masm_, "[ WithEnterStatement"); | 1316 Comment cmnt(masm_, "[ WithEnterStatement"); |
| 1305 CodeForStatementPosition(node); | 1317 CodeForStatementPosition(node); |
| 1306 LoadAndSpill(node->expression()); | 1318 LoadAndSpill(node->expression()); |
| 1307 if (node->is_catch_block()) { | 1319 if (node->is_catch_block()) { |
| 1308 frame_->CallRuntime(Runtime::kPushCatchContext, 1); | 1320 frame_->CallRuntime(Runtime::kPushCatchContext, 1); |
| (...skipping 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4708 __ mov(r2, Operand(0)); | 4720 __ mov(r2, Operand(0)); |
| 4709 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 4721 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
| 4710 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 4722 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
| 4711 RelocInfo::CODE_TARGET); | 4723 RelocInfo::CODE_TARGET); |
| 4712 } | 4724 } |
| 4713 | 4725 |
| 4714 | 4726 |
| 4715 #undef __ | 4727 #undef __ |
| 4716 | 4728 |
| 4717 } } // namespace v8::internal | 4729 } } // namespace v8::internal |
| OLD | NEW |