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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 16013003: Fix hole handling, and ensure smi representation is handled properly (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3629 matching lines...) Expand 10 before | Expand all | Expand 10 after
3640 // Just make sure that the input/output registers are the expected ones. 3640 // Just make sure that the input/output registers are the expected ones.
3641 3641
3642 Register exponent = rdx; 3642 Register exponent = rdx;
3643 ASSERT(!instr->right()->IsRegister() || 3643 ASSERT(!instr->right()->IsRegister() ||
3644 ToRegister(instr->right()).is(exponent)); 3644 ToRegister(instr->right()).is(exponent));
3645 ASSERT(!instr->right()->IsDoubleRegister() || 3645 ASSERT(!instr->right()->IsDoubleRegister() ||
3646 ToDoubleRegister(instr->right()).is(xmm1)); 3646 ToDoubleRegister(instr->right()).is(xmm1));
3647 ASSERT(ToDoubleRegister(instr->left()).is(xmm2)); 3647 ASSERT(ToDoubleRegister(instr->left()).is(xmm2));
3648 ASSERT(ToDoubleRegister(instr->result()).is(xmm3)); 3648 ASSERT(ToDoubleRegister(instr->result()).is(xmm3));
3649 3649
3650 if (exponent_type.IsTagged()) { 3650 if (exponent_type.IsSmi()) {
3651 MathPowStub stub(MathPowStub::TAGGED);
3652 __ CallStub(&stub);
3653 } else if (exponent_type.IsTagged()) {
3651 Label no_deopt; 3654 Label no_deopt;
3652 __ JumpIfSmi(exponent, &no_deopt); 3655 __ JumpIfSmi(exponent, &no_deopt);
3653 __ CmpObjectType(exponent, HEAP_NUMBER_TYPE, rcx); 3656 __ CmpObjectType(exponent, HEAP_NUMBER_TYPE, rcx);
3654 DeoptimizeIf(not_equal, instr->environment()); 3657 DeoptimizeIf(not_equal, instr->environment());
3655 __ bind(&no_deopt); 3658 __ bind(&no_deopt);
3656 MathPowStub stub(MathPowStub::TAGGED); 3659 MathPowStub stub(MathPowStub::TAGGED);
3657 __ CallStub(&stub); 3660 __ CallStub(&stub);
3658 } else if (exponent_type.IsInteger32()) { 3661 } else if (exponent_type.IsInteger32()) {
3659 MathPowStub stub(MathPowStub::INTEGER); 3662 MathPowStub stub(MathPowStub::INTEGER);
3660 __ CallStub(&stub); 3663 __ CallStub(&stub);
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
4636 __ Integer32ToSmi(input, input); 4639 __ Integer32ToSmi(input, input);
4637 } 4640 }
4638 4641
4639 4642
4640 void LCodeGen::DoSmiUntag(LSmiUntag* instr) { 4643 void LCodeGen::DoSmiUntag(LSmiUntag* instr) {
4641 ASSERT(instr->value()->Equals(instr->result())); 4644 ASSERT(instr->value()->Equals(instr->result()));
4642 Register input = ToRegister(instr->value()); 4645 Register input = ToRegister(instr->value());
4643 if (instr->needs_check()) { 4646 if (instr->needs_check()) {
4644 Condition is_smi = __ CheckSmi(input); 4647 Condition is_smi = __ CheckSmi(input);
4645 DeoptimizeIf(NegateCondition(is_smi), instr->environment()); 4648 DeoptimizeIf(NegateCondition(is_smi), instr->environment());
4646 } else if (instr->hydrogen()->value()->IsLoadKeyed()) {
4647 HLoadKeyed* load = HLoadKeyed::cast(instr->hydrogen()->value());
4648 if (load->UsesMustHandleHole()) {
4649 Condition cc = masm()->CheckSmi(input);
4650 if (load->hole_mode() == ALLOW_RETURN_HOLE) {
4651 Label done;
4652 __ j(cc, &done);
4653 __ xor_(input, input);
4654 __ bind(&done);
4655 } else {
4656 DeoptimizeIf(NegateCondition(cc), instr->environment());
4657 }
4658 } else {
4659 __ AssertSmi(input);
4660 }
4661 } else { 4649 } else {
4662 __ AssertSmi(input); 4650 __ AssertSmi(input);
4663 } 4651 }
4664 __ SmiToInteger32(input, input); 4652 __ SmiToInteger32(input, input);
4665 } 4653 }
4666 4654
4667 4655
4668 void LCodeGen::EmitNumberUntagD(Register input_reg, 4656 void LCodeGen::EmitNumberUntagD(Register input_reg,
4669 XMMRegister result_reg, 4657 XMMRegister result_reg,
4670 bool deoptimize_on_undefined, 4658 bool deoptimize_on_undefined,
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
5690 FixedArray::kHeaderSize - kPointerSize)); 5678 FixedArray::kHeaderSize - kPointerSize));
5691 __ bind(&done); 5679 __ bind(&done);
5692 } 5680 }
5693 5681
5694 5682
5695 #undef __ 5683 #undef __
5696 5684
5697 } } // namespace v8::internal 5685 } } // namespace v8::internal
5698 5686
5699 #endif // V8_TARGET_ARCH_X64 5687 #endif // V8_TARGET_ARCH_X64
OLDNEW
« 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