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

Side by Side Diff: src/d8.cc

Issue 287873005: Simplify debugger state. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/bootstrapper.cc ('k') | src/debug.h » ('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 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
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();
756 i::Handle<i::JSObject> js_debug 757 i::Handle<i::JSObject> js_debug
757 = i::Handle<i::JSObject>(debug->debug_context()->global_object()); 758 = i::Handle<i::JSObject>(debug_context->global_object());
758 utility_context->Global()->Set(String::NewFromUtf8(isolate, "$debug"), 759 utility_context->Global()->Set(String::NewFromUtf8(isolate, "$debug"),
759 Utils::ToLocal(js_debug)); 760 Utils::ToLocal(js_debug));
760 debug->debug_context()->set_security_token( 761 debug_context->set_security_token(
761 reinterpret_cast<i::Isolate*>(isolate)->heap()->undefined_value()); 762 reinterpret_cast<i::Isolate*>(isolate)->heap()->undefined_value());
762 763
763 // Run the d8 shell utility script in the utility context 764 // Run the d8 shell utility script in the utility context
764 int source_index = i::NativesCollection<i::D8>::GetIndex("d8"); 765 int source_index = i::NativesCollection<i::D8>::GetIndex("d8");
765 i::Vector<const char> shell_source = 766 i::Vector<const char> shell_source =
766 i::NativesCollection<i::D8>::GetRawScriptSource(source_index); 767 i::NativesCollection<i::D8>::GetRawScriptSource(source_index);
767 i::Vector<const char> shell_source_name = 768 i::Vector<const char> shell_source_name =
768 i::NativesCollection<i::D8>::GetScriptName(source_index); 769 i::NativesCollection<i::D8>::GetScriptName(source_index);
769 Handle<String> source = 770 Handle<String> source =
770 String::NewFromUtf8(isolate, shell_source.start(), String::kNormalString, 771 String::NewFromUtf8(isolate, shell_source.start(), String::kNormalString,
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 } 1556 }
1556 1557
1557 } // namespace v8 1558 } // namespace v8
1558 1559
1559 1560
1560 #ifndef GOOGLE3 1561 #ifndef GOOGLE3
1561 int main(int argc, char* argv[]) { 1562 int main(int argc, char* argv[]) {
1562 return v8::Shell::Main(argc, argv); 1563 return v8::Shell::Main(argc, argv);
1563 } 1564 }
1564 #endif 1565 #endif
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698