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

Unified Diff: src/ia32/lithium-codegen-ia32.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/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index b6244af4129a3349a7df107922128d18706631c9..bf014da2c7a3742cb848653d5557e31abc271ffb 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -5026,14 +5026,30 @@ void LCodeGen::DoSmiTag(LSmiTag* instr) {
void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
LOperand* input = instr->value();
+ Register result = ToRegister(input);
ASSERT(input->IsRegister() && input->Equals(instr->result()));
if (instr->needs_check()) {
- __ test(ToRegister(input), Immediate(kSmiTagMask));
+ __ test(result, Immediate(kSmiTagMask));
DeoptimizeIf(not_zero, instr->environment());
+ } else if (instr->hydrogen()->value()->IsLoadKeyed()) {
+ HLoadKeyed* load = HLoadKeyed::cast(instr->hydrogen()->value());
+ if (load->UsesMustHandleHole()) {
+ __ test(result, Immediate(kSmiTagMask));
+ if (load->hole_mode() == ALLOW_RETURN_HOLE) {
+ Label done;
+ __ j(equal, &done);
+ __ xor_(result, result);
+ __ bind(&done);
+ } else {
+ DeoptimizeIf(not_zero, instr->environment());
+ }
+ } else {
+ __ AssertSmi(result);
+ }
} else {
- __ AssertSmi(ToRegister(input));
+ __ AssertSmi(result);
}
- __ SmiUntag(ToRegister(input));
+ __ SmiUntag(result);
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698