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

Side by Side Diff: src/runtime.cc

Issue 266533003: Reland "Trigger exception debug event for promises at the throw site." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Created 6 years, 7 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 // 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 <stdlib.h> 5 #include <stdlib.h>
6 #include <limits> 6 #include <limits>
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "accessors.h" 10 #include "accessors.h"
(...skipping 5639 matching lines...) Expand 10 before | Expand all | Expand 10 after
5650 HandleScope scope(isolate); 5650 HandleScope scope(isolate);
5651 // When leaving the callback, step out has been activated, but not performed 5651 // When leaving the callback, step out has been activated, but not performed
5652 // if we do not leave the builtin. To be able to step into the callback 5652 // if we do not leave the builtin. To be able to step into the callback
5653 // again, we need to clear the step out at this point. 5653 // again, we need to clear the step out at this point.
5654 debug->ClearStepOut(); 5654 debug->ClearStepOut();
5655 debug->FloodWithOneShot(callback); 5655 debug->FloodWithOneShot(callback);
5656 return isolate->heap()->undefined_value(); 5656 return isolate->heap()->undefined_value();
5657 } 5657 }
5658 5658
5659 5659
5660 // Notify the debugger if an expcetion in a promise is not caught (yet). 5660 // The argument is a closure that is kept until the epilogue is called.
5661 RUNTIME_FUNCTION(Runtime_DebugPendingExceptionInPromise) { 5661 // On exception, the closure is called, which returns the promise if the
5662 ASSERT(args.length() == 2); 5662 // exception is considered uncaught, or undefined otherwise.
5663 RUNTIME_FUNCTION(Runtime_DebugPromiseHandlePrologue) {
5664 ASSERT(args.length() == 1);
5663 HandleScope scope(isolate); 5665 HandleScope scope(isolate);
5664 CONVERT_ARG_HANDLE_CHECKED(Object, exception, 0); 5666 CONVERT_ARG_HANDLE_CHECKED(JSFunction, promise_getter, 0);
5665 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 1); 5667 isolate->debug()->PromiseHandlePrologue(promise_getter);
5666 isolate->debugger()->OnException(exception, true, promise);
5667 return isolate->heap()->undefined_value(); 5668 return isolate->heap()->undefined_value();
5668 } 5669 }
5669 5670
5671
5672 RUNTIME_FUNCTION(Runtime_DebugPromiseHandleEpilogue) {
5673 ASSERT(args.length() == 0);
5674 SealHandleScope shs(isolate);
5675 isolate->debug()->PromiseHandleEpilogue();
5676 return isolate->heap()->undefined_value();
5677 }
5678
5670 5679
5671 // Set a local property, even if it is READ_ONLY. If the property does not 5680 // Set a local property, even if it is READ_ONLY. If the property does not
5672 // exist, it will be added with attributes NONE. 5681 // exist, it will be added with attributes NONE.
5673 RUNTIME_FUNCTION(Runtime_IgnoreAttributesAndSetProperty) { 5682 RUNTIME_FUNCTION(Runtime_IgnoreAttributesAndSetProperty) {
5674 HandleScope scope(isolate); 5683 HandleScope scope(isolate);
5675 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4); 5684 RUNTIME_ASSERT(args.length() == 3 || args.length() == 4);
5676 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); 5685 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
5677 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1); 5686 CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
5678 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2); 5687 CONVERT_ARG_HANDLE_CHECKED(Object, value, 2);
5679 // Compute attributes. 5688 // Compute attributes.
(...skipping 9499 matching lines...) Expand 10 before | Expand all | Expand 10 after
15179 } 15188 }
15180 return NULL; 15189 return NULL;
15181 } 15190 }
15182 15191
15183 15192
15184 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { 15193 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) {
15185 return &(kIntrinsicFunctions[static_cast<int>(id)]); 15194 return &(kIntrinsicFunctions[static_cast<int>(id)]);
15186 } 15195 }
15187 15196
15188 } } // namespace v8::internal 15197 } } // namespace v8::internal
OLDNEW
« src/debug.cc ('K') | « src/runtime.h ('k') | test/mjsunit/es6/debug-promises-caught-all.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698