| OLD | NEW |
| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 } | 546 } |
| 547 isolate->Dispose(); | 547 isolate->Dispose(); |
| 548 } | 548 } |
| 549 | 549 |
| 550 | 550 |
| 551 // https://crbug.com/539892 | 551 // https://crbug.com/539892 |
| 552 // CodeCreateEvents with really large names should not crash. | 552 // CodeCreateEvents with really large names should not crash. |
| 553 TEST(Issue539892) { | 553 TEST(Issue539892) { |
| 554 class : public i::CodeEventLogger { | 554 class : public i::CodeEventLogger { |
| 555 public: | 555 public: |
| 556 virtual void CodeMoveEvent(Address from, Address to) {} | 556 void CodeMoveEvent(i::AbstractCode* from, Address to) override {} |
| 557 virtual void CodeDeleteEvent(Address from) {} | 557 void CodeDisableOptEvent(i::AbstractCode* code, |
| 558 virtual void CodeDisableOptEvent(i::Code* code, | 558 i::SharedFunctionInfo* shared) override {} |
| 559 i::SharedFunctionInfo* shared) {} | |
| 560 | 559 |
| 561 private: | 560 private: |
| 562 virtual void LogRecordedBuffer(i::Code* code, i::SharedFunctionInfo* shared, | 561 void LogRecordedBuffer(i::AbstractCode* code, i::SharedFunctionInfo* shared, |
| 563 const char* name, int length) {} | 562 const char* name, int length) override {} |
| 564 } code_event_logger; | 563 } code_event_logger; |
| 565 SETUP_FLAGS(); | 564 SETUP_FLAGS(); |
| 566 v8::Isolate::CreateParams create_params; | 565 v8::Isolate::CreateParams create_params; |
| 567 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); | 566 create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); |
| 568 v8::Isolate* isolate = v8::Isolate::New(create_params); | 567 v8::Isolate* isolate = v8::Isolate::New(create_params); |
| 569 | 568 |
| 570 { | 569 { |
| 571 ScopedLoggerInitializer initialize_logger(saved_log, saved_prof, isolate); | 570 ScopedLoggerInitializer initialize_logger(saved_log, saved_prof, isolate); |
| 572 Logger* logger = initialize_logger.logger(); | 571 Logger* logger = initialize_logger.logger(); |
| 573 logger->addCodeEventListener(&code_event_logger); | 572 logger->addCodeEventListener(&code_event_logger); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 594 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac" | 593 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac" |
| 595 "(){})();"; | 594 "(){})();"; |
| 596 | 595 |
| 597 CompileRun(source_text); | 596 CompileRun(source_text); |
| 598 | 597 |
| 599 // Must not crash. | 598 // Must not crash. |
| 600 logger->LogCompiledFunctions(); | 599 logger->LogCompiledFunctions(); |
| 601 } | 600 } |
| 602 isolate->Dispose(); | 601 isolate->Dispose(); |
| 603 } | 602 } |
| OLD | NEW |