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

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

Issue 1150293002: Do not leak message object beyond try-catch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: platform ports and turbofan Created 5 years, 7 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 SetStatementPosition(stmt); 1175 SetStatementPosition(stmt);
1176 // The try block adds a handler to the exception handler chain before 1176 // The try block adds a handler to the exception handler chain before
1177 // entering, and removes it again when exiting normally. If an exception 1177 // entering, and removes it again when exiting normally. If an exception
1178 // is thrown during execution of the try block, the handler is consumed 1178 // is thrown during execution of the try block, the handler is consumed
1179 // and control is passed to the catch block with the exception in the 1179 // and control is passed to the catch block with the exception in the
1180 // result register. 1180 // result register.
1181 1181
1182 Label try_entry, handler_entry, exit; 1182 Label try_entry, handler_entry, exit;
1183 __ jmp(&try_entry); 1183 __ jmp(&try_entry);
1184 __ bind(&handler_entry); 1184 __ bind(&handler_entry);
1185 EnterCatchBlock();
1185 // Exception handler code, the exception is in the result register. 1186 // Exception handler code, the exception is in the result register.
1186 // Extend the context before executing the catch block. 1187 // Extend the context before executing the catch block.
1187 { Comment cmnt(masm_, "[ Extend catch context"); 1188 { Comment cmnt(masm_, "[ Extend catch context");
1188 __ Push(stmt->variable()->name()); 1189 __ Push(stmt->variable()->name());
1189 __ Push(result_register()); 1190 __ Push(result_register());
1190 PushFunctionArgumentForContextAllocation(); 1191 PushFunctionArgumentForContextAllocation();
1191 __ CallRuntime(Runtime::kPushCatchContext, 3); 1192 __ CallRuntime(Runtime::kPushCatchContext, 3);
1192 StoreToFrameField(StandardFrameConstants::kContextOffset, 1193 StoreToFrameField(StandardFrameConstants::kContextOffset,
1193 context_register()); 1194 context_register());
1194 } 1195 }
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 } 1636 }
1636 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); 1637 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS);
1637 codegen_->scope_ = saved_scope_; 1638 codegen_->scope_ = saved_scope_;
1638 } 1639 }
1639 1640
1640 1641
1641 #undef __ 1642 #undef __
1642 1643
1643 1644
1644 } } // namespace v8::internal 1645 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698