| OLD | NEW |
| 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/api.h" | 5 #include "src/api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
| 9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
| 10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
| (...skipping 9349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9360 } | 9360 } |
| 9361 | 9361 |
| 9362 void debug::SetAsyncTaskListener(Isolate* v8_isolate, | 9362 void debug::SetAsyncTaskListener(Isolate* v8_isolate, |
| 9363 debug::AsyncTaskListener listener, | 9363 debug::AsyncTaskListener listener, |
| 9364 void* data) { | 9364 void* data) { |
| 9365 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 9365 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9366 ENTER_V8(isolate); | 9366 ENTER_V8(isolate); |
| 9367 isolate->debug()->SetAsyncTaskListener(listener, data); | 9367 isolate->debug()->SetAsyncTaskListener(listener, data); |
| 9368 } | 9368 } |
| 9369 | 9369 |
| 9370 int debug::EstimatedValueSize(Isolate* v8_isolate, v8::Local<v8::Value> value) { |
| 9371 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9372 ENTER_V8(isolate); |
| 9373 i::Handle<i::Object> object = Utils::OpenHandle(*value); |
| 9374 if (object->IsSmi()) return i::kPointerSize; |
| 9375 CHECK(object->IsHeapObject()); |
| 9376 return i::Handle<i::HeapObject>::cast(object)->Size(); |
| 9377 } |
| 9378 |
| 9370 Local<String> CpuProfileNode::GetFunctionName() const { | 9379 Local<String> CpuProfileNode::GetFunctionName() const { |
| 9371 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); | 9380 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); |
| 9372 i::Isolate* isolate = node->isolate(); | 9381 i::Isolate* isolate = node->isolate(); |
| 9373 const i::CodeEntry* entry = node->entry(); | 9382 const i::CodeEntry* entry = node->entry(); |
| 9374 i::Handle<i::String> name = | 9383 i::Handle<i::String> name = |
| 9375 isolate->factory()->InternalizeUtf8String(entry->name()); | 9384 isolate->factory()->InternalizeUtf8String(entry->name()); |
| 9376 if (!entry->has_name_prefix()) { | 9385 if (!entry->has_name_prefix()) { |
| 9377 return ToApiHandle<String>(name); | 9386 return ToApiHandle<String>(name); |
| 9378 } else { | 9387 } else { |
| 9379 // We do not expect this to fail. Change this if it does. | 9388 // We do not expect this to fail. Change this if it does. |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10047 Address callback_address = | 10056 Address callback_address = |
| 10048 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10057 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 10049 VMState<EXTERNAL> state(isolate); | 10058 VMState<EXTERNAL> state(isolate); |
| 10050 ExternalCallbackScope call_scope(isolate, callback_address); | 10059 ExternalCallbackScope call_scope(isolate, callback_address); |
| 10051 callback(info); | 10060 callback(info); |
| 10052 } | 10061 } |
| 10053 | 10062 |
| 10054 | 10063 |
| 10055 } // namespace internal | 10064 } // namespace internal |
| 10056 } // namespace v8 | 10065 } // namespace v8 |
| OLD | NEW |