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

Side by Side Diff: src/runtime.cc

Issue 249503002: Trigger debug event on not yet caught exception in promises. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: always use original exception Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5595 matching lines...) Expand 10 before | Expand all | Expand 10 after
5606 FixedArray* object_array = FixedArray::cast(object->elements()); 5606 FixedArray* object_array = FixedArray::cast(object->elements());
5607 object_array->set(store_index, *value); 5607 object_array->set(store_index, *value);
5608 } 5608 }
5609 return *object; 5609 return *object;
5610 } 5610 }
5611 5611
5612 5612
5613 // Check whether debugger and is about to step into the callback that is passed 5613 // Check whether debugger and is about to step into the callback that is passed
5614 // to a built-in function such as Array.forEach. 5614 // to a built-in function such as Array.forEach.
5615 RUNTIME_FUNCTION(Runtime_DebugCallbackSupportsStepping) { 5615 RUNTIME_FUNCTION(Runtime_DebugCallbackSupportsStepping) {
5616 SealHandleScope shs(isolate);
5617 #ifdef ENABLE_DEBUGGER_SUPPORT 5616 #ifdef ENABLE_DEBUGGER_SUPPORT
5618 ASSERT(args.length() == 1); 5617 ASSERT(args.length() == 1);
5619 if (!isolate->IsDebuggerActive() || !isolate->debug()->StepInActive()) { 5618 if (!isolate->IsDebuggerActive() || !isolate->debug()->StepInActive()) {
5620 return isolate->heap()->false_value(); 5619 return isolate->heap()->false_value();
5621 } 5620 }
5622 CONVERT_ARG_CHECKED(Object, callback, 0); 5621 CONVERT_ARG_CHECKED(Object, callback, 0);
5623 // We do not step into the callback if it's a builtin or not even a function. 5622 // We do not step into the callback if it's a builtin or not even a function.
5624 return isolate->heap()->ToBoolean( 5623 return isolate->heap()->ToBoolean(
5625 callback->IsJSFunction() && !JSFunction::cast(callback)->IsBuiltin()); 5624 callback->IsJSFunction() && !JSFunction::cast(callback)->IsBuiltin());
5626 #else 5625 #else
5627 return isolate->heap()->false_value(); 5626 return isolate->heap()->false_value();
5628 #endif // ENABLE_DEBUGGER_SUPPORT 5627 #endif // ENABLE_DEBUGGER_SUPPORT
5629 } 5628 }
5630 5629
5631 5630
5632 // Set one shot breakpoints for the callback function that is passed to a 5631 // Set one shot breakpoints for the callback function that is passed to a
5633 // built-in function such as Array.forEach to enable stepping into the callback. 5632 // built-in function such as Array.forEach to enable stepping into the callback.
5634 RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) { 5633 RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) {
5635 SealHandleScope shs(isolate);
5636 #ifdef ENABLE_DEBUGGER_SUPPORT 5634 #ifdef ENABLE_DEBUGGER_SUPPORT
5637 ASSERT(args.length() == 1); 5635 ASSERT(args.length() == 1);
5638 Debug* debug = isolate->debug(); 5636 Debug* debug = isolate->debug();
5639 if (!debug->IsStepping()) return isolate->heap()->undefined_value(); 5637 if (!debug->IsStepping()) return isolate->heap()->undefined_value();
5640 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callback, 0); 5638 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callback, 0);
5641 HandleScope scope(isolate); 5639 HandleScope scope(isolate);
5642 // When leaving the callback, step out has been activated, but not performed 5640 // When leaving the callback, step out has been activated, but not performed
5643 // if we do not leave the builtin. To be able to step into the callback 5641 // if we do not leave the builtin. To be able to step into the callback
5644 // again, we need to clear the step out at this point. 5642 // again, we need to clear the step out at this point.
5645 debug->ClearStepOut(); 5643 debug->ClearStepOut();
5646 debug->FloodWithOneShot(callback); 5644 debug->FloodWithOneShot(callback);
5647 #endif // ENABLE_DEBUGGER_SUPPORT 5645 #endif // ENABLE_DEBUGGER_SUPPORT
5648 return isolate->heap()->undefined_value(); 5646 return isolate->heap()->undefined_value();
5649 } 5647 }
5650 5648
5651 5649
5650 // Notify the debugger if an expcetion in a promise is not caught (yet).
5651 RUNTIME_FUNCTION(Runtime_DebugPendingExceptionInPromise) {
5652 #ifdef ENABLE_DEBUGGER_SUPPORT
5653 ASSERT(args.length() == 2);
5654 HandleScope scope(isolate);
5655 CONVERT_ARG_HANDLE_CHECKED(Object, exception, 0);
5656 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 1);
5657 isolate->debugger()->OnException(exception, true, promise);
5658 #endif // ENABLE_DEBUGGER_SUPPORT
5659 return isolate->heap()->undefined_value();
5660 }
5661
5662
5652 // Set a local property, even if it is READ_ONLY. If the property does not 5663 // Set a local property, even if it is READ_ONLY. If the property does not
5653 // exist, it will be added with attributes NONE. 5664 // exist, it will be added with attributes NONE.
5654 RUNTIME_FUNCTION(Runtime_IgnoreAttributesAndSetProperty) { 5665 RUNTIME_FUNCTION(Runtime_IgnoreAttributesAndSetProperty) {
5655 HandleScope scope(isolate); 5666 HandleScope scope(isolate);
5656 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); 5667 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4);
5657 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); 5668 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
5658 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 5669 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
5659 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2); 5670 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
5660 // Compute attributes. 5671 // Compute attributes.
5661 PropertyAttributes attributes = NONE; 5672 PropertyAttributes attributes = NONE;
(...skipping 9455 matching lines...) Expand 10 before | Expand all | Expand 10 after
15117 } 15128 }
15118 return NULL; 15129 return NULL;
15119 } 15130 }
15120 15131
15121 15132
15122 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15133 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15123 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15134 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15124 } 15135 }
15125 15136
15126 } } // namespace v8::internal 15137 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698