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

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 9378006: Make sure that top bits are zero when storing untagged 32 bit values (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/lithium-gap-resolver-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
===================================================================
--- src/x64/lithium-codegen-x64.cc (revision 10650)
+++ src/x64/lithium-codegen-x64.cc (working copy)
@@ -3232,17 +3232,25 @@
void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
- if (instr->index()->IsConstantOperand()) {
- if (instr->length()->IsRegister()) {
- __ cmpq(ToRegister(instr->length()),
+ if (instr->length()->IsRegister()) {
+ Register reg = ToRegister(instr->length());
+ if (FLAG_debug_code) {
+ __ AbortIfNotZeroExtended(reg);
+ }
+ if (instr->index()->IsConstantOperand()) {
+ __ cmpq(reg,
Immediate(ToInteger32(LConstantOperand::cast(instr->index()))));
} else {
+ Register reg2 = ToRegister(instr->index());
+ if (FLAG_debug_code) {
+ __ AbortIfNotZeroExtended(reg2);
+ }
+ __ cmpq(reg, reg2);
+ }
+ } else {
+ if (instr->index()->IsConstantOperand()) {
__ cmpq(ToOperand(instr->length()),
Immediate(ToInteger32(LConstantOperand::cast(instr->index()))));
- }
- } else {
- if (instr->length()->IsRegister()) {
- __ cmpq(ToRegister(instr->length()), ToRegister(instr->index()));
} else {
__ cmpq(ToOperand(instr->length()), ToRegister(instr->index()));
}
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/lithium-gap-resolver-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698