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

Side by Side Diff: src/arm/simulator-arm.cc

Issue 9309030: Increase ARM/MIPS simulators stack safety margin to 1024 bytes (Closed)
Patch Set: rebased on r10702 Created 8 years, 10 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
« no previous file with comments | « no previous file | src/mips/simulator-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 return; 1270 return;
1271 } 1271 }
1272 PrintF("Unaligned write at 0x%08x\n", addr); 1272 PrintF("Unaligned write at 0x%08x\n", addr);
1273 UNIMPLEMENTED(); 1273 UNIMPLEMENTED();
1274 #endif 1274 #endif
1275 } 1275 }
1276 1276
1277 1277
1278 // Returns the limit of the stack area to enable checking for stack overflows. 1278 // Returns the limit of the stack area to enable checking for stack overflows.
1279 uintptr_t Simulator::StackLimit() const { 1279 uintptr_t Simulator::StackLimit() const {
1280 // Leave a safety margin of 512 bytes to prevent overrunning the stack when 1280 // Leave a safety margin of 1024 bytes to prevent overrunning the stack when
1281 // pushing values. 1281 // pushing values.
1282 return reinterpret_cast<uintptr_t>(stack_) + 512; 1282 return reinterpret_cast<uintptr_t>(stack_) + 1024;
1283 } 1283 }
1284 1284
1285 1285
1286 // Unsupported instructions use Format to print an error and stop execution. 1286 // Unsupported instructions use Format to print an error and stop execution.
1287 void Simulator::Format(Instruction* instr, const char* format) { 1287 void Simulator::Format(Instruction* instr, const char* format) {
1288 PrintF("Simulator found unsupported instruction:\n 0x%08x: %s\n", 1288 PrintF("Simulator found unsupported instruction:\n 0x%08x: %s\n",
1289 reinterpret_cast<intptr_t>(instr), format); 1289 reinterpret_cast<intptr_t>(instr), format);
1290 UNIMPLEMENTED(); 1290 UNIMPLEMENTED();
1291 } 1291 }
1292 1292
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3426 uintptr_t address = *stack_slot; 3426 uintptr_t address = *stack_slot;
3427 set_register(sp, current_sp + sizeof(uintptr_t)); 3427 set_register(sp, current_sp + sizeof(uintptr_t));
3428 return address; 3428 return address;
3429 } 3429 }
3430 3430
3431 } } // namespace v8::internal 3431 } } // namespace v8::internal
3432 3432
3433 #endif // USE_SIMULATOR 3433 #endif // USE_SIMULATOR
3434 3434
3435 #endif // V8_TARGET_ARCH_ARM 3435 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/mips/simulator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698