OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 | 1248 |
1249 void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) { | 1249 void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) { |
1250 Comment cmnt(masm_, "[ WithStatement"); | 1250 Comment cmnt(masm_, "[ WithStatement"); |
1251 SetStatementPosition(stmt); | 1251 SetStatementPosition(stmt); |
1252 | 1252 |
1253 VisitForStackValue(stmt->expression()); | 1253 VisitForStackValue(stmt->expression()); |
1254 PushFunctionArgumentForContextAllocation(); | 1254 PushFunctionArgumentForContextAllocation(); |
1255 __ CallRuntime(Runtime::kPushWithContext, 2); | 1255 __ CallRuntime(Runtime::kPushWithContext, 2); |
1256 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); | 1256 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
1257 | 1257 |
| 1258 Scope* saved_scope = scope(); |
| 1259 scope_ = stmt->scope(); |
1258 { WithOrCatch body(this); | 1260 { WithOrCatch body(this); |
1259 Visit(stmt->statement()); | 1261 Visit(stmt->statement()); |
1260 } | 1262 } |
| 1263 scope_ = saved_scope; |
1261 | 1264 |
1262 // Pop context. | 1265 // Pop context. |
1263 LoadContextField(context_register(), Context::PREVIOUS_INDEX); | 1266 LoadContextField(context_register(), Context::PREVIOUS_INDEX); |
1264 // Update local stack frame context field. | 1267 // Update local stack frame context field. |
1265 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); | 1268 StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
1266 } | 1269 } |
1267 | 1270 |
1268 | 1271 |
1269 void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) { | 1272 void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) { |
1270 Comment cmnt(masm_, "[ DoWhileStatement"); | 1273 Comment cmnt(masm_, "[ DoWhileStatement"); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1600 } | 1603 } |
1601 | 1604 |
1602 return false; | 1605 return false; |
1603 } | 1606 } |
1604 | 1607 |
1605 | 1608 |
1606 #undef __ | 1609 #undef __ |
1607 | 1610 |
1608 | 1611 |
1609 } } // namespace v8::internal | 1612 } } // namespace v8::internal |
OLD | NEW |