Chromium Code Reviews| Index: src/api.cc |
| diff --git a/src/api.cc b/src/api.cc |
| index 6b234bc2bd3c00035e9fb5ba3cdb0e08d526992c..22cac29db836de2146b00c2d458a81bf4f37675c 100644 |
| --- a/src/api.cc |
| +++ b/src/api.cc |
| @@ -9338,6 +9338,15 @@ void debug::ResetBlackboxedStateCache(Isolate* v8_isolate, |
| } |
| } |
| +int debug::EstimatedValueSize(Isolate* v8_isolate, v8::Local<v8::Value> value) { |
| + i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| + ENTER_V8(isolate); |
| + i::Handle<i::Object> object = Utils::OpenHandle(*value); |
| + if (object->IsSmi()) return 4; |
|
ulan
2017/01/30 10:50:25
Smi uses kPointerSize bytes.
kozy
2017/01/30 16:13:07
Done.
|
| + if (!object->IsHeapObject()) return 0; |
|
ulan
2017/01/30 10:50:25
This branch is redundant. You can assert here that
kozy
2017/01/30 16:13:07
Done.
|
| + return i::Handle<i::HeapObject>::cast(object)->Size(); |
| +} |
| + |
| Local<String> CpuProfileNode::GetFunctionName() const { |
| const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); |
| i::Isolate* isolate = node->isolate(); |