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

Side by Side Diff: test/cctest/test-log.cc

Issue 1877453002: Fix printf formats (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle ptrdiff_t format, which seems to make MSVC barf Created 4 years, 8 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
« no previous file with comments | « test/cctest/heap/test-heap.cc ('k') | tools/gyp/v8.gyp » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 bool exists = false; 368 bool exists = false;
369 i::Vector<const char> log( 369 i::Vector<const char> log(
370 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); 370 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
371 CHECK(exists); 371 CHECK(exists);
372 372
373 Address ObjMethod1_entry = reinterpret_cast<Address>(ObjMethod1); 373 Address ObjMethod1_entry = reinterpret_cast<Address>(ObjMethod1);
374 #if USES_FUNCTION_DESCRIPTORS 374 #if USES_FUNCTION_DESCRIPTORS
375 ObjMethod1_entry = *FUNCTION_ENTRYPOINT_ADDRESS(ObjMethod1_entry); 375 ObjMethod1_entry = *FUNCTION_ENTRYPOINT_ADDRESS(ObjMethod1_entry);
376 #endif 376 #endif
377 i::EmbeddedVector<char, 100> ref_data; 377 i::EmbeddedVector<char, 100> ref_data;
378 i::SNPrintF(ref_data, 378 i::SNPrintF(ref_data, "code-creation,Callback,-2,%p,1,\"method1\"",
379 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"method1\"", 379 ObjMethod1_entry);
380 reinterpret_cast<intptr_t>(ObjMethod1_entry));
381 380
382 CHECK(StrNStr(log.start(), ref_data.start(), log.length())); 381 CHECK(StrNStr(log.start(), ref_data.start(), log.length()));
383 log.Dispose(); 382 log.Dispose();
384 } 383 }
385 isolate->Dispose(); 384 isolate->Dispose();
386 } 385 }
387 386
388 387
389 static void Prop1Getter(v8::Local<v8::String> property, 388 static void Prop1Getter(v8::Local<v8::String> property,
390 const v8::PropertyCallbackInfo<v8::Value>& info) { 389 const v8::PropertyCallbackInfo<v8::Value>& info) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 i::Vector<const char> log( 421 i::Vector<const char> log(
423 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true)); 422 i::ReadFile(initialize_logger.StopLoggingGetTempFile(), &exists, true));
424 CHECK(exists); 423 CHECK(exists);
425 424
426 Address Prop1Getter_entry = reinterpret_cast<Address>(Prop1Getter); 425 Address Prop1Getter_entry = reinterpret_cast<Address>(Prop1Getter);
427 #if USES_FUNCTION_DESCRIPTORS 426 #if USES_FUNCTION_DESCRIPTORS
428 Prop1Getter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(Prop1Getter_entry); 427 Prop1Getter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(Prop1Getter_entry);
429 #endif 428 #endif
430 EmbeddedVector<char, 100> prop1_getter_record; 429 EmbeddedVector<char, 100> prop1_getter_record;
431 i::SNPrintF(prop1_getter_record, 430 i::SNPrintF(prop1_getter_record,
432 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"get prop1\"", 431 "code-creation,Callback,-2,%p,1,\"get prop1\"",
433 reinterpret_cast<intptr_t>(Prop1Getter_entry)); 432 Prop1Getter_entry);
434 CHECK(StrNStr(log.start(), prop1_getter_record.start(), log.length())); 433 CHECK(StrNStr(log.start(), prop1_getter_record.start(), log.length()));
435 434
436 Address Prop1Setter_entry = reinterpret_cast<Address>(Prop1Setter); 435 Address Prop1Setter_entry = reinterpret_cast<Address>(Prop1Setter);
437 #if USES_FUNCTION_DESCRIPTORS 436 #if USES_FUNCTION_DESCRIPTORS
438 Prop1Setter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(Prop1Setter_entry); 437 Prop1Setter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(Prop1Setter_entry);
439 #endif 438 #endif
440 EmbeddedVector<char, 100> prop1_setter_record; 439 EmbeddedVector<char, 100> prop1_setter_record;
441 i::SNPrintF(prop1_setter_record, 440 i::SNPrintF(prop1_setter_record,
442 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"set prop1\"", 441 "code-creation,Callback,-2,%p,1,\"set prop1\"",
443 reinterpret_cast<intptr_t>(Prop1Setter_entry)); 442 Prop1Setter_entry);
444 CHECK(StrNStr(log.start(), prop1_setter_record.start(), log.length())); 443 CHECK(StrNStr(log.start(), prop1_setter_record.start(), log.length()));
445 444
446 Address Prop2Getter_entry = reinterpret_cast<Address>(Prop2Getter); 445 Address Prop2Getter_entry = reinterpret_cast<Address>(Prop2Getter);
447 #if USES_FUNCTION_DESCRIPTORS 446 #if USES_FUNCTION_DESCRIPTORS
448 Prop2Getter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(Prop2Getter_entry); 447 Prop2Getter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(Prop2Getter_entry);
449 #endif 448 #endif
450 EmbeddedVector<char, 100> prop2_getter_record; 449 EmbeddedVector<char, 100> prop2_getter_record;
451 i::SNPrintF(prop2_getter_record, 450 i::SNPrintF(prop2_getter_record,
452 "code-creation,Callback,-2,0x%" V8PRIxPTR ",1,\"get prop2\"", 451 "code-creation,Callback,-2,%p,1,\"get prop2\"",
453 reinterpret_cast<intptr_t>(Prop2Getter_entry)); 452 Prop2Getter_entry);
454 CHECK(StrNStr(log.start(), prop2_getter_record.start(), log.length())); 453 CHECK(StrNStr(log.start(), prop2_getter_record.start(), log.length()));
455 log.Dispose(); 454 log.Dispose();
456 } 455 }
457 isolate->Dispose(); 456 isolate->Dispose();
458 } 457 }
459 458
460 459
461 typedef i::NativesCollection<i::TEST> TestSources; 460 typedef i::NativesCollection<i::TEST> TestSources;
462 461
463 462
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac" 608 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac"
610 "(){})();"; 609 "(){})();";
611 610
612 CompileRun(source_text); 611 CompileRun(source_text);
613 612
614 // Must not crash. 613 // Must not crash.
615 logger->LogCompiledFunctions(); 614 logger->LogCompiledFunctions();
616 } 615 }
617 isolate->Dispose(); 616 isolate->Dispose();
618 } 617 }
OLDNEW
« no previous file with comments | « test/cctest/heap/test-heap.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698