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

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

Issue 334763003: Start using OStreams. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Reformatted. Feedback addressed. Created 6 years, 5 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') | src/ia32/code-stubs-ia32.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/double.h" 7 #include "src/double.h"
8 #include "src/factory.h" 8 #include "src/factory.h"
9 #include "src/hydrogen-infer-representation.h" 9 #include "src/hydrogen-infer-representation.h"
10 #include "src/property-details-inl.h" 10 #include "src/property-details-inl.h"
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 518
519 void HValue::SetBlock(HBasicBlock* block) { 519 void HValue::SetBlock(HBasicBlock* block) {
520 ASSERT(block_ == NULL || block == NULL); 520 ASSERT(block_ == NULL || block == NULL);
521 block_ = block; 521 block_ = block;
522 if (id_ == kNoNumber && block != NULL) { 522 if (id_ == kNoNumber && block != NULL) {
523 id_ = block->graph()->GetNextValueID(this); 523 id_ = block->graph()->GetNextValueID(this);
524 } 524 }
525 } 525 }
526 526
527 527
528 OStream& operator<<(OStream& os, const HValue& v) {
529 // TODO(svenpanne) Temporary impedance matching, to be removed later.
530 HeapStringAllocator allocator;
531 StringStream stream(&allocator);
532 const_cast<HValue*>(&v)->PrintTo(&stream);
533 return os << stream.ToCString().get();
534 }
535
536
528 void HValue::PrintTypeTo(StringStream* stream) { 537 void HValue::PrintTypeTo(StringStream* stream) {
529 if (!representation().IsTagged() || type().Equals(HType::Tagged())) return; 538 if (!representation().IsTagged() || type().Equals(HType::Tagged())) return;
530 stream->Add(" type:%s", type().ToString()); 539 stream->Add(" type:%s", type().ToString());
531 } 540 }
532 541
533 542
534 void HValue::PrintChangesTo(StringStream* stream) { 543 void HValue::PrintChangesTo(StringStream* stream) {
535 GVNFlagSet changes_flags = ChangesFlags(); 544 GVNFlagSet changes_flags = ChangesFlags();
536 if (changes_flags.IsEmpty()) return; 545 if (changes_flags.IsEmpty()) return;
537 stream->Add(" changes["); 546 stream->Add(" changes[");
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 : SecondSuccessor(); 1216 : SecondSuccessor();
1208 return true; 1217 return true;
1209 } 1218 }
1210 *block = NULL; 1219 *block = NULL;
1211 return false; 1220 return false;
1212 } 1221 }
1213 1222
1214 1223
1215 void HBranch::PrintDataTo(StringStream* stream) { 1224 void HBranch::PrintDataTo(StringStream* stream) {
1216 HUnaryControlInstruction::PrintDataTo(stream); 1225 HUnaryControlInstruction::PrintDataTo(stream);
1217 stream->Add(" "); 1226 OStringStream os;
1218 expected_input_types().Print(stream); 1227 os << " " << expected_input_types();
1228 stream->Add(os.c_str());
1219 } 1229 }
1220 1230
1221 1231
1222 void HCompareMap::PrintDataTo(StringStream* stream) { 1232 void HCompareMap::PrintDataTo(StringStream* stream) {
1223 value()->PrintNameTo(stream); 1233 value()->PrintNameTo(stream);
1224 stream->Add(" (%p)", *map().handle()); 1234 stream->Add(" (%p)", *map().handle());
1225 HControlInstruction::PrintDataTo(stream); 1235 HControlInstruction::PrintDataTo(stream);
1226 if (known_successor_index() == 0) { 1236 if (known_successor_index() == 0) {
1227 stream->Add(" [true]"); 1237 stream->Add(" [true]");
1228 } else if (known_successor_index() == 1) { 1238 } else if (known_successor_index() == 1) {
(...skipping 3642 matching lines...) Expand 10 before | Expand all | Expand 10 after
4871 break; 4881 break;
4872 case kExternalMemory: 4882 case kExternalMemory:
4873 stream->Add("[external-memory]"); 4883 stream->Add("[external-memory]");
4874 break; 4884 break;
4875 } 4885 }
4876 4886
4877 stream->Add("@%d", offset()); 4887 stream->Add("@%d", offset());
4878 } 4888 }
4879 4889
4880 } } // namespace v8::internal 4890 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698