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

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

Issue 15737003: Handle holes in smi-untag from LoadKeyed requiring hole handling. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Respect hole-mode Created 7 years, 7 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/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 9a1ce9800993d683dc04ea27bee12b54b70c9168..42c6e9148e71d6b5fe16dc810ac643efe43b8ce7 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -4606,6 +4606,21 @@ void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
if (instr->needs_check()) {
Condition is_smi = __ CheckSmi(input);
DeoptimizeIf(NegateCondition(is_smi), instr->environment());
+ } else if (instr->hydrogen()->value()->IsLoadKeyed()) {
+ HLoadKeyed* load = HLoadKeyed::cast(instr->hydrogen()->value());
+ if (load->UsesMustHandleHole()) {
+ Condition cc = masm()->CheckSmi(input);
+ if (load->hole_mode() == ALLOW_RETURN_HOLE) {
+ Label done;
+ __ j(cc, &done);
+ __ xor_(input, input);
+ __ bind(&done);
+ } else {
+ DeoptimizeIf(NegateCondition(cc), instr->environment());
+ }
+ } else {
+ __ AssertSmi(input);
+ }
} else {
__ AssertSmi(input);
}
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698