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

Commit

Permalink
chakrashim: shim new API calls
Browse files Browse the repository at this point in the history
* Added `Context::AllowCodeGenerationFromStrings`
* Added `Isolate::SetAllowWasmCodeGenerationCallback` and
  `AllowWasmCodeGenerationCallback`
  • Loading branch information
kfarnung committed Mar 19, 2018
1 parent ced0471 commit 398a1ea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deps/chakrashim/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -2534,6 +2534,9 @@ class V8_EXPORT MicrotasksScope {
MicrotasksScope& operator=(const MicrotasksScope&) = delete;
};

typedef bool (*AllowWasmCodeGenerationCallback)(Local<Context> context,
Local<String> source);

enum GCType {
kGCTypeScavenge = 1 << 0,
kGCTypeMarkSweepCompact = 1 << 1,
Expand Down Expand Up @@ -2804,6 +2807,8 @@ class V8_EXPORT Isolate {
void SetCaptureStackTraceForUncaughtExceptions(
bool capture, int frame_limit = 10,
StackTrace::StackTraceOptions options = StackTrace::kOverview);
void SetAllowWasmCodeGenerationCallback(
AllowWasmCodeGenerationCallback callback);
};

class V8_EXPORT JitCodeEvent {
Expand Down Expand Up @@ -2986,6 +2991,7 @@ class V8_EXPORT Context {
Local<Value> GetEmbedderData(int index);
void SetSecurityToken(Handle<Value> token);
Handle<Value> GetSecurityToken();
void AllowCodeGenerationFromStrings(bool allow);
};

class V8_EXPORT Locker {
Expand Down
4 changes: 4 additions & 0 deletions deps/chakrashim/src/v8context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,8 @@ Handle<Value> Context::GetSecurityToken() {
return Handle<Value>();
}

void Context::AllowCodeGenerationFromStrings(bool allow) {
// CHAKRA-TODO
}

} // namespace v8
5 changes: 5 additions & 0 deletions deps/chakrashim/src/v8isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ bool Isolate::GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics,
return true;
}

void Isolate::SetAllowWasmCodeGenerationCallback(
AllowWasmCodeGenerationCallback callback) {
// CHAKRA-TODO: Figure out what to do here
}

Isolate::DisallowJavascriptExecutionScope::DisallowJavascriptExecutionScope(
Isolate* isolate,
OnFailure on_failure) {
Expand Down

0 comments on commit 398a1ea

Please sign in to comment.