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 9343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9354 v8::Local<debug::Script> script) { | 9354 v8::Local<debug::Script> script) { |
9355 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 9355 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
9356 ENTER_V8(isolate); | 9356 ENTER_V8(isolate); |
9357 i::DisallowHeapAllocation no_gc; | 9357 i::DisallowHeapAllocation no_gc; |
9358 i::SharedFunctionInfo::ScriptIterator iter(Utils::OpenHandle(*script)); | 9358 i::SharedFunctionInfo::ScriptIterator iter(Utils::OpenHandle(*script)); |
9359 while (i::SharedFunctionInfo* info = iter.Next()) { | 9359 while (i::SharedFunctionInfo* info = iter.Next()) { |
9360 info->set_computed_debug_is_blackboxed(false); | 9360 info->set_computed_debug_is_blackboxed(false); |
9361 } | 9361 } |
9362 } | 9362 } |
9363 | 9363 |
| 9364 int debug::EstimatedValueSize(Isolate* v8_isolate, v8::Local<v8::Value> value) { |
| 9365 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 9366 ENTER_V8(isolate); |
| 9367 i::Handle<i::Object> object = Utils::OpenHandle(*value); |
| 9368 if (object->IsSmi()) return i::kPointerSize; |
| 9369 CHECK(object->IsHeapObject()); |
| 9370 return i::Handle<i::HeapObject>::cast(object)->Size(); |
| 9371 } |
| 9372 |
9364 Local<String> CpuProfileNode::GetFunctionName() const { | 9373 Local<String> CpuProfileNode::GetFunctionName() const { |
9365 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); | 9374 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); |
9366 i::Isolate* isolate = node->isolate(); | 9375 i::Isolate* isolate = node->isolate(); |
9367 const i::CodeEntry* entry = node->entry(); | 9376 const i::CodeEntry* entry = node->entry(); |
9368 i::Handle<i::String> name = | 9377 i::Handle<i::String> name = |
9369 isolate->factory()->InternalizeUtf8String(entry->name()); | 9378 isolate->factory()->InternalizeUtf8String(entry->name()); |
9370 if (!entry->has_name_prefix()) { | 9379 if (!entry->has_name_prefix()) { |
9371 return ToApiHandle<String>(name); | 9380 return ToApiHandle<String>(name); |
9372 } else { | 9381 } else { |
9373 // We do not expect this to fail. Change this if it does. | 9382 // We do not expect this to fail. Change this if it does. |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10046 Address callback_address = | 10055 Address callback_address = |
10047 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10056 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
10048 VMState<EXTERNAL> state(isolate); | 10057 VMState<EXTERNAL> state(isolate); |
10049 ExternalCallbackScope call_scope(isolate, callback_address); | 10058 ExternalCallbackScope call_scope(isolate, callback_address); |
10050 callback(info); | 10059 callback(info); |
10051 } | 10060 } |
10052 | 10061 |
10053 | 10062 |
10054 } // namespace internal | 10063 } // namespace internal |
10055 } // namespace v8 | 10064 } // namespace v8 |
OLD | NEW |