From 389df3e28d25a01d5760d689f357008f5279e54a Mon Sep 17 00:00:00 2001 From: "ishell@chromium.org" Date: Fri, 14 Feb 2014 16:41:59 +0000 Subject: [PATCH] Debug-mode check added: optimized keyed store of a smi on x64 is done to a entry containing a smi. R=verwaest@chromium.org Review URL: https://codereview.chromium.org/167063002 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19389 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/x64/lithium-codegen-x64.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index 0c1a378..5e11a36 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -3950,8 +3950,9 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { hinstr->value()->representation().IsInteger32()) { ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY); #ifdef DEBUG - __ movq(kScratchRegister, FieldOperand(write_register, offset)); - __ AssertSmi(kScratchRegister); + Register scratch = kScratchRegister; + __ Load(scratch, FieldOperand(write_register, offset), representation); + __ AssertSmi(scratch); #endif // Store int value directly to upper half of the smi. STATIC_ASSERT(kSmiTag == 0); @@ -4206,6 +4207,17 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { if (representation.IsInteger32()) { ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY); ASSERT(hinstr->elements_kind() == FAST_SMI_ELEMENTS); +#ifdef DEBUG + Register scratch = kScratchRegister; + __ Load(scratch, + BuildFastArrayOperand(instr->elements(), + key, + FAST_ELEMENTS, + offset, + instr->additional_index()), + Representation::Smi()); + __ AssertSmi(scratch); +#endif // Store int value directly to upper half of the smi. STATIC_ASSERT(kSmiTag == 0); STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); -- 2.7.4