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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 7015039: Removed a "feature envy" bad smell: Moved AssumeRepresentation method to where (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 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/hydrogen-instructions.h ('k') | 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 case kDouble: return "d"; 60 case kDouble: return "d";
61 case kInteger32: return "i"; 61 case kInteger32: return "i";
62 case kExternal: return "x"; 62 case kExternal: return "x";
63 default: 63 default:
64 UNREACHABLE(); 64 UNREACHABLE();
65 return NULL; 65 return NULL;
66 } 66 }
67 } 67 }
68 68
69 69
70 void HValue::AssumeRepresentation(Representation r) {
71 if (CheckFlag(kFlexibleRepresentation)) {
72 ChangeRepresentation(r);
73 // The representation of the value is dictated by type feedback and
74 // will not be changed later.
75 ClearFlag(kFlexibleRepresentation);
76 }
77 }
78
79
70 static int32_t ConvertAndSetOverflow(int64_t result, bool* overflow) { 80 static int32_t ConvertAndSetOverflow(int64_t result, bool* overflow) {
71 if (result > kMaxInt) { 81 if (result > kMaxInt) {
72 *overflow = true; 82 *overflow = true;
73 return kMaxInt; 83 return kMaxInt;
74 } 84 }
75 if (result < kMinInt) { 85 if (result < kMinInt) {
76 *overflow = true; 86 *overflow = true;
77 return kMinInt; 87 return kMinInt;
78 } 88 }
79 return static_cast<int32_t>(result); 89 return static_cast<int32_t>(result);
(...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 1752
1743 1753
1744 void HCheckPrototypeMaps::Verify() { 1754 void HCheckPrototypeMaps::Verify() {
1745 HInstruction::Verify(); 1755 HInstruction::Verify();
1746 ASSERT(HasNoUses()); 1756 ASSERT(HasNoUses());
1747 } 1757 }
1748 1758
1749 #endif 1759 #endif
1750 1760
1751 } } // namespace v8::internal 1761 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698