@@ -8931,17 +8931,12 @@ bool Debug::SetDebugEventListener(Isolate* isolate, EventCallback that,
8931
8931
return true ;
8932
8932
}
8933
8933
8934
- void Debug::DebugBreak (Isolate* isolate) {
8935
- reinterpret_cast <i::Isolate*>(isolate)->stack_guard ()->RequestDebugBreak ();
8936
- }
8937
-
8934
+ void Debug::DebugBreak (Isolate* isolate) { debug::DebugBreak (isolate); }
8938
8935
8939
8936
void Debug::CancelDebugBreak (Isolate* isolate) {
8940
- i::Isolate* internal_isolate = reinterpret_cast <i::Isolate*>(isolate);
8941
- internal_isolate->stack_guard ()->ClearDebugBreak ();
8937
+ debug::CancelDebugBreak (isolate);
8942
8938
}
8943
8939
8944
-
8945
8940
bool Debug::CheckDebugBreak (Isolate* isolate) {
8946
8941
i::Isolate* internal_isolate = reinterpret_cast <i::Isolate*>(isolate);
8947
8942
return internal_isolate->stack_guard ()->CheckDebugBreak ();
@@ -8956,29 +8951,15 @@ void Debug::SendCommand(Isolate* isolate, const uint16_t* command, int length,
8956
8951
MaybeLocal<Value> Debug::Call (Local<Context> context,
8957
8952
v8::Local<v8::Function> fun,
8958
8953
v8::Local<v8::Value> data) {
8959
- PREPARE_FOR_EXECUTION (context, Debug, Call, Value);
8960
- i::Handle <i::Object> data_obj;
8961
- if (data.IsEmpty ()) {
8962
- data_obj = isolate->factory ()->undefined_value ();
8963
- } else {
8964
- data_obj = Utils::OpenHandle (*data);
8965
- }
8966
- Local<Value> result;
8967
- has_pending_exception =
8968
- !ToLocal<Value>(isolate->debug ()->Call (Utils::OpenHandle (*fun), data_obj),
8969
- &result);
8970
- RETURN_ON_FAILED_EXECUTION (Value);
8971
- RETURN_ESCAPED (result);
8954
+ return debug::Call (context, fun, data);
8972
8955
}
8973
8956
8974
-
8975
8957
void Debug::ProcessDebugMessages (Isolate* isolate) {}
8976
8958
8977
8959
Local<Context> Debug::GetDebugContext (Isolate* isolate) {
8978
8960
return debug::GetDebugContext (isolate);
8979
8961
}
8980
8962
8981
-
8982
8963
MaybeLocal<Context> Debug::GetDebuggedContext (Isolate* isolate) {
8983
8964
i::Isolate* i_isolate = reinterpret_cast <i::Isolate*>(isolate);
8984
8965
ENTER_V8 (i_isolate);
@@ -8989,8 +8970,7 @@ MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) {
8989
8970
}
8990
8971
8991
8972
void Debug::SetLiveEditEnabled (Isolate* isolate, bool enable) {
8992
- i::Isolate* internal_isolate = reinterpret_cast <i::Isolate*>(isolate);
8993
- internal_isolate->debug ()->set_live_edit_enabled (enable);
8973
+ debug::SetLiveEditEnabled (isolate, enable);
8994
8974
}
8995
8975
8996
8976
bool Debug::IsTailCallEliminationEnabled (Isolate* isolate) {
@@ -9005,13 +8985,7 @@ void Debug::SetTailCallEliminationEnabled(Isolate* isolate, bool enabled) {
9005
8985
9006
8986
MaybeLocal<Array> Debug::GetInternalProperties (Isolate* v8_isolate,
9007
8987
Local<Value> value) {
9008
- i::Isolate* isolate = reinterpret_cast <i::Isolate*>(v8_isolate);
9009
- ENTER_V8 (isolate);
9010
- i::Handle <i::Object> val = Utils::OpenHandle (*value);
9011
- i::Handle <i::JSArray> result;
9012
- if (!i::Runtime::GetInternalProperties (isolate, val).ToHandle (&result))
9013
- return MaybeLocal<Array>();
9014
- return Utils::ToLocal (result);
8988
+ return debug::GetInternalProperties (v8_isolate, value);
9015
8989
}
9016
8990
9017
8991
Local<Context> debug::GetDebugContext (Isolate* isolate) {
@@ -9023,22 +8997,43 @@ Local<Context> debug::GetDebugContext(Isolate* isolate) {
9023
8997
MaybeLocal<Value> debug::Call (Local<Context> context,
9024
8998
v8::Local<v8::Function> fun,
9025
8999
v8::Local<v8::Value> data) {
9026
- return Debug::Call (context, fun, data);
9000
+ PREPARE_FOR_EXECUTION (context, Debug, Call, Value);
9001
+ i::Handle <i::Object> data_obj;
9002
+ if (data.IsEmpty ()) {
9003
+ data_obj = isolate->factory ()->undefined_value ();
9004
+ } else {
9005
+ data_obj = Utils::OpenHandle (*data);
9006
+ }
9007
+ Local<Value> result;
9008
+ has_pending_exception = !ToLocal<Value>(
9009
+ isolate->debug ()->Call (Utils::OpenHandle (*fun), data_obj), &result);
9010
+ RETURN_ON_FAILED_EXECUTION (Value);
9011
+ RETURN_ESCAPED (result);
9027
9012
}
9028
9013
9029
9014
void debug::SetLiveEditEnabled (Isolate* isolate, bool enable) {
9030
- Debug::SetLiveEditEnabled (isolate, enable);
9015
+ i::Isolate* internal_isolate = reinterpret_cast <i::Isolate*>(isolate);
9016
+ internal_isolate->debug ()->set_live_edit_enabled (enable);
9031
9017
}
9032
9018
9033
- void debug::DebugBreak (Isolate* isolate) { Debug::DebugBreak (isolate); }
9019
+ void debug::DebugBreak (Isolate* isolate) {
9020
+ reinterpret_cast <i::Isolate*>(isolate)->stack_guard ()->RequestDebugBreak ();
9021
+ }
9034
9022
9035
9023
void debug::CancelDebugBreak (Isolate* isolate) {
9036
- Debug::CancelDebugBreak (isolate);
9024
+ i::Isolate* internal_isolate = reinterpret_cast <i::Isolate*>(isolate);
9025
+ internal_isolate->stack_guard ()->ClearDebugBreak ();
9037
9026
}
9038
9027
9039
- MaybeLocal<Array> debug::GetInternalProperties (Isolate* isolate ,
9028
+ MaybeLocal<Array> debug::GetInternalProperties (Isolate* v8_isolate ,
9040
9029
Local<Value> value) {
9041
- return Debug::GetInternalProperties (isolate, value);
9030
+ i::Isolate* isolate = reinterpret_cast <i::Isolate*>(v8_isolate);
9031
+ ENTER_V8 (isolate);
9032
+ i::Handle <i::Object> val = Utils::OpenHandle (*value);
9033
+ i::Handle <i::JSArray> result;
9034
+ if (!i::Runtime::GetInternalProperties (isolate, val).ToHandle (&result))
9035
+ return MaybeLocal<Array>();
9036
+ return Utils::ToLocal (result);
9042
9037
}
9043
9038
9044
9039
void debug::ChangeBreakOnException (Isolate* isolate, ExceptionBreakState type) {
0 commit comments