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

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

Issue 6875002: Fix bug in X64 Math.abs optimization (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2664 matching lines...) Expand 10 before | Expand all | Expand 10 after
2675 __ subsd(scratch, input_reg); 2675 __ subsd(scratch, input_reg);
2676 __ andpd(input_reg, scratch); 2676 __ andpd(input_reg, scratch);
2677 } else if (r.IsInteger32()) { 2677 } else if (r.IsInteger32()) {
2678 EmitIntegerMathAbs(instr); 2678 EmitIntegerMathAbs(instr);
2679 } else { // Tagged case. 2679 } else { // Tagged case.
2680 DeferredMathAbsTaggedHeapNumber* deferred = 2680 DeferredMathAbsTaggedHeapNumber* deferred =
2681 new DeferredMathAbsTaggedHeapNumber(this, instr); 2681 new DeferredMathAbsTaggedHeapNumber(this, instr);
2682 Register input_reg = ToRegister(instr->InputAt(0)); 2682 Register input_reg = ToRegister(instr->InputAt(0));
2683 // Smi check. 2683 // Smi check.
2684 __ JumpIfNotSmi(input_reg, deferred->entry()); 2684 __ JumpIfNotSmi(input_reg, deferred->entry());
2685 __ SmiToInteger32(input_reg, input_reg);
2685 EmitIntegerMathAbs(instr); 2686 EmitIntegerMathAbs(instr);
2687 __ Integer32ToSmi(input_reg, input_reg);
2686 __ bind(deferred->exit()); 2688 __ bind(deferred->exit());
2687 } 2689 }
2688 } 2690 }
2689 2691
2690 2692
2691 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { 2693 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) {
2692 XMMRegister xmm_scratch = xmm0; 2694 XMMRegister xmm_scratch = xmm0;
2693 Register output_reg = ToRegister(instr->result()); 2695 Register output_reg = ToRegister(instr->result());
2694 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); 2696 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0));
2695 2697
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
4014 RegisterEnvironmentForDeoptimization(environment); 4016 RegisterEnvironmentForDeoptimization(environment);
4015 ASSERT(osr_pc_offset_ == -1); 4017 ASSERT(osr_pc_offset_ == -1);
4016 osr_pc_offset_ = masm()->pc_offset(); 4018 osr_pc_offset_ = masm()->pc_offset();
4017 } 4019 }
4018 4020
4019 #undef __ 4021 #undef __
4020 4022
4021 } } // namespace v8::internal 4023 } } // namespace v8::internal
4022 4024
4023 #endif // V8_TARGET_ARCH_X64 4025 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698