Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: src/api.cc

Issue 2499273003: [inspector] introduced Script::TYPE_INSPECTOR (Closed)
Patch Set: rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/accessors.cc ('k') | src/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 4c3f53d848f3d8e513c5879e98c083da1ed83514..9d1c4f34d982e482f52119983eea62cf50928239 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -97,6 +97,15 @@ namespace v8 {
ENTER_V8(isolate); \
bool has_pending_exception = false
+#define PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(isolate, T) \
+ if (IsExecutionTerminatingCheck(isolate)) { \
+ return MaybeLocal<T>(); \
+ } \
+ InternalEscapableScope handle_scope(isolate); \
+ CallDepthScope<false> call_depth_scope(isolate, v8::Local<v8::Context>()); \
+ ENTER_V8(isolate); \
+ bool has_pending_exception = false
+
#define PREPARE_FOR_EXECUTION_WITH_CONTEXT(context, class_name, function_name, \
bailout_value, HandleScopeClass, \
do_callback) \
@@ -9146,6 +9155,25 @@ DebugInterface::DisassembleWasmFunction(Isolate* v8_isolate,
return i::wasm::DisassembleFunction(compiled_module, function_index);
}
+MaybeLocal<UnboundScript> DebugInterface::CompileInspectorScript(
+ Isolate* v8_isolate, Local<String> source) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
+ PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(isolate, UnboundScript);
+ i::ScriptData* script_data = NULL;
+ i::Handle<i::String> str = Utils::OpenHandle(*source);
+ i::Handle<i::SharedFunctionInfo> result;
+ {
+ ScriptOriginOptions origin_options;
+ result = i::Compiler::GetSharedFunctionInfoForScript(
+ str, i::Handle<i::Object>(), 0, 0, origin_options,
+ i::Handle<i::Object>(), isolate->native_context(), NULL, &script_data,
+ ScriptCompiler::kNoCompileOptions, i::INSPECTOR_CODE, false);
+ has_pending_exception = result.is_null();
+ RETURN_ON_FAILED_EXECUTION(UnboundScript);
+ }
+ RETURN_ESCAPED(ToApiHandle<UnboundScript>(result));
+}
+
Local<String> CpuProfileNode::GetFunctionName() const {
const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
i::Isolate* isolate = node->isolate();
« no previous file with comments | « src/accessors.cc ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698