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

Side by Side Diff: src/runtime.cc

Issue 6234: Refactored the logic for entering the debugger into one abstraction EnterDebu... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 2 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/mirror-delay.js ('k') | src/top.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3070 matching lines...) Expand 10 before | Expand all | Expand 10 after
3081 { 3081 {
3082 v8::Unlocker unlocker; 3082 v8::Unlocker unlocker;
3083 Thread::YieldCPU(); 3083 Thread::YieldCPU();
3084 } 3084 }
3085 3085
3086 return Heap::undefined_value(); 3086 return Heap::undefined_value();
3087 } 3087 }
3088 3088
3089 3089
3090 static Object* Runtime_DebugBreak(Arguments args) { 3090 static Object* Runtime_DebugBreak(Arguments args) {
3091 // Just continue if breaks are disabled or if we fail to load the debugger. 3091 // Just continue if breaks are disabled.
3092 if (Debug::disable_break() || !Debug::Load()) { 3092 if (Debug::disable_break()) {
3093 return args[0]; 3093 return args[0];
3094 } 3094 }
3095 3095
3096 // Don't break in system functions. If the current function is 3096 // Don't break in system functions. If the current function is
3097 // either in the builtins object of some context or is in the debug 3097 // either in the builtins object of some context or is in the debug
3098 // context just return with the debug break stack guard active. 3098 // context just return with the debug break stack guard active.
3099 JavaScriptFrameIterator it; 3099 JavaScriptFrameIterator it;
3100 JavaScriptFrame* frame = it.frame(); 3100 JavaScriptFrame* frame = it.frame();
3101 Object* fun = frame->function(); 3101 Object* fun = frame->function();
3102 if (fun->IsJSFunction()) { 3102 if (fun->IsJSFunction()) {
3103 GlobalObject* global = JSFunction::cast(fun)->context()->global(); 3103 GlobalObject* global = JSFunction::cast(fun)->context()->global();
3104 if (global->IsJSBuiltinsObject() || Debug::IsDebugGlobal(global)) { 3104 if (global->IsJSBuiltinsObject() || Debug::IsDebugGlobal(global)) {
3105 return args[0]; 3105 return args[0];
3106 } 3106 }
3107 } 3107 }
3108 3108
3109 // Clear the debug request flag. 3109 // Clear the debug request flag.
3110 StackGuard::Continue(DEBUGBREAK); 3110 StackGuard::Continue(DEBUGBREAK);
3111 3111
3112 HandleScope scope; 3112 HandleScope scope;
3113 SaveBreakFrame save; 3113 // Enter the debugger. Just continue if we fail to enter the debugger.
3114 EnterDebuggerContext enter; 3114 EnterDebugger debugger;
3115 if (debugger.FailedToEnter()) {
3116 return args[0];
3117 }
3115 3118
3116 // Notify the debug event listeners. 3119 // Notify the debug event listeners.
3117 Debugger::OnDebugBreak(Factory::undefined_value()); 3120 Debugger::OnDebugBreak(Factory::undefined_value());
3118 3121
3119 // Return to continue execution. 3122 // Return to continue execution.
3120 return args[0]; 3123 return args[0];
3121 } 3124 }
3122 3125
3123 3126
3124 static Object* Runtime_StackGuard(Arguments args) { 3127 static Object* Runtime_StackGuard(Arguments args) {
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after
5016 5019
5017 void Runtime::PerformGC(Object* result) { 5020 void Runtime::PerformGC(Object* result) {
5018 Failure* failure = Failure::cast(result); 5021 Failure* failure = Failure::cast(result);
5019 // Try to do a garbage collection; ignore it if it fails. The C 5022 // Try to do a garbage collection; ignore it if it fails. The C
5020 // entry stub will throw an out-of-memory exception in that case. 5023 // entry stub will throw an out-of-memory exception in that case.
5021 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); 5024 Heap::CollectGarbage(failure->requested(), failure->allocation_space());
5022 } 5025 }
5023 5026
5024 5027
5025 } } // namespace v8::internal 5028 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mirror-delay.js ('k') | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698