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

Side by Side Diff: src/ia32/lithium-ia32.cc

Issue 23478031: Improve code generation for the HRandom instruction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment. Created 7 years, 3 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.h ('k') | src/x64/lithium-codegen-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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 UseFixedDouble(instr->right(), xmm1) : 1708 UseFixedDouble(instr->right(), xmm1) :
1709 UseFixed(instr->right(), eax); 1709 UseFixed(instr->right(), eax);
1710 LPower* result = new(zone()) LPower(left, right); 1710 LPower* result = new(zone()) LPower(left, right);
1711 return MarkAsCall(DefineFixedDouble(result, xmm3), instr, 1711 return MarkAsCall(DefineFixedDouble(result, xmm3), instr,
1712 CAN_DEOPTIMIZE_EAGERLY); 1712 CAN_DEOPTIMIZE_EAGERLY);
1713 } 1713 }
1714 1714
1715 1715
1716 LInstruction* LChunkBuilder::DoRandom(HRandom* instr) { 1716 LInstruction* LChunkBuilder::DoRandom(HRandom* instr) {
1717 ASSERT(instr->representation().IsDouble()); 1717 ASSERT(instr->representation().IsDouble());
1718 ASSERT(instr->global_object()->representation().IsSmiOrTagged()); 1718 ASSERT(instr->global_object()->representation().IsTagged());
1719 LOperand* global_object = UseFixed(instr->global_object(), eax); 1719 LOperand* global_object = UseTempRegister(instr->global_object());
1720 LRandom* result = new(zone()) LRandom(global_object); 1720 LOperand* scratch = TempRegister();
1721 return MarkAsCall(DefineFixedDouble(result, xmm1), instr); 1721 LOperand* scratch2 = TempRegister();
1722 LOperand* scratch3 = TempRegister();
1723 LRandom* result = new(zone()) LRandom(
1724 global_object, scratch, scratch2, scratch3);
1725 return DefineFixedDouble(result, xmm1);
1722 } 1726 }
1723 1727
1724 1728
1725 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { 1729 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
1726 ASSERT(instr->left()->representation().IsSmiOrTagged()); 1730 ASSERT(instr->left()->representation().IsSmiOrTagged());
1727 ASSERT(instr->right()->representation().IsSmiOrTagged()); 1731 ASSERT(instr->right()->representation().IsSmiOrTagged());
1728 LOperand* context = UseFixed(instr->context(), esi); 1732 LOperand* context = UseFixed(instr->context(), esi);
1729 LOperand* left = UseFixed(instr->left(), edx); 1733 LOperand* left = UseFixed(instr->left(), edx);
1730 LOperand* right = UseFixed(instr->right(), eax); 1734 LOperand* right = UseFixed(instr->right(), eax);
1731 LCmpT* result = new(zone()) LCmpT(context, left, right); 1735 LCmpT* result = new(zone()) LCmpT(context, left, right);
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2748 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2745 LOperand* object = UseRegister(instr->object()); 2749 LOperand* object = UseRegister(instr->object());
2746 LOperand* index = UseTempRegister(instr->index()); 2750 LOperand* index = UseTempRegister(instr->index());
2747 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2751 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2748 } 2752 }
2749 2753
2750 2754
2751 } } // namespace v8::internal 2755 } } // namespace v8::internal
2752 2756
2753 #endif // V8_TARGET_ARCH_IA32 2757 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/x64/lithium-codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698