OLD | NEW |
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 2665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2676 DebugScope debug_scope(isolate->debug()); | 2676 DebugScope debug_scope(isolate->debug()); |
2677 maybe_result = Execution::Call(isolate, function, | 2677 maybe_result = Execution::Call(isolate, function, |
2678 handle(function->global_proxy()), 0, NULL); | 2678 handle(function->global_proxy()), 0, NULL); |
2679 } | 2679 } |
2680 Handle<Object> result; | 2680 Handle<Object> result; |
2681 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, maybe_result); | 2681 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, maybe_result); |
2682 return *result; | 2682 return *result; |
2683 } | 2683 } |
2684 | 2684 |
2685 | 2685 |
| 2686 RUNTIME_FUNCTION(Runtime_GetDebugContext) { |
| 2687 HandleScope scope(isolate); |
| 2688 DCHECK(args.length() == 0); |
| 2689 Handle<Context> context = isolate->debug()->GetDebugContext(); |
| 2690 context->set_security_token(isolate->native_context()->security_token()); |
| 2691 return context->global_proxy(); |
| 2692 } |
| 2693 |
| 2694 |
2686 // Performs a GC. | 2695 // Performs a GC. |
2687 // Presently, it only does a full GC. | 2696 // Presently, it only does a full GC. |
2688 RUNTIME_FUNCTION(Runtime_CollectGarbage) { | 2697 RUNTIME_FUNCTION(Runtime_CollectGarbage) { |
2689 SealHandleScope shs(isolate); | 2698 SealHandleScope shs(isolate); |
2690 DCHECK(args.length() == 1); | 2699 DCHECK(args.length() == 1); |
2691 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, "%CollectGarbage"); | 2700 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, "%CollectGarbage"); |
2692 return isolate->heap()->undefined_value(); | 2701 return isolate->heap()->undefined_value(); |
2693 } | 2702 } |
2694 | 2703 |
2695 | 2704 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2823 return Smi::FromInt(isolate->debug()->is_active()); | 2832 return Smi::FromInt(isolate->debug()->is_active()); |
2824 } | 2833 } |
2825 | 2834 |
2826 | 2835 |
2827 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 2836 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
2828 UNIMPLEMENTED(); | 2837 UNIMPLEMENTED(); |
2829 return NULL; | 2838 return NULL; |
2830 } | 2839 } |
2831 } | 2840 } |
2832 } // namespace v8::internal | 2841 } // namespace v8::internal |
OLD | NEW |