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

Side by Side Diff: src/debug.cc

Issue 3499001: Fix more GC unsafe places (Closed)
Patch Set: fix Vitaly's comment Created 10 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
« no previous file with comments | « src/bootstrapper.cc ('k') | src/runtime.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 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 1027
1028 1028
1029 // Check whether a single break point object is triggered. 1029 // Check whether a single break point object is triggered.
1030 bool Debug::CheckBreakPoint(Handle<Object> break_point_object) { 1030 bool Debug::CheckBreakPoint(Handle<Object> break_point_object) {
1031 HandleScope scope; 1031 HandleScope scope;
1032 1032
1033 // Ignore check if break point object is not a JSObject. 1033 // Ignore check if break point object is not a JSObject.
1034 if (!break_point_object->IsJSObject()) return true; 1034 if (!break_point_object->IsJSObject()) return true;
1035 1035
1036 // Get the function CheckBreakPoint (defined in debug.js). 1036 // Get the function CheckBreakPoint (defined in debug.js).
1037 Handle<String> is_break_point_triggered_symbol =
1038 Factory::LookupAsciiSymbol("IsBreakPointTriggered");
1037 Handle<JSFunction> check_break_point = 1039 Handle<JSFunction> check_break_point =
1038 Handle<JSFunction>(JSFunction::cast( 1040 Handle<JSFunction>(JSFunction::cast(
1039 debug_context()->global()->GetProperty( 1041 debug_context()->global()->GetProperty(
1040 *Factory::LookupAsciiSymbol("IsBreakPointTriggered")))); 1042 *is_break_point_triggered_symbol)));
1041 1043
1042 // Get the break id as an object. 1044 // Get the break id as an object.
1043 Handle<Object> break_id = Factory::NewNumberFromInt(Debug::break_id()); 1045 Handle<Object> break_id = Factory::NewNumberFromInt(Debug::break_id());
1044 1046
1045 // Call HandleBreakPointx. 1047 // Call HandleBreakPointx.
1046 bool caught_exception = false; 1048 bool caught_exception = false;
1047 const int argc = 2; 1049 const int argc = 2;
1048 Object** argv[argc] = { 1050 Object** argv[argc] = {
1049 break_id.location(), 1051 break_id.location(),
1050 reinterpret_cast<Object**>(break_point_object.location()) 1052 reinterpret_cast<Object**>(break_point_object.location())
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
2169 bool in_debugger = Debug::InDebugger(); 2171 bool in_debugger = Debug::InDebugger();
2170 2172
2171 // Enter the debugger. 2173 // Enter the debugger.
2172 EnterDebugger debugger; 2174 EnterDebugger debugger;
2173 if (debugger.FailedToEnter()) return; 2175 if (debugger.FailedToEnter()) return;
2174 2176
2175 // If debugging there might be script break points registered for this 2177 // If debugging there might be script break points registered for this
2176 // script. Make sure that these break points are set. 2178 // script. Make sure that these break points are set.
2177 2179
2178 // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js). 2180 // Get the function UpdateScriptBreakPoints (defined in debug-debugger.js).
2181 Handle<String> update_script_break_points_symbol =
2182 Factory::LookupAsciiSymbol("UpdateScriptBreakPoints");
2179 Handle<Object> update_script_break_points = 2183 Handle<Object> update_script_break_points =
2180 Handle<Object>(Debug::debug_context()->global()->GetProperty( 2184 Handle<Object>(Debug::debug_context()->global()->GetProperty(
2181 *Factory::LookupAsciiSymbol("UpdateScriptBreakPoints"))); 2185 *update_script_break_points_symbol));
2182 if (!update_script_break_points->IsJSFunction()) { 2186 if (!update_script_break_points->IsJSFunction()) {
2183 return; 2187 return;
2184 } 2188 }
2185 ASSERT(update_script_break_points->IsJSFunction()); 2189 ASSERT(update_script_break_points->IsJSFunction());
2186 2190
2187 // Wrap the script object in a proper JS object before passing it 2191 // Wrap the script object in a proper JS object before passing it
2188 // to JavaScript. 2192 // to JavaScript.
2189 Handle<JSValue> wrapper = GetScriptWrapper(script); 2193 Handle<JSValue> wrapper = GetScriptWrapper(script);
2190 2194
2191 // Call UpdateScriptBreakPoints expect no exceptions. 2195 // Call UpdateScriptBreakPoints expect no exceptions.
(...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
3056 { 3060 {
3057 Locker locker; 3061 Locker locker;
3058 Debugger::CallMessageDispatchHandler(); 3062 Debugger::CallMessageDispatchHandler();
3059 } 3063 }
3060 } 3064 }
3061 } 3065 }
3062 3066
3063 #endif // ENABLE_DEBUGGER_SUPPORT 3067 #endif // ENABLE_DEBUGGER_SUPPORT
3064 3068
3065 } } // namespace v8::internal 3069 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698