OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 9027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9038 void Debug::SetTailCallEliminationEnabled(Isolate* isolate, bool enabled) { | 9038 void Debug::SetTailCallEliminationEnabled(Isolate* isolate, bool enabled) { |
9039 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); | 9039 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate); |
9040 internal_isolate->SetTailCallEliminationEnabled(enabled); | 9040 internal_isolate->SetTailCallEliminationEnabled(enabled); |
9041 } | 9041 } |
9042 | 9042 |
9043 MaybeLocal<Array> Debug::GetInternalProperties(Isolate* v8_isolate, | 9043 MaybeLocal<Array> Debug::GetInternalProperties(Isolate* v8_isolate, |
9044 Local<Value> value) { | 9044 Local<Value> value) { |
9045 return debug::GetInternalProperties(v8_isolate, value); | 9045 return debug::GetInternalProperties(v8_isolate, value); |
9046 } | 9046 } |
9047 | 9047 |
| 9048 void debug::SetContextId(Local<Context> context, int id) { |
| 9049 Utils::OpenHandle(*context)->set_debug_context_id(i::Smi::FromInt(id)); |
| 9050 } |
| 9051 |
| 9052 int debug::GetContextId(Local<Context> context) { |
| 9053 i::Object* value = Utils::OpenHandle(*context)->debug_context_id(); |
| 9054 return (value->IsSmi()) ? i::Smi::cast(value)->value() : 0; |
| 9055 } |
| 9056 |
9048 Local<Context> debug::GetDebugContext(Isolate* isolate) { | 9057 Local<Context> debug::GetDebugContext(Isolate* isolate) { |
9049 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 9058 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
9050 ENTER_V8(i_isolate); | 9059 ENTER_V8(i_isolate); |
9051 return Utils::ToLocal(i_isolate->debug()->GetDebugContext()); | 9060 return Utils::ToLocal(i_isolate->debug()->GetDebugContext()); |
9052 } | 9061 } |
9053 | 9062 |
9054 MaybeLocal<Value> debug::Call(Local<Context> context, | 9063 MaybeLocal<Value> debug::Call(Local<Context> context, |
9055 v8::Local<v8::Function> fun, | 9064 v8::Local<v8::Function> fun, |
9056 v8::Local<v8::Value> data) { | 9065 v8::Local<v8::Value> data) { |
9057 PREPARE_FOR_EXECUTION(context, Debug, Call, Value); | 9066 PREPARE_FOR_EXECUTION(context, Debug, Call, Value); |
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10316 Address callback_address = | 10325 Address callback_address = |
10317 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 10326 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
10318 VMState<EXTERNAL> state(isolate); | 10327 VMState<EXTERNAL> state(isolate); |
10319 ExternalCallbackScope call_scope(isolate, callback_address); | 10328 ExternalCallbackScope call_scope(isolate, callback_address); |
10320 callback(info); | 10329 callback(info); |
10321 } | 10330 } |
10322 | 10331 |
10323 | 10332 |
10324 } // namespace internal | 10333 } // namespace internal |
10325 } // namespace v8 | 10334 } // namespace v8 |
OLD | NEW |