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

Unified Diff: src/accessors.cc

Issue 2233923003: Desugar async/await to create the resulting Promise upfront (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Check for stack overflow on function length getter Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/ast/ast-value-factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.cc
diff --git a/src/accessors.cc b/src/accessors.cc
index da44151b3edbdd6d4b517e14936aacc83bd0b6fc..8d7fac5d3cd279a9f87bada7e33a6a520851ee1d 100644
--- a/src/accessors.cc
+++ b/src/accessors.cc
@@ -737,7 +737,12 @@ void Accessors::FunctionLengthGetter(
Handle<JSFunction> function =
Handle<JSFunction>::cast(Utils::OpenHandle(*info.Holder()));
Handle<Object> result;
- if (!JSFunction::GetLength(isolate, function).ToHandle(&result)) {
+ // This may invoke the compiler, so check for stack overflow like other
+ // compiler entrypoints, and return 0 on failure (as on an exception).
+ StackLimitCheck check(isolate);
+ if (check.JsHasOverflowed(1 * KB)) {
+ result = handle(Smi::FromInt(0), isolate);
caitp 2016/08/12 01:57:10 thinking about this, we only want to return 0 if c
Dan Ehrenberg 2016/08/12 02:20:47 I backed out this change in the most recent versio
+ } else if (!JSFunction::GetLength(isolate, function).ToHandle(&result)) {
result = handle(Smi::FromInt(0), isolate);
isolate->OptionalRescheduleException(false);
}
« no previous file with comments | « no previous file | src/ast/ast-value-factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698