Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Added EmbedderGraph stubs to chakrashim
Browse files Browse the repository at this point in the history
  • Loading branch information
Irina Yatsenko authored and kfarnung committed Jul 25, 2018
1 parent c0e0d90 commit d93e640
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 1 deletion.
32 changes: 32 additions & 0 deletions deps/chakrashim/include/v8-profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,32 @@ class V8_EXPORT ActivityControl { // NOLINT
virtual ControlOption ReportProgressValue(int done, int total) = 0;
};

// NOT IMPLEMENTED
class V8_EXPORT EmbedderGraph {
public:
class Node {
public:
Node() = default;
virtual ~Node() = default;
virtual const char* Name() { return nullptr; };
virtual size_t SizeInBytes() { return 0; }
virtual Node* WrapperNode() { return nullptr; }
virtual bool IsRootNode() { return false; }
virtual bool IsEmbedderNode() { return true; }
virtual const char* NamePrefix() { return nullptr; }

private:
Node(const Node&) = delete;
Node& operator=(const Node&) = delete;
};

virtual Node* V8Node(const v8::Local<v8::Value>& value) { return nullptr; }
virtual Node* AddNode(std::unique_ptr<Node> node) { return nullptr; }
virtual void AddEdge(Node* from, Node* to) {};

virtual ~EmbedderGraph() = default;
};

// NOT IMPLEMENTED
class V8_EXPORT HeapProfiler {
public:
Expand All @@ -103,6 +129,12 @@ class V8_EXPORT HeapProfiler {
void SetWrapperClassInfoProvider(
uint16_t class_id, WrapperInfoCallback callback) {}
void StartTrackingHeapObjects(bool track_allocations = false) {}

typedef void (*BuildEmbedderGraphCallback)(v8::Isolate* isolate,
v8::EmbedderGraph* graph,
void* data);
void AddBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback, void* data) {}
void RemoveBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback, void* data) {}
};

// NOT IMPLEMENTED
Expand Down
3 changes: 2 additions & 1 deletion deps/chakrashim/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ class V8_EXPORT Value : public Data {
Handle<Value> that) const;

bool StrictEquals(Handle<Value> that) const;

bool SameValue(Local<Value> that) const;
template <class T> static Value* Cast(T* value) {
return static_cast<Value*>(value);
}
Expand Down Expand Up @@ -1600,6 +1600,7 @@ class V8_EXPORT Object : public Value {
Maybe<bool> DeletePrivate(Local<Context> context, Local<Private> key);
MaybeLocal<Value> GetPrivate(Local<Context> context, Local<Private> key);

int GetIdentityHash();
Local<Object> Clone();
Local<Context> CreationContext();

Expand Down
4 changes: 4 additions & 0 deletions deps/chakrashim/src/v8name.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

namespace v8 {

int Name::GetIdentityHash() {
return 0;
}

Name* Name::Cast(v8::Value* obj) {
CHAKRA_ASSERT(obj->IsName());
return static_cast<Name*>(obj);
Expand Down
4 changes: 4 additions & 0 deletions deps/chakrashim/src/v8object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,10 @@ void Object::SetAlignedPointerInInternalField(int index, void* value) {
}
}

int Object::GetIdentityHash() {
return 0;
}

Local<Object> Object::Clone() {
JsValueRef constructor;
if (jsrt::GetObjectConstructor((JsValueRef)this,
Expand Down
5 changes: 5 additions & 0 deletions deps/chakrashim/src/v8value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,4 +411,9 @@ bool Value::StrictEquals(Handle<Value> that) const {
return strictEquals;
}

bool Value::SameValue(Local<Value> that) const {
CHAKRA_UNIMPLEMENTED();
return false;
}

} // namespace v8

0 comments on commit d93e640

Please sign in to comment.