Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/full-codegen/full-codegen.cc

Issue 2302013002: Store the scope info in catch contexts (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/full-codegen/full-codegen.h" 5 #include "src/full-codegen/full-codegen.h"
6 6
7 #include "src/ast/ast-numbering.h" 7 #include "src/ast/ast-numbering.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 Label try_entry, handler_entry, exit; 1325 Label try_entry, handler_entry, exit;
1326 __ jmp(&try_entry); 1326 __ jmp(&try_entry);
1327 __ bind(&handler_entry); 1327 __ bind(&handler_entry);
1328 if (stmt->clear_pending_message()) ClearPendingMessage(); 1328 if (stmt->clear_pending_message()) ClearPendingMessage();
1329 1329
1330 // Exception handler code, the exception is in the result register. 1330 // Exception handler code, the exception is in the result register.
1331 // Extend the context before executing the catch block. 1331 // Extend the context before executing the catch block.
1332 { Comment cmnt(masm_, "[ Extend catch context"); 1332 { Comment cmnt(masm_, "[ Extend catch context");
1333 PushOperand(stmt->variable()->name()); 1333 PushOperand(stmt->variable()->name());
1334 PushOperand(result_register()); 1334 PushOperand(result_register());
1335 PushOperand(stmt->scope()->scope_info());
1335 PushFunctionArgumentForContextAllocation(); 1336 PushFunctionArgumentForContextAllocation();
1336 CallRuntimeWithOperands(Runtime::kPushCatchContext); 1337 CallRuntimeWithOperands(Runtime::kPushCatchContext);
1337 StoreToFrameField(StandardFrameConstants::kContextOffset, 1338 StoreToFrameField(StandardFrameConstants::kContextOffset,
1338 context_register()); 1339 context_register());
1339 } 1340 }
1340 1341
1341 Scope* saved_scope = scope(); 1342 Scope* saved_scope = scope();
1342 scope_ = stmt->scope(); 1343 scope_ = stmt->scope();
1343 DCHECK(scope_->declarations()->is_empty()); 1344 DCHECK(scope_->declarations()->is_empty());
1344 { WithOrCatch catch_body(this); 1345 { WithOrCatch catch_body(this);
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 return info_->has_simple_parameters(); 2008 return info_->has_simple_parameters();
2008 } 2009 }
2009 2010
2010 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } 2011 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); }
2011 2012
2012 #undef __ 2013 #undef __
2013 2014
2014 2015
2015 } // namespace internal 2016 } // namespace internal
2016 } // namespace v8 2017 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698