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 = |