Skip to content
Browse files

build on node 0.3.1

  • Loading branch information...
1 parent 104d21f commit a16cc2533e4f0935c9705ddc21735b7a0cc45b1d @dannycoates dannycoates committed Dec 3, 2010
Showing with 23 additions and 21 deletions.
  1. +7 −7 graph_edge.cc
  2. +12 −12 graph_node.cc
  3. +1 −1 package.json
  4. +3 −1 v8-profiler.js
View
14 graph_edge.cc
@@ -20,25 +20,25 @@ Handle<Value> GraphEdge::GetType(Local<String> property, const AccessorInfo& inf
HandleScope scope;
Local<Object> self = info.Holder();
void* ptr = self->GetPointerFromInternalField(0);
- HeapGraphEdge::Type type = static_cast<HeapGraphEdge*>(ptr)->GetType();
+ int32_t type = static_cast<int32_t>(static_cast<HeapGraphEdge*>(ptr)->GetType());
Local<String> t;
switch(type) {
- case HeapGraphEdge::kContextVariable :
+ case 0: //HeapGraphEdge::kContextVariable :
t = String::New("ContextVariable");
break;
- case HeapGraphEdge::kElement :
+ case 1: //HeapGraphEdge::kElement :
t = String::New("Element");
break;
- case HeapGraphEdge::kProperty :
+ case 2: //HeapGraphEdge::kProperty :
t = String::New("Property");
break;
- case HeapGraphEdge::kInternal :
+ case 3: //HeapGraphEdge::kInternal :
t = String::New("Internal");
break;
- case HeapGraphEdge::kHidden :
+ case 4: //HeapGraphEdge::kHidden :
t = String::New("Hidden");
break;
- case HeapGraphEdge::kShortcut :
+ case 5: //HeapGraphEdge::kShortcut :
t = String::New("Shortcut");
break;
default:
View
24 graph_node.cc
@@ -20,7 +20,7 @@ void GraphNode::Initialize() {
node_template_->SetAccessor(String::New("retainersCount"), GraphNode::GetRetainersCount);
node_template_->SetAccessor(String::New("size"), GraphNode::GetSize);
node_template_->SetAccessor(String::New("retainingPathsCount"), GraphNode::GetRetainingPathsCount);
- node_template_->SetAccessor(String::New("dominatorNode"), GraphNode::GetDominator);
+ //node_template_->SetAccessor(String::New("dominatorNode"), GraphNode::GetDominator);
node_template_->Set(String::New("getChild"), FunctionTemplate::New(GraphNode::GetChild));
node_template_->Set(String::New("retainedSize"), FunctionTemplate::New(GraphNode::GetRetainedSize));
node_template_->Set(String::New("getRetainer"), FunctionTemplate::New(GraphNode::GetRetainer));
@@ -31,28 +31,28 @@ Handle<Value> GraphNode::GetType(Local<String> property, const AccessorInfo& inf
HandleScope scope;
Local<Object> self = info.Holder();
void* ptr = self->GetPointerFromInternalField(0);
- HeapGraphNode::Type type = static_cast<HeapGraphNode*>(ptr)->GetType();
+ int32_t type = static_cast<int32_t>(static_cast<HeapGraphNode*>(ptr)->GetType());
Local<String> t;
switch(type) {
- case HeapGraphNode::kArray :
+ case 1: //HeapGraphNode::kArray :
t = String::New("Array");
break;
- case HeapGraphNode::kString :
+ case 2: //HeapGraphNode::kString :
t = String::New("String");
break;
- case HeapGraphNode::kObject :
+ case 3: //HeapGraphNode::kObject :
t = String::New("Object");
break;
- case HeapGraphNode::kCode :
+ case 4: //HeapGraphNode::kCode :
t = String::New("Code");
break;
- case HeapGraphNode::kClosure :
+ case 5: //HeapGraphNode::kClosure :
t = String::New("Closure");
break;
- case HeapGraphNode::kRegExp :
+ case 6: //HeapGraphNode::kRegExp :
t = String::New("RegExp");
break;
- case HeapGraphNode::kHeapNumber :
+ case 7: //HeapGraphNode::kHeapNumber :
t = String::New("HeapNumber");
break;
default:
@@ -140,7 +140,7 @@ Handle<Value> GraphNode::GetRetainedSize(const Arguments& args) {
}
Handle<Object> self = args.This();
void* ptr = self->GetPointerFromInternalField(0);
- int32_t size = static_cast<HeapGraphNode*>(ptr)->GetRetainedSize(exact);
+ int32_t size = static_cast<HeapGraphNode*>(ptr)->GetRetainedSize();
return scope.Close(Integer::New(size));
}
@@ -179,15 +179,15 @@ Handle<Value> GraphNode::GetRetainingPath(const Arguments& args) {
const HeapGraphPath* path = static_cast<HeapGraphNode*>(ptr)->GetRetainingPath(index);
return scope.Close(GraphPath::New(path));
}
-
+/*
Handle<Value> GraphNode::GetDominator(Local<String> property, const AccessorInfo& info) {
HandleScope scope;
Local<Object> self = info.Holder();
void* ptr = self->GetPointerFromInternalField(0);
const HeapGraphNode* node = static_cast<HeapGraphNode*>(ptr)->GetDominatorNode();
return scope.Close(GraphNode::New(node));
}
-
+*/
Handle<Value> GraphNode::New(const HeapGraphNode* node) {
HandleScope scope;
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "v8-profiler",
- "version": "0.0.1",
+ "version": "0.0.2",
"description": "node bindings for the v8 profiler",
"homepage": "http://github.com/dannycoates/v8-profiler",
"author": "Danny Coates <dannycoates@gmail.com>",
View
4 v8-profiler.js
@@ -23,6 +23,8 @@ Snapshot.prototype.stringify = function() {
size: node.size
};
}
+ // FIXME: the children portion is too slow and bloats the results
+ /*
else {
entry = {
constructorName: node.name
@@ -36,7 +38,7 @@ Snapshot.prototype.stringify = function() {
}
}
children[node.ptr.toString()] = entry;
- }
+ }//*/
}
result.lowlevels = lowLevels;
result.entries = entries;

0 comments on commit a16cc25

Please sign in to comment.
Something went wrong with that request. Please try again.