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

Side by Side Diff: src/runtime/runtime-debug.cc

Issue 1065213002: Make GetDebugContext a bit more robust. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « src/debug.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/debug.h" 10 #include "src/debug.h"
(...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2652 Execution::Call(isolate, function, handle(function->global_proxy()), 0, 2652 Execution::Call(isolate, function, handle(function->global_proxy()), 0,
2653 NULL)); 2653 NULL));
2654 return *result; 2654 return *result;
2655 } 2655 }
2656 2656
2657 2657
2658 RUNTIME_FUNCTION(Runtime_GetDebugContext) { 2658 RUNTIME_FUNCTION(Runtime_GetDebugContext) {
2659 HandleScope scope(isolate); 2659 HandleScope scope(isolate);
2660 DCHECK(args.length() == 0); 2660 DCHECK(args.length() == 0);
2661 Handle<Context> context = isolate->debug()->GetDebugContext(); 2661 Handle<Context> context = isolate->debug()->GetDebugContext();
2662 if (context.is_null()) return isolate->heap()->undefined_value();
2662 context->set_security_token(isolate->native_context()->security_token()); 2663 context->set_security_token(isolate->native_context()->security_token());
2663 return context->global_proxy(); 2664 return context->global_proxy();
2664 } 2665 }
2665 2666
2666 2667
2667 // Performs a GC. 2668 // Performs a GC.
2668 // Presently, it only does a full GC. 2669 // Presently, it only does a full GC.
2669 RUNTIME_FUNCTION(Runtime_CollectGarbage) { 2670 RUNTIME_FUNCTION(Runtime_CollectGarbage) {
2670 SealHandleScope shs(isolate); 2671 SealHandleScope shs(isolate);
2671 DCHECK(args.length() == 1); 2672 DCHECK(args.length() == 1);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
2805 return Smi::FromInt(isolate->debug()->is_active()); 2806 return Smi::FromInt(isolate->debug()->is_active());
2806 } 2807 }
2807 2808
2808 2809
2809 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 2810 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
2810 UNIMPLEMENTED(); 2811 UNIMPLEMENTED();
2811 return NULL; 2812 return NULL;
2812 } 2813 }
2813 } 2814 }
2814 } // namespace v8::internal 2815 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698