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

Unified Diff: src/codegen-ia32.cc

Issue 42068: Deallocate the dynamically-allocated shadow targets that we use for... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codegen-arm.cc ('k') | src/jump-target.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen-ia32.cc
===================================================================
--- src/codegen-ia32.cc (revision 1486)
+++ src/codegen-ia32.cc (working copy)
@@ -2718,7 +2718,7 @@
// After shadowing stops, the original targets are unshadowed and the
// ShadowTargets represent the formerly shadowing targets.
bool has_unlinks = false;
- for (int i = 0; i <= nof_escapes; i++) {
+ for (int i = 0; i < shadows.length(); i++) {
shadows[i]->StopShadowing();
has_unlinks = has_unlinks || shadows[i]->is_linked();
}
@@ -2749,8 +2749,8 @@
}
// Generate unlink code for the (formerly) shadowing targets that have been
- // jumped to.
- for (int i = 0; i <= nof_escapes; i++) {
+ // jumped to. Deallocate each shadow target.
+ for (int i = 0; i < shadows.length(); i++) {
if (shadows[i]->is_linked()) {
// Unlink from try chain; be careful not to destroy the TOS.
shadows[i]->Bind();
@@ -2775,6 +2775,7 @@
}
shadows[i]->other_target()->Jump();
}
+ delete shadows[i];
}
exit.Bind();
@@ -2837,7 +2838,7 @@
// After shadowing stops, the original targets are unshadowed and the
// ShadowTargets represent the formerly shadowing targets.
int nof_unlinks = 0;
- for (int i = 0; i <= nof_escapes; i++) {
+ for (int i = 0; i < shadows.length(); i++) {
shadows[i]->StopShadowing();
if (shadows[i]->is_linked()) nof_unlinks++;
}
@@ -2866,7 +2867,7 @@
// Generate code to unlink and set the state for the (formerly)
// shadowing targets that have been jumped to.
- for (int i = 0; i <= nof_escapes; i++) {
+ for (int i = 0; i < shadows.length(); i++) {
if (shadows[i]->is_linked()) {
// If we have come from the shadowed return, the return value is
// in (a non-refcounted reference to) eax. We must preserve it
@@ -2926,8 +2927,8 @@
frame_->EmitPop(eax);
// Generate code to jump to the right destination for all used
- // formerly shadowing targets.
- for (int i = 0; i <= nof_escapes; i++) {
+ // formerly shadowing targets. Deallocate each shadow target.
+ for (int i = 0; i < shadows.length(); i++) {
if (shadows[i]->is_bound()) {
JumpTarget* original = shadows[i]->other_target();
__ cmp(Operand(ecx), Immediate(Smi::FromInt(JUMPING + i)));
@@ -2941,6 +2942,7 @@
original->Branch(equal);
}
}
+ delete shadows[i];
}
// Check if we need to rethrow the exception.
« no previous file with comments | « src/codegen-arm.cc ('k') | src/jump-target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698