| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // of arguments. Arguments are Object* type. After function returns, | 55 // of arguments. Arguments are Object* type. After function returns, |
| 56 // pointers in 'args' might be invalid. | 56 // pointers in 'args' might be invalid. |
| 57 // | 57 // |
| 58 // *pending_exception tells whether the invoke resulted in | 58 // *pending_exception tells whether the invoke resulted in |
| 59 // a pending exception. | 59 // a pending exception. |
| 60 // | 60 // |
| 61 // When convert_receiver is set, and the receiver is not an object, | 61 // When convert_receiver is set, and the receiver is not an object, |
| 62 // and the function called is not in strict mode, receiver is converted to | 62 // and the function called is not in strict mode, receiver is converted to |
| 63 // an object. | 63 // an object. |
| 64 // | 64 // |
| 65 static Handle<Object> Call(Handle<Object> callable, | 65 static Handle<Object> Call(Isolate* isolate, |
| 66 Handle<Object> callable, |
| 66 Handle<Object> receiver, | 67 Handle<Object> receiver, |
| 67 int argc, | 68 int argc, |
| 68 Handle<Object> argv[], | 69 Handle<Object> argv[], |
| 69 bool* pending_exception, | 70 bool* pending_exception, |
| 70 bool convert_receiver = false); | 71 bool convert_receiver = false); |
| 71 | 72 |
| 72 // Construct object from function, the caller supplies an array of | 73 // Construct object from function, the caller supplies an array of |
| 73 // arguments. Arguments are Object* type. After function returns, | 74 // arguments. Arguments are Object* type. After function returns, |
| 74 // pointers in 'args' might be invalid. | 75 // pointers in 'args' might be invalid. |
| 75 // | 76 // |
| 76 // *pending_exception tells whether the invoke resulted in | 77 // *pending_exception tells whether the invoke resulted in |
| 77 // a pending exception. | 78 // a pending exception. |
| 78 // | 79 // |
| 79 static Handle<Object> New(Handle<JSFunction> func, | 80 static Handle<Object> New(Handle<JSFunction> func, |
| 80 int argc, | 81 int argc, |
| 81 Handle<Object> argv[], | 82 Handle<Object> argv[], |
| 82 bool* pending_exception); | 83 bool* pending_exception); |
| 83 | 84 |
| 84 // Call a function, just like Call(), but make sure to silently catch | 85 // Call a function, just like Call(), but make sure to silently catch |
| 85 // any thrown exceptions. The return value is either the result of | 86 // any thrown exceptions. The return value is either the result of |
| 86 // calling the function (if caught exception is false) or the exception | 87 // calling the function (if caught exception is false) or the exception |
| 87 // that occurred (if caught exception is true). | 88 // that occurred (if caught exception is true). |
| 88 static Handle<Object> TryCall(Handle<JSFunction> func, | 89 static Handle<Object> TryCall(Handle<JSFunction> func, |
| 89 Handle<Object> receiver, | 90 Handle<Object> receiver, |
| 90 int argc, | 91 int argc, |
| 91 Handle<Object> argv[], | 92 Handle<Object> argv[], |
| 92 bool* caught_exception); | 93 bool* caught_exception); |
| 93 | 94 |
| 94 // ECMA-262 9.3 | 95 // ECMA-262 9.3 |
| 95 static Handle<Object> ToNumber(Handle<Object> obj, bool* exc); | 96 static Handle<Object> ToNumber( |
| 97 Isolate* isolate, Handle<Object> obj, bool* exc); |
| 96 | 98 |
| 97 // ECMA-262 9.4 | 99 // ECMA-262 9.4 |
| 98 static Handle<Object> ToInteger(Handle<Object> obj, bool* exc); | 100 static Handle<Object> ToInteger( |
| 101 Isolate* isolate, Handle<Object> obj, bool* exc); |
| 99 | 102 |
| 100 // ECMA-262 9.5 | 103 // ECMA-262 9.5 |
| 101 static Handle<Object> ToInt32(Handle<Object> obj, bool* exc); | 104 static Handle<Object> ToInt32( |
| 105 Isolate* isolate, Handle<Object> obj, bool* exc); |
| 102 | 106 |
| 103 // ECMA-262 9.6 | 107 // ECMA-262 9.6 |
| 104 static Handle<Object> ToUint32(Handle<Object> obj, bool* exc); | 108 static Handle<Object> ToUint32( |
| 109 Isolate* isolate, Handle<Object> obj, bool* exc); |
| 105 | 110 |
| 106 // ECMA-262 9.8 | 111 // ECMA-262 9.8 |
| 107 static Handle<Object> ToString(Handle<Object> obj, bool* exc); | 112 static Handle<Object> ToString( |
| 113 Isolate* isolate, Handle<Object> obj, bool* exc); |
| 108 | 114 |
| 109 // ECMA-262 9.8 | 115 // ECMA-262 9.8 |
| 110 static Handle<Object> ToDetailString(Handle<Object> obj, bool* exc); | 116 static Handle<Object> ToDetailString( |
| 117 Isolate* isolate, Handle<Object> obj, bool* exc); |
| 111 | 118 |
| 112 // ECMA-262 9.9 | 119 // ECMA-262 9.9 |
| 113 static Handle<Object> ToObject(Handle<Object> obj, bool* exc); | 120 static Handle<Object> ToObject( |
| 121 Isolate* isolate, Handle<Object> obj, bool* exc); |
| 114 | 122 |
| 115 // Create a new date object from 'time'. | 123 // Create a new date object from 'time'. |
| 116 static Handle<Object> NewDate(double time, bool* exc); | 124 static Handle<Object> NewDate( |
| 125 Isolate* isolate, double time, bool* exc); |
| 117 | 126 |
| 118 // Create a new regular expression object from 'pattern' and 'flags'. | 127 // Create a new regular expression object from 'pattern' and 'flags'. |
| 119 static Handle<JSRegExp> NewJSRegExp(Handle<String> pattern, | 128 static Handle<JSRegExp> NewJSRegExp(Handle<String> pattern, |
| 120 Handle<String> flags, | 129 Handle<String> flags, |
| 121 bool* exc); | 130 bool* exc); |
| 122 | 131 |
| 123 // Used to implement [] notation on strings (calls JS code) | 132 // Used to implement [] notation on strings (calls JS code) |
| 124 static Handle<Object> CharAt(Handle<String> str, uint32_t index); | 133 static Handle<Object> CharAt(Handle<String> str, uint32_t index); |
| 125 | 134 |
| 126 static Handle<Object> GetFunctionFor(); | 135 static Handle<Object> GetFunctionFor(); |
| 127 static Handle<JSFunction> InstantiateFunction( | 136 static Handle<JSFunction> InstantiateFunction( |
| 128 Handle<FunctionTemplateInfo> data, bool* exc); | 137 Handle<FunctionTemplateInfo> data, bool* exc); |
| 129 static Handle<JSObject> InstantiateObject(Handle<ObjectTemplateInfo> data, | 138 static Handle<JSObject> InstantiateObject(Handle<ObjectTemplateInfo> data, |
| 130 bool* exc); | 139 bool* exc); |
| 131 static void ConfigureInstance(Handle<Object> instance, | 140 static void ConfigureInstance(Isolate* isolate, |
| 141 Handle<Object> instance, |
| 132 Handle<Object> data, | 142 Handle<Object> data, |
| 133 bool* exc); | 143 bool* exc); |
| 134 static Handle<String> GetStackTraceLine(Handle<Object> recv, | 144 static Handle<String> GetStackTraceLine(Handle<Object> recv, |
| 135 Handle<JSFunction> fun, | 145 Handle<JSFunction> fun, |
| 136 Handle<Object> pos, | 146 Handle<Object> pos, |
| 137 Handle<Object> is_global); | 147 Handle<Object> is_global); |
| 138 #ifdef ENABLE_DEBUGGER_SUPPORT | 148 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 139 static Object* DebugBreakHelper(); | 149 static Object* DebugBreakHelper(Isolate* isolate); |
| 140 static void ProcessDebugMessages(bool debug_command_only); | 150 static void ProcessDebugMessages(Isolate* isolate, bool debug_command_only); |
| 141 #endif | 151 #endif |
| 142 | 152 |
| 143 // If the stack guard is triggered, but it is not an actual | 153 // If the stack guard is triggered, but it is not an actual |
| 144 // stack overflow, then handle the interruption accordingly. | 154 // stack overflow, then handle the interruption accordingly. |
| 145 MUST_USE_RESULT static MaybeObject* HandleStackGuardInterrupt( | 155 MUST_USE_RESULT static MaybeObject* HandleStackGuardInterrupt( |
| 146 Isolate* isolate); | 156 Isolate* isolate); |
| 147 | 157 |
| 148 // Get a function delegate (or undefined) for the given non-function | 158 // Get a function delegate (or undefined) for the given non-function |
| 149 // object. Used for support calling objects as functions. | 159 // object. Used for support calling objects as functions. |
| 150 static Handle<Object> GetFunctionDelegate(Handle<Object> object); | 160 static Handle<Object> GetFunctionDelegate(Isolate* isolate, |
| 151 static Handle<Object> TryGetFunctionDelegate(Handle<Object> object, | 161 Handle<Object> object); |
| 162 static Handle<Object> TryGetFunctionDelegate(Isolate* isolate, |
| 163 Handle<Object> object, |
| 152 bool* has_pending_exception); | 164 bool* has_pending_exception); |
| 153 | 165 |
| 154 // Get a function delegate (or undefined) for the given non-function | 166 // Get a function delegate (or undefined) for the given non-function |
| 155 // object. Used for support calling objects as constructors. | 167 // object. Used for support calling objects as constructors. |
| 156 static Handle<Object> GetConstructorDelegate(Handle<Object> object); | 168 static Handle<Object> GetConstructorDelegate(Isolate* isolate, |
| 157 static Handle<Object> TryGetConstructorDelegate(Handle<Object> object, | 169 Handle<Object> object); |
| 170 static Handle<Object> TryGetConstructorDelegate(Isolate* isolate, |
| 171 Handle<Object> object, |
| 158 bool* has_pending_exception); | 172 bool* has_pending_exception); |
| 159 }; | 173 }; |
| 160 | 174 |
| 161 | 175 |
| 162 class ExecutionAccess; | 176 class ExecutionAccess; |
| 163 | 177 |
| 164 | 178 |
| 165 // StackGuard contains the handling of the limits that are used to limit the | 179 // StackGuard contains the handling of the limits that are used to limit the |
| 166 // number of nested invocations of JavaScript and the stack size used in each | 180 // number of nested invocations of JavaScript and the stack size used in each |
| 167 // invocation. | 181 // invocation. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 friend class StackLimitCheck; | 313 friend class StackLimitCheck; |
| 300 friend class PostponeInterruptsScope; | 314 friend class PostponeInterruptsScope; |
| 301 | 315 |
| 302 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 316 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
| 303 }; | 317 }; |
| 304 | 318 |
| 305 | 319 |
| 306 } } // namespace v8::internal | 320 } } // namespace v8::internal |
| 307 | 321 |
| 308 #endif // V8_EXECUTION_H_ | 322 #endif // V8_EXECUTION_H_ |
| OLD | NEW |