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

Side by Side Diff: src/runtime.cc

Issue 3275011: Add breakOnCaughtException and breakOnUncaughtException flags (Closed)
Patch Set: merge Created 10 years, 3 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/runtime.h ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 8944 matching lines...) Expand 10 before | Expand all | Expand 10 after
8955 8955
8956 // Update break point state 8956 // Update break point state
8957 ExceptionBreakType type = 8957 ExceptionBreakType type =
8958 static_cast<ExceptionBreakType>(NumberToUint32(args[0])); 8958 static_cast<ExceptionBreakType>(NumberToUint32(args[0]));
8959 bool enable = args[1]->ToBoolean()->IsTrue(); 8959 bool enable = args[1]->ToBoolean()->IsTrue();
8960 Debug::ChangeBreakOnException(type, enable); 8960 Debug::ChangeBreakOnException(type, enable);
8961 return Heap::undefined_value(); 8961 return Heap::undefined_value();
8962 } 8962 }
8963 8963
8964 8964
8965 // Returns the state of break on exceptions
8966 // args[0]: boolean indicating uncaught exceptions
8967 static Object* Runtime_IsBreakOnException(Arguments args) {
8968 HandleScope scope;
8969 ASSERT(args.length() == 1);
8970 ASSERT(args[0]->IsNumber());
8971
8972 ExceptionBreakType type =
8973 static_cast<ExceptionBreakType>(NumberToUint32(args[0]));
8974 bool result = Debug::IsBreakOnException(type);
8975 return Smi::FromInt(result);
8976 }
8977
8978
8965 // Prepare for stepping 8979 // Prepare for stepping
8966 // args[0]: break id for checking execution state 8980 // args[0]: break id for checking execution state
8967 // args[1]: step action from the enumeration StepAction 8981 // args[1]: step action from the enumeration StepAction
8968 // args[2]: number of times to perform the step, for step out it is the number 8982 // args[2]: number of times to perform the step, for step out it is the number
8969 // of frames to step down. 8983 // of frames to step down.
8970 static Object* Runtime_PrepareStep(Arguments args) { 8984 static Object* Runtime_PrepareStep(Arguments args) {
8971 HandleScope scope; 8985 HandleScope scope;
8972 ASSERT(args.length() == 3); 8986 ASSERT(args.length() == 3);
8973 // Check arguments. 8987 // Check arguments.
8974 Object* check = Runtime_CheckExecutionState(args); 8988 Object* check = Runtime_CheckExecutionState(args);
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
10148 } else { 10162 } else {
10149 // Handle last resort GC and make sure to allow future allocations 10163 // Handle last resort GC and make sure to allow future allocations
10150 // to grow the heap without causing GCs (if possible). 10164 // to grow the heap without causing GCs (if possible).
10151 Counters::gc_last_resort_from_js.Increment(); 10165 Counters::gc_last_resort_from_js.Increment();
10152 Heap::CollectAllGarbage(false); 10166 Heap::CollectAllGarbage(false);
10153 } 10167 }
10154 } 10168 }
10155 10169
10156 10170
10157 } } // namespace v8::internal 10171 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698