OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 7113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7124 return ToInternal(this)->children().length(); | 7124 return ToInternal(this)->children().length(); |
7125 } | 7125 } |
7126 | 7126 |
7127 | 7127 |
7128 const HeapGraphEdge* HeapGraphNode::GetChild(int index) const { | 7128 const HeapGraphEdge* HeapGraphNode::GetChild(int index) const { |
7129 return reinterpret_cast<const HeapGraphEdge*>( | 7129 return reinterpret_cast<const HeapGraphEdge*>( |
7130 ToInternal(this)->children()[index]); | 7130 ToInternal(this)->children()[index]); |
7131 } | 7131 } |
7132 | 7132 |
7133 | 7133 |
7134 v8::Handle<v8::Value> HeapGraphNode::GetHeapValue() const { | |
7135 i::Isolate* isolate = i::Isolate::Current(); | |
7136 i::Handle<i::HeapObject> object = ToInternal(this)->GetHeapObject(); | |
7137 return !object.is_null() ? | |
7138 ToApiHandle<Value>(object) : | |
7139 ToApiHandle<Value>(isolate->factory()->undefined_value()); | |
7140 } | |
7141 | |
7142 | |
7143 static i::HeapSnapshot* ToInternal(const HeapSnapshot* snapshot) { | 7134 static i::HeapSnapshot* ToInternal(const HeapSnapshot* snapshot) { |
7144 return const_cast<i::HeapSnapshot*>( | 7135 return const_cast<i::HeapSnapshot*>( |
7145 reinterpret_cast<const i::HeapSnapshot*>(snapshot)); | 7136 reinterpret_cast<const i::HeapSnapshot*>(snapshot)); |
7146 } | 7137 } |
7147 | 7138 |
7148 | 7139 |
7149 void HeapSnapshot::Delete() { | 7140 void HeapSnapshot::Delete() { |
7150 i::Isolate* isolate = i::Isolate::Current(); | 7141 i::Isolate* isolate = i::Isolate::Current(); |
7151 if (isolate->heap_profiler()->GetSnapshotsCount() > 1) { | 7142 if (isolate->heap_profiler()->GetSnapshotsCount() > 1) { |
7152 ToInternal(this)->Delete(); | 7143 ToInternal(this)->Delete(); |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7526 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7517 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7527 Address callback_address = | 7518 Address callback_address = |
7528 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7519 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7529 VMState<EXTERNAL> state(isolate); | 7520 VMState<EXTERNAL> state(isolate); |
7530 ExternalCallbackScope call_scope(isolate, callback_address); | 7521 ExternalCallbackScope call_scope(isolate, callback_address); |
7531 callback(info); | 7522 callback(info); |
7532 } | 7523 } |
7533 | 7524 |
7534 | 7525 |
7535 } } // namespace v8::internal | 7526 } } // namespace v8::internal |
OLD | NEW |