OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "bindings/core/v8/V8ThrowException.h" | 33 #include "bindings/core/v8/V8ThrowException.h" |
34 #include "core/dom/ExecutionContext.h" | 34 #include "core/dom/ExecutionContext.h" |
35 #include "core/fetch/CachedMetadata.h" | 35 #include "core/fetch/CachedMetadata.h" |
36 #include "core/fetch/ScriptResource.h" | 36 #include "core/fetch/ScriptResource.h" |
37 #include "platform/TraceEvent.h" | 37 #include "platform/TraceEvent.h" |
38 | 38 |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
| 43 const int kMaxRecursionDepth = 22; |
| 44 |
43 // In order to make sure all pending messages to be processed in | 45 // In order to make sure all pending messages to be processed in |
44 // v8::Function::Call, we don't call handleMaxRecursionDepthExceeded | 46 // v8::Function::Call, we don't call handleMaxRecursionDepthExceeded |
45 // directly. Instead, we create a v8::Function of | 47 // directly. Instead, we create a v8::Function of |
46 // throwStackOverflowException and call it. | 48 // throwStackOverflowException and call it. |
47 void throwStackOverflowException(const v8::FunctionCallbackInfo<v8::Value>& info
) | 49 void throwStackOverflowException(const v8::FunctionCallbackInfo<v8::Value>& info
) |
48 { | 50 { |
49 V8ThrowException::throwRangeError("Maximum call stack size exceeded.", info.
GetIsolate()); | 51 V8ThrowException::throwRangeError("Maximum call stack size exceeded.", info.
GetIsolate()); |
50 } | 52 } |
51 | 53 |
52 v8::Local<v8::Value> throwStackOverflowExceptionIfNeeded(v8::Isolate* isolate) | 54 v8::Local<v8::Value> throwStackOverflowExceptionIfNeeded(v8::Isolate* isolate) |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 { | 270 { |
269 TRACE_EVENT0("v8", "v8.newInstance"); | 271 TRACE_EVENT0("v8", "v8.newInstance"); |
270 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); | 272 TRACE_EVENT_SCOPED_SAMPLING_STATE("v8", "V8Execution"); |
271 V8RecursionScope scope(isolate, context); | 273 V8RecursionScope scope(isolate, context); |
272 v8::Local<v8::Object> result = function->NewInstance(argc, argv); | 274 v8::Local<v8::Object> result = function->NewInstance(argc, argv); |
273 crashIfV8IsDead(); | 275 crashIfV8IsDead(); |
274 return result; | 276 return result; |
275 } | 277 } |
276 | 278 |
277 } // namespace blink | 279 } // namespace blink |
OLD | NEW |