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

Unified Diff: src/ia32/macro-assembler-ia32.cc

Issue 377004: Fixed problem where popping a handle scope after calling an accessor (Closed)
Patch Set: Created 11 years, 1 month 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/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/macro-assembler-ia32.cc
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc
index 34d4fd5f6dc113eeed1c23f816912d23f177b180..cca61713b581d57b2734fd2e5b7037ceb84a6d88 100644
--- a/src/ia32/macro-assembler-ia32.cc
+++ b/src/ia32/macro-assembler-ia32.cc
@@ -973,14 +973,21 @@ void MacroAssembler::PushHandleScope(Register scratch) {
}
-void MacroAssembler::PopHandleScope(Register scratch) {
+void MacroAssembler::PopHandleScope(Vector<const Register> saved,
Lasse Reichstein 2009/11/06 11:23:32 You are only ever using this with one register. Is
Christian Plesner Hansen 2009/11/06 11:33:07 Fixed
+ Register scratch) {
ExternalReference extensions_address =
ExternalReference::handle_scope_extensions_address();
Label write_back;
mov(scratch, Operand::StaticVariable(extensions_address));
cmp(Operand(scratch), Immediate(0));
j(equal, &write_back);
+ // Calling a runtime function messes with registers so we save and
+ // restore the ones we're asked not to change.
+ for (int i = 0; i < saved.length(); i++)
+ push(saved[i]);
Lasse Reichstein 2009/11/06 11:23:32 Put on the same line as the for, or use curly brac
Christian Plesner Hansen 2009/11/06 11:33:07 Fixed
CallRuntime(Runtime::kDeleteHandleScopeExtensions, 0);
+ for (int i = 0; i < saved.length(); i++)
+ pop(saved[i]);
Lasse Reichstein 2009/11/06 11:23:32 Shouldn't you be popping them in reverse order? An
Christian Plesner Hansen 2009/11/06 11:33:07 Whoops! Fixed.
bind(&write_back);
ExternalReference limit_address =
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698