| 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" |
| 11 #include "src/utils.h" | 11 #include "src/utils.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 // Forward declarations. | 16 // Forward declarations. |
| 17 class JSRegExp; | 17 class JSRegExp; |
| 18 | 18 |
| 19 class Execution final : public AllStatic { | 19 class Execution final : public AllStatic { |
| 20 public: | 20 public: |
| 21 // Call a function, the caller supplies a receiver and an array | 21 // Call a function, the caller supplies a receiver and an array |
| 22 // of arguments. Arguments are Object* type. After function returns, | 22 // of arguments. |
| 23 // pointers in 'args' might be invalid. | |
| 24 // | 23 // |
| 25 // *pending_exception tells whether the invoke resulted in | 24 // When the function called is not in strict mode, receiver is |
| 26 // a pending exception. | 25 // converted to an object. |
| 27 // | 26 // |
| 28 // When convert_receiver is set, and the receiver is not an object, | 27 MUST_USE_RESULT static MaybeHandle<Object> Call(Isolate* isolate, |
| 29 // and the function called is not in strict mode, receiver is converted to | 28 Handle<Object> callable, |
| 30 // an object. | 29 Handle<Object> receiver, |
| 31 // | 30 int argc, |
| 32 MUST_USE_RESULT static MaybeHandle<Object> Call( | 31 Handle<Object> argv[]); |
| 33 Isolate* isolate, | |
| 34 Handle<Object> callable, | |
| 35 Handle<Object> receiver, | |
| 36 int argc, | |
| 37 Handle<Object> argv[], | |
| 38 bool convert_receiver = false); | |
| 39 | 32 |
| 40 // Construct object from function, the caller supplies an array of | 33 // Construct object from function, the caller supplies an array of |
| 41 // arguments. Arguments are Object* type. After function returns, | 34 // arguments. Arguments are Object* type. After function returns, |
| 42 // pointers in 'args' might be invalid. | 35 // pointers in 'args' might be invalid. |
| 43 // | 36 // |
| 44 // *pending_exception tells whether the invoke resulted in | 37 // *pending_exception tells whether the invoke resulted in |
| 45 // a pending exception. | 38 // a pending exception. |
| 46 // | 39 // |
| 47 MUST_USE_RESULT static MaybeHandle<Object> New(Handle<JSFunction> func, | 40 MUST_USE_RESULT static MaybeHandle<Object> New(Handle<JSFunction> func, |
| 48 int argc, | 41 int argc, |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 friend class Isolate; | 274 friend class Isolate; |
| 282 friend class StackLimitCheck; | 275 friend class StackLimitCheck; |
| 283 friend class PostponeInterruptsScope; | 276 friend class PostponeInterruptsScope; |
| 284 | 277 |
| 285 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 278 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
| 286 }; | 279 }; |
| 287 | 280 |
| 288 } } // namespace v8::internal | 281 } } // namespace v8::internal |
| 289 | 282 |
| 290 #endif // V8_EXECUTION_H_ | 283 #endif // V8_EXECUTION_H_ |
| OLD | NEW |