OLD | NEW |
---|---|
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
966 // hence automatically smi tagged. | 966 // hence automatically smi tagged. |
967 ExternalReference next_address = | 967 ExternalReference next_address = |
968 ExternalReference::handle_scope_next_address(); | 968 ExternalReference::handle_scope_next_address(); |
969 push(Operand::StaticVariable(next_address)); | 969 push(Operand::StaticVariable(next_address)); |
970 ExternalReference limit_address = | 970 ExternalReference limit_address = |
971 ExternalReference::handle_scope_limit_address(); | 971 ExternalReference::handle_scope_limit_address(); |
972 push(Operand::StaticVariable(limit_address)); | 972 push(Operand::StaticVariable(limit_address)); |
973 } | 973 } |
974 | 974 |
975 | 975 |
976 void MacroAssembler::PopHandleScope(Register scratch) { | 976 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
| |
977 Register scratch) { | |
977 ExternalReference extensions_address = | 978 ExternalReference extensions_address = |
978 ExternalReference::handle_scope_extensions_address(); | 979 ExternalReference::handle_scope_extensions_address(); |
979 Label write_back; | 980 Label write_back; |
980 mov(scratch, Operand::StaticVariable(extensions_address)); | 981 mov(scratch, Operand::StaticVariable(extensions_address)); |
981 cmp(Operand(scratch), Immediate(0)); | 982 cmp(Operand(scratch), Immediate(0)); |
982 j(equal, &write_back); | 983 j(equal, &write_back); |
984 // Calling a runtime function messes with registers so we save and | |
985 // restore the ones we're asked not to change. | |
986 for (int i = 0; i < saved.length(); i++) | |
987 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
| |
983 CallRuntime(Runtime::kDeleteHandleScopeExtensions, 0); | 988 CallRuntime(Runtime::kDeleteHandleScopeExtensions, 0); |
989 for (int i = 0; i < saved.length(); i++) | |
990 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.
| |
984 | 991 |
985 bind(&write_back); | 992 bind(&write_back); |
986 ExternalReference limit_address = | 993 ExternalReference limit_address = |
987 ExternalReference::handle_scope_limit_address(); | 994 ExternalReference::handle_scope_limit_address(); |
988 pop(Operand::StaticVariable(limit_address)); | 995 pop(Operand::StaticVariable(limit_address)); |
989 ExternalReference next_address = | 996 ExternalReference next_address = |
990 ExternalReference::handle_scope_next_address(); | 997 ExternalReference::handle_scope_next_address(); |
991 pop(Operand::StaticVariable(next_address)); | 998 pop(Operand::StaticVariable(next_address)); |
992 pop(scratch); | 999 pop(scratch); |
993 shr(scratch, kSmiTagSize); | 1000 shr(scratch, kSmiTagSize); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1269 // Indicate that code has changed. | 1276 // Indicate that code has changed. |
1270 CPU::FlushICache(address_, size_); | 1277 CPU::FlushICache(address_, size_); |
1271 | 1278 |
1272 // Check that the code was patched as expected. | 1279 // Check that the code was patched as expected. |
1273 ASSERT(masm_.pc_ == address_ + size_); | 1280 ASSERT(masm_.pc_ == address_ + size_); |
1274 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1281 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1275 } | 1282 } |
1276 | 1283 |
1277 | 1284 |
1278 } } // namespace v8::internal | 1285 } } // namespace v8::internal |
OLD | NEW |