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 | 5 |
6 // Defined when linking against shared lib on Windows. | 6 // Defined when linking against shared lib on Windows. |
7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) | 7 #if defined(USING_V8_SHARED) && !defined(V8_SHARED) |
8 #define V8_SHARED | 8 #define V8_SHARED |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 v8::Local<v8::Context> evaluation_context = | 746 v8::Local<v8::Context> evaluation_context = |
747 v8::Local<v8::Context>::New(isolate, evaluation_context_); | 747 v8::Local<v8::Context>::New(isolate, evaluation_context_); |
748 utility_context->SetSecurityToken(Undefined(isolate)); | 748 utility_context->SetSecurityToken(Undefined(isolate)); |
749 evaluation_context->SetSecurityToken(Undefined(isolate)); | 749 evaluation_context->SetSecurityToken(Undefined(isolate)); |
750 v8::Context::Scope context_scope(utility_context); | 750 v8::Context::Scope context_scope(utility_context); |
751 | 751 |
752 if (i::FLAG_debugger) printf("JavaScript debugger enabled\n"); | 752 if (i::FLAG_debugger) printf("JavaScript debugger enabled\n"); |
753 // Install the debugger object in the utility scope | 753 // Install the debugger object in the utility scope |
754 i::Debug* debug = reinterpret_cast<i::Isolate*>(isolate)->debug(); | 754 i::Debug* debug = reinterpret_cast<i::Isolate*>(isolate)->debug(); |
755 debug->Load(); | 755 debug->Load(); |
756 i::Handle<i::Context> debug_context = debug->debug_context(); | |
757 i::Handle<i::JSObject> js_debug | 756 i::Handle<i::JSObject> js_debug |
758 = i::Handle<i::JSObject>(debug_context->global_object()); | 757 = i::Handle<i::JSObject>(debug->debug_context()->global_object()); |
759 utility_context->Global()->Set(String::NewFromUtf8(isolate, "$debug"), | 758 utility_context->Global()->Set(String::NewFromUtf8(isolate, "$debug"), |
760 Utils::ToLocal(js_debug)); | 759 Utils::ToLocal(js_debug)); |
761 debug_context->set_security_token( | 760 debug->debug_context()->set_security_token( |
762 reinterpret_cast<i::Isolate*>(isolate)->heap()->undefined_value()); | 761 reinterpret_cast<i::Isolate*>(isolate)->heap()->undefined_value()); |
763 | 762 |
764 // Run the d8 shell utility script in the utility context | 763 // Run the d8 shell utility script in the utility context |
765 int source_index = i::NativesCollection<i::D8>::GetIndex("d8"); | 764 int source_index = i::NativesCollection<i::D8>::GetIndex("d8"); |
766 i::Vector<const char> shell_source = | 765 i::Vector<const char> shell_source = |
767 i::NativesCollection<i::D8>::GetRawScriptSource(source_index); | 766 i::NativesCollection<i::D8>::GetRawScriptSource(source_index); |
768 i::Vector<const char> shell_source_name = | 767 i::Vector<const char> shell_source_name = |
769 i::NativesCollection<i::D8>::GetScriptName(source_index); | 768 i::NativesCollection<i::D8>::GetScriptName(source_index); |
770 Handle<String> source = | 769 Handle<String> source = |
771 String::NewFromUtf8(isolate, shell_source.start(), String::kNormalString, | 770 String::NewFromUtf8(isolate, shell_source.start(), String::kNormalString, |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 } | 1556 } |
1558 | 1557 |
1559 } // namespace v8 | 1558 } // namespace v8 |
1560 | 1559 |
1561 | 1560 |
1562 #ifndef GOOGLE3 | 1561 #ifndef GOOGLE3 |
1563 int main(int argc, char* argv[]) { | 1562 int main(int argc, char* argv[]) { |
1564 return v8::Shell::Main(argc, argv); | 1563 return v8::Shell::Main(argc, argv); |
1565 } | 1564 } |
1566 #endif | 1565 #endif |
OLD | NEW |