| 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 5938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5949 | 5949 |
| 5950 return result; | 5950 return result; |
| 5951 } | 5951 } |
| 5952 | 5952 |
| 5953 Local<Context> NewContext(v8::Isolate* external_isolate, | 5953 Local<Context> NewContext(v8::Isolate* external_isolate, |
| 5954 v8::ExtensionConfiguration* extensions, | 5954 v8::ExtensionConfiguration* extensions, |
| 5955 v8::MaybeLocal<ObjectTemplate> global_template, | 5955 v8::MaybeLocal<ObjectTemplate> global_template, |
| 5956 v8::MaybeLocal<Value> global_object, | 5956 v8::MaybeLocal<Value> global_object, |
| 5957 size_t context_snapshot_index) { | 5957 size_t context_snapshot_index) { |
| 5958 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); | 5958 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); |
| 5959 TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.NewContext"); |
| 5959 LOG_API(isolate, Context, New); | 5960 LOG_API(isolate, Context, New); |
| 5960 TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.NewContext"); | |
| 5961 i::HandleScope scope(isolate); | 5961 i::HandleScope scope(isolate); |
| 5962 ExtensionConfiguration no_extensions; | 5962 ExtensionConfiguration no_extensions; |
| 5963 if (extensions == NULL) extensions = &no_extensions; | 5963 if (extensions == NULL) extensions = &no_extensions; |
| 5964 i::Handle<i::Context> env = | 5964 i::Handle<i::Context> env = |
| 5965 CreateEnvironment<i::Context>(isolate, extensions, global_template, | 5965 CreateEnvironment<i::Context>(isolate, extensions, global_template, |
| 5966 global_object, context_snapshot_index); | 5966 global_object, context_snapshot_index); |
| 5967 if (env.is_null()) { | 5967 if (env.is_null()) { |
| 5968 if (isolate->has_pending_exception()) { | 5968 if (isolate->has_pending_exception()) { |
| 5969 isolate->OptionalRescheduleException(true); | 5969 isolate->OptionalRescheduleException(true); |
| 5970 } | 5970 } |
| (...skipping 3257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9228 Address callback_address = | 9228 Address callback_address = |
| 9229 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9229 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9230 VMState<EXTERNAL> state(isolate); | 9230 VMState<EXTERNAL> state(isolate); |
| 9231 ExternalCallbackScope call_scope(isolate, callback_address); | 9231 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9232 callback(info); | 9232 callback(info); |
| 9233 } | 9233 } |
| 9234 | 9234 |
| 9235 | 9235 |
| 9236 } // namespace internal | 9236 } // namespace internal |
| 9237 } // namespace v8 | 9237 } // namespace v8 |
| OLD | NEW |