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

Unified Diff: src/deoptimizer.cc

Issue 19248002: Fix unaligned accesses in back_edge tables. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 7 years, 5 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 | « no previous file | src/full-codegen.h » ('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 5f59fd9ab05584e96fec88e23ed8598ab5a0bc9b..ed8ce45c671e6419e9de01b565b994965f3756e8 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -2367,8 +2367,8 @@ void Deoptimizer::PatchInterruptCode(Code* unoptimized_code,
uint32_t table_length = Memory::uint32_at(back_edge_cursor);
back_edge_cursor += kIntSize;
for (uint32_t i = 0; i < table_length; ++i) {
- uint8_t loop_depth = Memory::uint8_at(back_edge_cursor + 2 * kIntSize);
- if (loop_depth == loop_nesting_level) {
+ uint32_t loop_depth = Memory::uint32_at(back_edge_cursor + 2 * kIntSize);
+ if (static_cast<int>(loop_depth) == loop_nesting_level) {
// Loop back edge has the loop depth that we want to patch.
uint32_t pc_offset = Memory::uint32_at(back_edge_cursor + kIntSize);
Address pc_after = unoptimized_code->instruction_start() + pc_offset;
@@ -2399,8 +2399,8 @@ void Deoptimizer::RevertInterruptCode(Code* unoptimized_code,
uint32_t table_length = Memory::uint32_at(back_edge_cursor);
back_edge_cursor += kIntSize;
for (uint32_t i = 0; i < table_length; ++i) {
- uint8_t loop_depth = Memory::uint8_at(back_edge_cursor + 2 * kIntSize);
- if (loop_depth <= loop_nesting_level) {
+ uint32_t loop_depth = Memory::uint32_at(back_edge_cursor + 2 * kIntSize);
+ if (static_cast<int>(loop_depth) <= loop_nesting_level) {
uint32_t pc_offset = Memory::uint32_at(back_edge_cursor + kIntSize);
Address pc_after = unoptimized_code->instruction_start() + pc_offset;
RevertInterruptCodeAt(unoptimized_code,
@@ -2431,7 +2431,7 @@ void Deoptimizer::VerifyInterruptCode(Code* unoptimized_code,
uint32_t table_length = Memory::uint32_at(back_edge_cursor);
back_edge_cursor += kIntSize;
for (uint32_t i = 0; i < table_length; ++i) {
- uint8_t loop_depth = Memory::uint8_at(back_edge_cursor + 2 * kIntSize);
+ int32_t loop_depth = Memory::int32_at(back_edge_cursor + 2 * kIntSize);
kisg 2013/07/18 15:46:52 Instead of int32_t, use uint32_t and static_cast<i
kilvadyb 2013/07/18 18:22:43 Done.
CHECK_LE(loop_depth, Code::kMaxLoopNestingMarker);
// Assert that all back edges for shallower loops (and only those)
// have already been patched.
« no previous file with comments | « no previous file | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698