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

Side by Side Diff: src/hydrogen.cc

Issue 8066007: Small simplification of HChange instruction. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 2 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 | src/hydrogen-instructions.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 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 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 use_value->CheckFlag(HValue::kDeoptimizeOnUndefined); 1853 use_value->CheckFlag(HValue::kDeoptimizeOnUndefined);
1854 if (value->IsConstant()) { 1854 if (value->IsConstant()) {
1855 HConstant* constant = HConstant::cast(value); 1855 HConstant* constant = HConstant::cast(value);
1856 // Try to create a new copy of the constant with the new representation. 1856 // Try to create a new copy of the constant with the new representation.
1857 new_value = is_truncating 1857 new_value = is_truncating
1858 ? constant->CopyToTruncatedInt32() 1858 ? constant->CopyToTruncatedInt32()
1859 : constant->CopyToRepresentation(to); 1859 : constant->CopyToRepresentation(to);
1860 } 1860 }
1861 1861
1862 if (new_value == NULL) { 1862 if (new_value == NULL) {
1863 new_value = new(zone()) HChange(value, value->representation(), to, 1863 new_value = new(zone()) HChange(value, to,
1864 is_truncating, deoptimize_on_undefined); 1864 is_truncating, deoptimize_on_undefined);
1865 } 1865 }
1866 1866
1867 new_value->InsertBefore(next); 1867 new_value->InsertBefore(next);
1868 use_value->SetOperandAt(use_index, new_value); 1868 use_value->SetOperandAt(use_index, new_value);
1869 } 1869 }
1870 1870
1871 1871
1872 void HGraph::InsertRepresentationChangesForValue(HValue* value) { 1872 void HGraph::InsertRepresentationChangesForValue(HValue* value) {
1873 Representation r = value->representation(); 1873 Representation r = value->representation();
(...skipping 5068 matching lines...) Expand 10 before | Expand all | Expand 10 after
6942 } 6942 }
6943 } 6943 }
6944 6944
6945 #ifdef DEBUG 6945 #ifdef DEBUG
6946 if (graph_ != NULL) graph_->Verify(false); // No full verify. 6946 if (graph_ != NULL) graph_->Verify(false); // No full verify.
6947 if (allocator_ != NULL) allocator_->Verify(); 6947 if (allocator_ != NULL) allocator_->Verify();
6948 #endif 6948 #endif
6949 } 6949 }
6950 6950
6951 } } // namespace v8::internal 6951 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698