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

Side by Side Diff: src/objects.cc

Issue 334763003: Start using OStreams. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reduced diff 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/accessors.h" 7 #include "src/accessors.h"
8 #include "src/allocation-site-scopes.h" 8 #include "src/allocation-site-scopes.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 void Map::PrintGeneralization(FILE* file, 1364 void Map::PrintGeneralization(FILE* file,
1365 const char* reason, 1365 const char* reason,
1366 int modify_index, 1366 int modify_index,
1367 int split, 1367 int split,
1368 int descriptors, 1368 int descriptors,
1369 bool constant_to_field, 1369 bool constant_to_field,
1370 Representation old_representation, 1370 Representation old_representation,
1371 Representation new_representation, 1371 Representation new_representation,
1372 HeapType* old_field_type, 1372 HeapType* old_field_type,
1373 HeapType* new_field_type) { 1373 HeapType* new_field_type) {
1374 PrintF(file, "[generalizing "); 1374 OFStream os(file);
1375 os << "[generalizing ";
1375 constructor_name()->PrintOn(file); 1376 constructor_name()->PrintOn(file);
1376 PrintF(file, "] "); 1377 os << "] ";
1377 Name* name = instance_descriptors()->GetKey(modify_index); 1378 Name* name = instance_descriptors()->GetKey(modify_index);
1378 if (name->IsString()) { 1379 if (name->IsString()) {
1379 String::cast(name)->PrintOn(file); 1380 String::cast(name)->PrintOn(file);
1380 } else { 1381 } else {
1381 PrintF(file, "{symbol %p}", static_cast<void*>(name)); 1382 os << "{symbol " << static_cast<void*>(name) << "}";
1382 } 1383 }
1383 PrintF(file, ":"); 1384 os << ":";
1384 if (constant_to_field) { 1385 if (constant_to_field) {
1385 PrintF(file, "c"); 1386 os << "c";
1386 } else { 1387 } else {
1387 PrintF(file, "%s", old_representation.Mnemonic()); 1388 os << old_representation.Mnemonic() << "{";
1388 PrintF(file, "{"); 1389 old_field_type->PrintTo(os, HeapType::SEMANTIC_DIM) << "}";
1389 old_field_type->TypePrint(file, HeapType::SEMANTIC_DIM);
1390 PrintF(file, "}");
1391 } 1390 }
1392 PrintF(file, "->%s", new_representation.Mnemonic()); 1391 os << "->" << new_representation.Mnemonic() << "{";
1393 PrintF(file, "{"); 1392 new_field_type->PrintTo(os, HeapType::SEMANTIC_DIM) << "} (";
1394 new_field_type->TypePrint(file, HeapType::SEMANTIC_DIM);
1395 PrintF(file, "}");
1396 PrintF(file, " (");
1397 if (strlen(reason) > 0) { 1393 if (strlen(reason) > 0) {
1398 PrintF(file, "%s", reason); 1394 os << reason;
1399 } else { 1395 } else {
1400 PrintF(file, "+%i maps", descriptors - split); 1396 os << "+" << (descriptors - split) << " maps";
1401 } 1397 }
1402 PrintF(file, ") ["); 1398 os << ") [";
1403 JavaScriptFrame::PrintTop(GetIsolate(), file, false, true); 1399 JavaScriptFrame::PrintTop(GetIsolate(), file, false, true);
1404 PrintF(file, "]\n"); 1400 os << "]\n";
1405 } 1401 }
1406 1402
1407 1403
1408 void JSObject::PrintInstanceMigration(FILE* file, 1404 void JSObject::PrintInstanceMigration(FILE* file,
1409 Map* original_map, 1405 Map* original_map,
1410 Map* new_map) { 1406 Map* new_map) {
1411 PrintF(file, "[migrating "); 1407 PrintF(file, "[migrating ");
1412 map()->constructor_name()->PrintOn(file); 1408 map()->constructor_name()->PrintOn(file);
1413 PrintF(file, "] "); 1409 PrintF(file, "] ");
1414 DescriptorArray* o = original_map->instance_descriptors(); 1410 DescriptorArray* o = original_map->instance_descriptors();
(...skipping 15542 matching lines...) Expand 10 before | Expand all | Expand 10 after
16957 #define ERROR_MESSAGES_TEXTS(C, T) T, 16953 #define ERROR_MESSAGES_TEXTS(C, T) T,
16958 static const char* error_messages_[] = { 16954 static const char* error_messages_[] = {
16959 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 16955 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
16960 }; 16956 };
16961 #undef ERROR_MESSAGES_TEXTS 16957 #undef ERROR_MESSAGES_TEXTS
16962 return error_messages_[reason]; 16958 return error_messages_[reason];
16963 } 16959 }
16964 16960
16965 16961
16966 } } // namespace v8::internal 16962 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698