OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_EXECUTION_H_ | 5 #ifndef V8_EXECUTION_H_ |
6 #define V8_EXECUTION_H_ | 6 #define V8_EXECUTION_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
10 #include "src/handles.h" | 10 #include "src/handles.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 Handle<Object> callable, | 28 Handle<Object> callable, |
29 Handle<Object> receiver, | 29 Handle<Object> receiver, |
30 int argc, | 30 int argc, |
31 Handle<Object> argv[]); | 31 Handle<Object> argv[]); |
32 | 32 |
33 // Construct object from function, the caller supplies an array of | 33 // Construct object from function, the caller supplies an array of |
34 // arguments. | 34 // arguments. |
35 MUST_USE_RESULT static MaybeHandle<Object> New(Handle<JSFunction> constructor, | 35 MUST_USE_RESULT static MaybeHandle<Object> New(Handle<JSFunction> constructor, |
36 int argc, | 36 int argc, |
37 Handle<Object> argv[]); | 37 Handle<Object> argv[]); |
38 MUST_USE_RESULT static MaybeHandle<Object> New(Handle<JSFunction> constructor, | 38 MUST_USE_RESULT static MaybeHandle<Object> New(Isolate* isolate, |
39 Handle<JSFunction> new_target, | 39 Handle<Object> constructor, |
| 40 Handle<Object> new_target, |
40 int argc, | 41 int argc, |
41 Handle<Object> argv[]); | 42 Handle<Object> argv[]); |
42 | 43 |
43 // Call a function, just like Call(), but make sure to silently catch | 44 // Call a function, just like Call(), but make sure to silently catch |
44 // any thrown exceptions. The return value is either the result of | 45 // any thrown exceptions. The return value is either the result of |
45 // calling the function (if caught exception is false) or the exception | 46 // calling the function (if caught exception is false) or the exception |
46 // that occurred (if caught exception is true). | 47 // that occurred (if caught exception is true). |
47 // In the exception case, exception_out holds the caught exceptions, unless | 48 // In the exception case, exception_out holds the caught exceptions, unless |
48 // it is a termination exception. | 49 // it is a termination exception. |
49 static MaybeHandle<Object> TryCall(Handle<JSFunction> func, | 50 static MaybeHandle<Object> TryCall(Handle<JSFunction> func, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 Isolate* isolate, double time); | 82 Isolate* isolate, double time); |
82 | 83 |
83 // Create a new regular expression object from 'pattern' and 'flags'. | 84 // Create a new regular expression object from 'pattern' and 'flags'. |
84 MUST_USE_RESULT static MaybeHandle<JSRegExp> NewJSRegExp( | 85 MUST_USE_RESULT static MaybeHandle<JSRegExp> NewJSRegExp( |
85 Handle<String> pattern, Handle<String> flags); | 86 Handle<String> pattern, Handle<String> flags); |
86 | 87 |
87 static Handle<String> GetStackTraceLine(Handle<Object> recv, | 88 static Handle<String> GetStackTraceLine(Handle<Object> recv, |
88 Handle<JSFunction> fun, | 89 Handle<JSFunction> fun, |
89 Handle<Object> pos, | 90 Handle<Object> pos, |
90 Handle<Object> is_global); | 91 Handle<Object> is_global); |
91 | |
92 // Get a function delegate for the given non-function object. | |
93 // Used for support calling objects as functions. | |
94 MUST_USE_RESULT static MaybeHandle<JSFunction> GetFunctionDelegate( | |
95 Isolate* isolate, Handle<Object> object); | |
96 | |
97 // Get a function delegate (or undefined) for the given non-function | |
98 // object. Used for support calling objects as constructors. | |
99 MUST_USE_RESULT static MaybeHandle<JSFunction> GetConstructorDelegate( | |
100 Isolate* isolate, Handle<Object> object); | |
101 | |
102 private: | |
103 MUST_USE_RESULT static Handle<String> RenderCallSite(Isolate* isolate, | |
104 Handle<Object> object); | |
105 }; | 92 }; |
106 | 93 |
107 | 94 |
108 class ExecutionAccess; | 95 class ExecutionAccess; |
109 class PostponeInterruptsScope; | 96 class PostponeInterruptsScope; |
110 | 97 |
111 | 98 |
112 // StackGuard contains the handling of the limits that are used to limit the | 99 // StackGuard contains the handling of the limits that are used to limit the |
113 // number of nested invocations of JavaScript and the stack size used in each | 100 // number of nested invocations of JavaScript and the stack size used in each |
114 // invocation. | 101 // invocation. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 friend class Isolate; | 260 friend class Isolate; |
274 friend class StackLimitCheck; | 261 friend class StackLimitCheck; |
275 friend class PostponeInterruptsScope; | 262 friend class PostponeInterruptsScope; |
276 | 263 |
277 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 264 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
278 }; | 265 }; |
279 | 266 |
280 } } // namespace v8::internal | 267 } } // namespace v8::internal |
281 | 268 |
282 #endif // V8_EXECUTION_H_ | 269 #endif // V8_EXECUTION_H_ |
OLD | NEW |