| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <stdarg.h> | 5 #include <stdarg.h> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 | 666 |
| 667 void JitLogger::LogRecordedBuffer(Code* code, | 667 void JitLogger::LogRecordedBuffer(Code* code, |
| 668 SharedFunctionInfo* shared, | 668 SharedFunctionInfo* shared, |
| 669 const char* name, | 669 const char* name, |
| 670 int length) { | 670 int length) { |
| 671 JitCodeEvent event; | 671 JitCodeEvent event; |
| 672 memset(&event, 0, sizeof(event)); | 672 memset(&event, 0, sizeof(event)); |
| 673 event.type = JitCodeEvent::CODE_ADDED; | 673 event.type = JitCodeEvent::CODE_ADDED; |
| 674 event.code_start = code->instruction_start(); | 674 event.code_start = code->instruction_start(); |
| 675 event.code_len = code->instruction_size(); | 675 event.code_len = code->instruction_size(); |
| 676 Handle<Script> script_handle; | 676 Handle<SharedFunctionInfo> shared_function_handle; |
| 677 if (shared && shared->script()->IsScript()) { | 677 if (shared && shared->script()->IsScript()) { |
| 678 script_handle = Handle<Script>(Script::cast(shared->script())); | 678 shared_function_handle = Handle<SharedFunctionInfo>(shared); |
| 679 } | 679 } |
| 680 event.script = ToApiHandle<v8::Script>(script_handle); | 680 event.script = ToApiHandle<v8::UnboundScript>(shared_function_handle); |
| 681 event.name.str = name; | 681 event.name.str = name; |
| 682 event.name.len = length; | 682 event.name.len = length; |
| 683 code_event_handler_(&event); | 683 code_event_handler_(&event); |
| 684 } | 684 } |
| 685 | 685 |
| 686 | 686 |
| 687 void JitLogger::CodeMoveEvent(Address from, Address to) { | 687 void JitLogger::CodeMoveEvent(Address from, Address to) { |
| 688 Code* from_code = Code::cast(HeapObject::FromAddress(from)); | 688 Code* from_code = Code::cast(HeapObject::FromAddress(from)); |
| 689 | 689 |
| 690 JitCodeEvent event; | 690 JitCodeEvent event; |
| (...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2126 if (jit_logger_) { | 2126 if (jit_logger_) { |
| 2127 removeCodeEventListener(jit_logger_); | 2127 removeCodeEventListener(jit_logger_); |
| 2128 delete jit_logger_; | 2128 delete jit_logger_; |
| 2129 jit_logger_ = NULL; | 2129 jit_logger_ = NULL; |
| 2130 } | 2130 } |
| 2131 | 2131 |
| 2132 return log_->Close(); | 2132 return log_->Close(); |
| 2133 } | 2133 } |
| 2134 | 2134 |
| 2135 } } // namespace v8::internal | 2135 } } // namespace v8::internal |
| OLD | NEW |