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 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 | 2075 |
2076 i::Handle<i::Context> context = Utils::OpenHandle(*v8_context); | 2076 i::Handle<i::Context> context = Utils::OpenHandle(*v8_context); |
2077 i::Handle<i::SharedFunctionInfo> outer_info(context->closure()->shared(), | 2077 i::Handle<i::SharedFunctionInfo> outer_info(context->closure()->shared(), |
2078 isolate); | 2078 isolate); |
2079 for (size_t i = 0; i < context_extension_count; ++i) { | 2079 for (size_t i = 0; i < context_extension_count; ++i) { |
2080 i::Handle<i::JSReceiver> extension = | 2080 i::Handle<i::JSReceiver> extension = |
2081 Utils::OpenHandle(*context_extensions[i]); | 2081 Utils::OpenHandle(*context_extensions[i]); |
2082 if (!extension->IsJSObject()) return Local<Function>(); | 2082 if (!extension->IsJSObject()) return Local<Function>(); |
2083 i::Handle<i::JSFunction> closure(context->closure(), isolate); | 2083 i::Handle<i::JSFunction> closure(context->closure(), isolate); |
2084 context = factory->NewWithContext( | 2084 context = factory->NewWithContext( |
2085 closure, context, i::ScopeInfo::CreateForWithScope(isolate), extension); | 2085 closure, context, |
| 2086 i::ScopeInfo::CreateForWithScope( |
| 2087 isolate, context->IsNativeContext() |
| 2088 ? i::Handle<i::ScopeInfo>::null() |
| 2089 : i::Handle<i::ScopeInfo>(context->scope_info())), |
| 2090 extension); |
2086 } | 2091 } |
2087 | 2092 |
2088 i::Handle<i::Object> name_obj; | 2093 i::Handle<i::Object> name_obj; |
2089 int eval_scope_position = 0; | 2094 int eval_scope_position = 0; |
2090 int eval_position = i::kNoSourcePosition; | 2095 int eval_position = i::kNoSourcePosition; |
2091 int line_offset = 0; | 2096 int line_offset = 0; |
2092 int column_offset = 0; | 2097 int column_offset = 0; |
2093 if (!source->resource_name.IsEmpty()) { | 2098 if (!source->resource_name.IsEmpty()) { |
2094 name_obj = Utils::OpenHandle(*(source->resource_name)); | 2099 name_obj = Utils::OpenHandle(*(source->resource_name)); |
2095 } | 2100 } |
(...skipping 7126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9222 Address callback_address = | 9227 Address callback_address = |
9223 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9228 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9224 VMState<EXTERNAL> state(isolate); | 9229 VMState<EXTERNAL> state(isolate); |
9225 ExternalCallbackScope call_scope(isolate, callback_address); | 9230 ExternalCallbackScope call_scope(isolate, callback_address); |
9226 callback(info); | 9231 callback(info); |
9227 } | 9232 } |
9228 | 9233 |
9229 | 9234 |
9230 } // namespace internal | 9235 } // namespace internal |
9231 } // namespace v8 | 9236 } // namespace v8 |
OLD | NEW |