| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 PrepareForBailout(expr, state); | 844 PrepareForBailout(expr, state); |
| 845 // Forwarding bailouts to children is a one shot operation. It should have | 845 // Forwarding bailouts to children is a one shot operation. It should have |
| 846 // been processed at this point. | 846 // been processed at this point. |
| 847 ASSERT(forward_bailout_pending_ == NULL); | 847 ASSERT(forward_bailout_pending_ == NULL); |
| 848 } | 848 } |
| 849 } | 849 } |
| 850 | 850 |
| 851 | 851 |
| 852 void FullCodeGenerator::VisitBlock(Block* stmt) { | 852 void FullCodeGenerator::VisitBlock(Block* stmt) { |
| 853 Comment cmnt(masm_, "[ Block"); | 853 Comment cmnt(masm_, "[ Block"); |
| 854 Breakable nested_statement(this, stmt); | 854 NestedBlock nested_block(this, stmt); |
| 855 SetStatementPosition(stmt); | 855 SetStatementPosition(stmt); |
| 856 | 856 |
| 857 Scope* saved_scope = scope(); | 857 Scope* saved_scope = scope(); |
| 858 if (stmt->block_scope() != NULL) { | 858 if (stmt->block_scope() != NULL) { |
| 859 { Comment cmnt(masm_, "[ Extend block context"); | 859 { Comment cmnt(masm_, "[ Extend block context"); |
| 860 scope_ = stmt->block_scope(); | 860 scope_ = stmt->block_scope(); |
| 861 __ Push(scope_->GetSerializedScopeInfo()); | 861 __ Push(scope_->GetSerializedScopeInfo()); |
| 862 PushFunctionArgumentForContextAllocation(); | 862 PushFunctionArgumentForContextAllocation(); |
| 863 __ CallRuntime(Runtime::kPushBlockContext, 2); | 863 __ CallRuntime(Runtime::kPushBlockContext, 2); |
| 864 StoreToFrameField(StandardFrameConstants::kContextOffset, | 864 StoreToFrameField(StandardFrameConstants::kContextOffset, |
| 865 context_register()); | 865 context_register()); |
| 866 } | 866 } |
| 867 { Comment cmnt(masm_, "[ Declarations"); | 867 { Comment cmnt(masm_, "[ Declarations"); |
| 868 VisitDeclarations(scope_->declarations()); | 868 VisitDeclarations(scope_->declarations()); |
| 869 } | 869 } |
| 870 } | 870 } |
| 871 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); | 871 PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); |
| 872 VisitStatements(stmt->statements()); | 872 VisitStatements(stmt->statements()); |
| 873 scope_ = saved_scope; | 873 scope_ = saved_scope; |
| 874 __ bind(nested_statement.break_label()); | 874 __ bind(nested_block.break_label()); |
| 875 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 875 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
| 876 } | 876 } |
| 877 | 877 |
| 878 | 878 |
| 879 void FullCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) { | 879 void FullCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) { |
| 880 Comment cmnt(masm_, "[ ExpressionStatement"); | 880 Comment cmnt(masm_, "[ ExpressionStatement"); |
| 881 SetStatementPosition(stmt); | 881 SetStatementPosition(stmt); |
| 882 VisitForEffect(stmt->expression()); | 882 VisitForEffect(stmt->expression()); |
| 883 } | 883 } |
| 884 | 884 |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 } | 1392 } |
| 1393 | 1393 |
| 1394 return false; | 1394 return false; |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 | 1397 |
| 1398 #undef __ | 1398 #undef __ |
| 1399 | 1399 |
| 1400 | 1400 |
| 1401 } } // namespace v8::internal | 1401 } } // namespace v8::internal |
| OLD | NEW |