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 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 | 952 |
953 void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) { | 953 void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) { |
954 Comment cmnt(masm_, "[ WithStatement"); | 954 Comment cmnt(masm_, "[ WithStatement"); |
955 SetStatementPosition(stmt); | 955 SetStatementPosition(stmt); |
956 | 956 |
957 VisitForStackValue(stmt->expression()); | 957 VisitForStackValue(stmt->expression()); |
958 PushFunctionArgumentForContextAllocation(); | 958 PushFunctionArgumentForContextAllocation(); |
959 __ CallRuntime(Runtime::kPushWithContext, 2); | 959 __ CallRuntime(Runtime::kPushWithContext, 2); |
960 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); | 960 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
961 | 961 |
| 962 Scope* saved_scope = scope(); |
962 { WithOrCatch body(this); | 963 { WithOrCatch body(this); |
963 Visit(stmt->statement()); | 964 Visit(stmt->statement()); |
964 } | 965 } |
| 966 scope_ = saved_scope; |
965 | 967 |
966 // Pop context. | 968 // Pop context. |
967 LoadContextField(context_register(), Context::PREVIOUS_INDEX); | 969 LoadContextField(context_register(), Context::PREVIOUS_INDEX); |
968 // Update local stack frame context field. | 970 // Update local stack frame context field. |
969 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); | 971 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
970 } | 972 } |
971 | 973 |
972 | 974 |
973 void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) { | 975 void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) { |
974 Comment cmnt(masm_, "[ DoWhileStatement"); | 976 Comment cmnt(masm_, "[ DoWhileStatement"); |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 } | 1303 } |
1302 | 1304 |
1303 return false; | 1305 return false; |
1304 } | 1306 } |
1305 | 1307 |
1306 | 1308 |
1307 #undef __ | 1309 #undef __ |
1308 | 1310 |
1309 | 1311 |
1310 } } // namespace v8::internal | 1312 } } // namespace v8::internal |
OLD | NEW |