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

Unified Diff: src/deoptimizer.cc

Issue 6349046: Extract platform independent part of RevertStackCheckCode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 11 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/deoptimizer.h ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index e6742fe01be43f14f59193bd64671aa62981b428..f081576aa884e7d2b025c1ef5887a686751c9c9d 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -823,7 +823,26 @@ void Deoptimizer::PatchStackCheckCode(Code* unoptimized_code,
for (uint32_t i = 0; i < table_length; ++i) {
uint32_t pc_offset = Memory::uint32_at(stack_check_cursor + kIntSize);
Address pc_after = unoptimized_code->instruction_start() + pc_offset;
- PatchStackCheckAt(pc_after, check_code, replacement_code);
+ PatchStackCheckCodeAt(pc_after, check_code, replacement_code);
+ stack_check_cursor += 2 * kIntSize;
+ }
+}
+
+
+void Deoptimizer::RevertStackCheckCode(Code* unoptimized_code,
+ Code* check_code,
+ Code* replacement_code) {
+ // Iterate over the stack check table and revert the patched
+ // stack check calls.
+ ASSERT(unoptimized_code->kind() == Code::FUNCTION);
+ Address stack_check_cursor = unoptimized_code->instruction_start() +
+ unoptimized_code->stack_check_table_start();
+ uint32_t table_length = Memory::uint32_at(stack_check_cursor);
+ stack_check_cursor += kIntSize;
+ for (uint32_t i = 0; i < table_length; ++i) {
+ uint32_t pc_offset = Memory::uint32_at(stack_check_cursor + kIntSize);
+ Address pc_after = unoptimized_code->instruction_start() + pc_offset;
+ RevertStackCheckCodeAt(pc_after, check_code, replacement_code);
stack_check_cursor += 2 * kIntSize;
}
}
« no previous file with comments | « src/deoptimizer.h ('k') | src/ia32/deoptimizer-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698