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 8954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8965 MaybeLocal<String> debug::Script::SourceMappingURL() const { | 8965 MaybeLocal<String> debug::Script::SourceMappingURL() const { |
8966 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 8966 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
8967 i::HandleScope handle_scope(isolate); | 8967 i::HandleScope handle_scope(isolate); |
8968 i::Handle<i::Script> script = Utils::OpenHandle(this); | 8968 i::Handle<i::Script> script = Utils::OpenHandle(this); |
8969 i::Handle<i::Object> value(script->source_mapping_url(), isolate); | 8969 i::Handle<i::Object> value(script->source_mapping_url(), isolate); |
8970 if (!value->IsString()) return MaybeLocal<String>(); | 8970 if (!value->IsString()) return MaybeLocal<String>(); |
8971 return Utils::ToLocal( | 8971 return Utils::ToLocal( |
8972 handle_scope.CloseAndEscape(i::Handle<i::String>::cast(value))); | 8972 handle_scope.CloseAndEscape(i::Handle<i::String>::cast(value))); |
8973 } | 8973 } |
8974 | 8974 |
8975 MaybeLocal<String> debug::Script::ContextData() const { | 8975 MaybeLocal<Value> debug::Script::ContextData() const { |
8976 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 8976 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
8977 i::HandleScope handle_scope(isolate); | 8977 i::HandleScope handle_scope(isolate); |
8978 i::Handle<i::Script> script = Utils::OpenHandle(this); | 8978 i::Handle<i::Script> script = Utils::OpenHandle(this); |
8979 i::Handle<i::Object> value(script->context_data(), isolate); | 8979 i::Handle<i::Object> value(script->context_data(), isolate); |
8980 if (!value->IsString()) return MaybeLocal<String>(); | 8980 return Utils::ToLocal(handle_scope.CloseAndEscape(value)); |
8981 return Utils::ToLocal( | |
8982 handle_scope.CloseAndEscape(i::Handle<i::String>::cast(value))); | |
8983 } | 8981 } |
8984 | 8982 |
8985 MaybeLocal<String> debug::Script::Source() const { | 8983 MaybeLocal<String> debug::Script::Source() const { |
8986 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 8984 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
8987 i::HandleScope handle_scope(isolate); | 8985 i::HandleScope handle_scope(isolate); |
8988 i::Handle<i::Script> script = Utils::OpenHandle(this); | 8986 i::Handle<i::Script> script = Utils::OpenHandle(this); |
8989 i::Handle<i::Object> value(script->source(), isolate); | 8987 i::Handle<i::Object> value(script->source(), isolate); |
8990 if (!value->IsString()) return MaybeLocal<String>(); | 8988 if (!value->IsString()) return MaybeLocal<String>(); |
8991 return Utils::ToLocal( | 8989 return Utils::ToLocal( |
8992 handle_scope.CloseAndEscape(i::Handle<i::String>::cast(value))); | 8990 handle_scope.CloseAndEscape(i::Handle<i::String>::cast(value))); |
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9878 Address callback_address = | 9876 Address callback_address = |
9879 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9877 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9880 VMState<EXTERNAL> state(isolate); | 9878 VMState<EXTERNAL> state(isolate); |
9881 ExternalCallbackScope call_scope(isolate, callback_address); | 9879 ExternalCallbackScope call_scope(isolate, callback_address); |
9882 callback(info); | 9880 callback(info); |
9883 } | 9881 } |
9884 | 9882 |
9885 | 9883 |
9886 } // namespace internal | 9884 } // namespace internal |
9887 } // namespace v8 | 9885 } // namespace v8 |
OLD | NEW |