diff options
| author | Elliott Hughes <enh@google.com> | 2012-07-17 18:11:59 -0700 |
|---|---|---|
| committer | android code review <noreply-gerritcodereview@google.com> | 2012-07-17 18:12:00 -0700 |
| commit | 53c6022cd1211bfa7d14c95585f3554c8cea8aa2 (patch) | |
| tree | eea52a6bad73b0df43bf44ba16a510957542aa8d /vm/compiler/codegen/arm/CodegenDriver.cpp | |
| parent | 319206f324bd937bc1d661dec2082413e41cf8e5 (diff) | |
| parent | 100dbe0d8d5b419bc3727e5b8a07e995351fe129 (diff) | |
Merge "Avoid sign extension in packed-switch."
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.cpp')
| -rw-r--r-- | vm/compiler/codegen/arm/CodegenDriver.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.cpp b/vm/compiler/codegen/arm/CodegenDriver.cpp index d96aa6561..78809dc74 100644 --- a/vm/compiler/codegen/arm/CodegenDriver.cpp +++ b/vm/compiler/codegen/arm/CodegenDriver.cpp @@ -2789,16 +2789,16 @@ static bool handleFmt23x(CompilationUnit *cUnit, MIR *mir) * chaining cell for case default [8 bytes] * noChain exit */ -static s8 findPackedSwitchIndex(const u2* switchData, int testVal, int pc) +static u8 findPackedSwitchIndex(const u2* switchData, int testVal, uintptr_t pc) { int size; int firstKey; const int *entries; int index; int jumpIndex; - int caseDPCOffset = 0; + uintptr_t caseDPCOffset = 0; /* In Thumb mode pc is 4 ahead of the "mov r2, pc" instruction */ - int chainingPC = (pc + 4) & ~3; + uintptr_t chainingPC = (pc + 4) & ~3; /* * Packed switch data format: @@ -2837,16 +2837,16 @@ static s8 findPackedSwitchIndex(const u2* switchData, int testVal, int pc) } chainingPC += jumpIndex * CHAIN_CELL_NORMAL_SIZE; - return (((s8) caseDPCOffset) << 32) | (u8) chainingPC; + return (((u8) caseDPCOffset) << 32) | (u8) chainingPC; } /* See comments for findPackedSwitchIndex */ -static s8 findSparseSwitchIndex(const u2* switchData, int testVal, int pc) +static u8 findSparseSwitchIndex(const u2* switchData, int testVal, uintptr_t pc) { int size; const int *keys; const int *entries; - int chainingPC = (pc + 4) & ~3; + uintptr_t chainingPC = (pc + 4) & ~3; int i; /* @@ -2888,7 +2888,7 @@ static s8 findSparseSwitchIndex(const u2* switchData, int testVal, int pc) int jumpIndex = (i < MAX_CHAINED_SWITCH_CASES) ? i : MAX_CHAINED_SWITCH_CASES + 1; chainingPC += jumpIndex * CHAIN_CELL_NORMAL_SIZE; - return (((s8) entries[i]) << 32) | (u8) chainingPC; + return (((u8) entries[i]) << 32) | (u8) chainingPC; } else if (k > testVal) { break; } |
