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

Issue 48743002: Do not directly load smi constants larger than a 16 bit payload on ia32. (Closed)

Created:
7 years, 1 month ago by Kevin Millikin (Google)
Modified:
7 years, 1 month ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Do not directly load smi constants larger than a 16 bit payload on ia32. Instead of emitting a large smi constant directly as an immediate, xor the smi with a random 32-bit cookie at compile time, emit code to move that into a register and then to xor the register with the cookie. 1. In unoptimized code constants are always loaded into a register in ConstantInstr::EmitNativeCode. Change it to load safely. 2. In optimized code constants loaded into a register for use by an instruction are loaded by ParallelMoveResolver::EmitMove. Change it to load safely. 3. In optimized code some instructions allow constants as inputs. These are reflected with an input location of Location::RegisterOrConstant (or similar) or else Location::Constant. For the former allocate a register if the constant is unsafe, and for the latter check for safety before allowing the constant input. BUG=https://code.google.com/p/dart/issues/detail?id=1742 R=iposva@google.com, srdjan@google.com Committed: https://code.google.com/p/dart/source/detail?r=29439

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -40 lines) Patch
M runtime/vm/assembler_arm.h View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/assembler_ia32.h View 4 chunks +18 lines, -1 line 1 comment Download
M runtime/vm/assembler_ia32.cc View 1 chunk +11 lines, -0 lines 0 comments Download
M runtime/vm/assembler_mips.h View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/assembler_x64.h View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 5 chunks +27 lines, -31 lines 0 comments Download
M runtime/vm/locations.cc View 5 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Kevin Millikin (Google)
The intent of this change is to intercept all immediates with more than 16 bits ...
7 years, 1 month ago (2013-10-28 13:35:46 UTC) #1
srdjan
LGTM, assuming the cookie computation will be changed not to be constant. https://codereview.chromium.org/48743002/diff/1/runtime/vm/assembler_ia32.h File runtime/vm/assembler_ia32.h ...
7 years, 1 month ago (2013-10-28 23:06:49 UTC) #2
Ivan Posva
LGTM -Ivan P.S. Please assign the bug to me that we can wire up a ...
7 years, 1 month ago (2013-10-29 05:58:39 UTC) #3
Kevin Millikin (Google)
7 years, 1 month ago (2013-10-29 12:23:20 UTC) #4
Message was sent while issue was closed.
Committed patchset #1 manually as r29439 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698