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 1128113006: Add the concept of a V8 extras exports object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Was mising test-extra.js :( 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 5474 matching lines...) Expand 10 before | Expand all | Expand 10 after
5485 5485
5486 5486
5487 void Context::DetachGlobal() { 5487 void Context::DetachGlobal() {
5488 i::Handle<i::Context> context = Utils::OpenHandle(this); 5488 i::Handle<i::Context> context = Utils::OpenHandle(this);
5489 i::Isolate* isolate = context->GetIsolate(); 5489 i::Isolate* isolate = context->GetIsolate();
5490 ENTER_V8(isolate); 5490 ENTER_V8(isolate);
5491 isolate->bootstrapper()->DetachGlobal(context); 5491 isolate->bootstrapper()->DetachGlobal(context);
5492 } 5492 }
5493 5493
5494 5494
5495 Local<v8::Object> Context::GetExtrasExportsObject() {
5496 i::Handle<i::Context> context = Utils::OpenHandle(this);
5497 i::Isolate* isolate = context->GetIsolate();
5498 i::Handle<i::JSObject> exports(context->extras_exports_object(), isolate);
5499 return Utils::ToLocal(exports);
5500 }
5501
5502
5495 void Context::AllowCodeGenerationFromStrings(bool allow) { 5503 void Context::AllowCodeGenerationFromStrings(bool allow) {
5496 i::Handle<i::Context> context = Utils::OpenHandle(this); 5504 i::Handle<i::Context> context = Utils::OpenHandle(this);
5497 i::Isolate* isolate = context->GetIsolate(); 5505 i::Isolate* isolate = context->GetIsolate();
5498 ENTER_V8(isolate); 5506 ENTER_V8(isolate);
5499 context->set_allow_code_gen_from_strings( 5507 context->set_allow_code_gen_from_strings(
5500 allow ? isolate->heap()->true_value() : isolate->heap()->false_value()); 5508 allow ? isolate->heap()->true_value() : isolate->heap()->false_value());
5501 } 5509 }
5502 5510
5503 5511
5504 bool Context::IsCodeGenerationFromStringsAllowed() { 5512 bool Context::IsCodeGenerationFromStringsAllowed() {
(...skipping 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after
8032 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8040 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8033 Address callback_address = 8041 Address callback_address =
8034 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8042 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8035 VMState<EXTERNAL> state(isolate); 8043 VMState<EXTERNAL> state(isolate);
8036 ExternalCallbackScope call_scope(isolate, callback_address); 8044 ExternalCallbackScope call_scope(isolate, callback_address);
8037 callback(info); 8045 callback(info);
8038 } 8046 }
8039 8047
8040 8048
8041 } } // namespace v8::internal 8049 } } // 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