Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/api.cc

Issue 1140333003: Introduce extras export object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixed comments Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/v8.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5475 matching lines...) Expand 10 before | Expand all | Expand 10 after
5486 5486
5487 5487
5488 void Context::DetachGlobal() { 5488 void Context::DetachGlobal() {
5489 i::Handle<i::Context> context = Utils::OpenHandle(this); 5489 i::Handle<i::Context> context = Utils::OpenHandle(this);
5490 i::Isolate* isolate = context->GetIsolate(); 5490 i::Isolate* isolate = context->GetIsolate();
5491 ENTER_V8(isolate); 5491 ENTER_V8(isolate);
5492 isolate->bootstrapper()->DetachGlobal(context); 5492 isolate->bootstrapper()->DetachGlobal(context);
5493 } 5493 }
5494 5494
5495 5495
5496 Local<v8::Object> Context::GetExtrasExportsObject() {
5497 i::Handle<i::Context> context = Utils::OpenHandle(this);
5498 i::Isolate* isolate = context->GetIsolate();
5499 i::Handle<i::JSObject> exports(context->extras_exports_object(), isolate);
5500 return Utils::ToLocal(exports);
5501 }
5502
5503
5496 void Context::AllowCodeGenerationFromStrings(bool allow) { 5504 void Context::AllowCodeGenerationFromStrings(bool allow) {
5497 i::Handle<i::Context> context = Utils::OpenHandle(this); 5505 i::Handle<i::Context> context = Utils::OpenHandle(this);
5498 i::Isolate* isolate = context->GetIsolate(); 5506 i::Isolate* isolate = context->GetIsolate();
5499 ENTER_V8(isolate); 5507 ENTER_V8(isolate);
5500 context->set_allow_code_gen_from_strings( 5508 context->set_allow_code_gen_from_strings(
5501 allow ? isolate->heap()->true_value() : isolate->heap()->false_value()); 5509 allow ? isolate->heap()->true_value() : isolate->heap()->false_value());
5502 } 5510 }
5503 5511
5504 5512
5505 bool Context::IsCodeGenerationFromStringsAllowed() { 5513 bool Context::IsCodeGenerationFromStringsAllowed() {
(...skipping 2530 matching lines...) Expand 10 before | Expand all | Expand 10 after
8036 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8044 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8037 Address callback_address = 8045 Address callback_address =
8038 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8046 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8039 VMState<EXTERNAL> state(isolate); 8047 VMState<EXTERNAL> state(isolate);
8040 ExternalCallbackScope call_scope(isolate, callback_address); 8048 ExternalCallbackScope call_scope(isolate, callback_address);
8041 callback(info); 8049 callback(info);
8042 } 8050 }
8043 8051
8044 8052
8045 } } // namespace v8::internal 8053 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698