| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
| 6 * | 6 * |
| 7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
| 8 * | 8 * |
| 9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
| 10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 : isolate_(isolate), parameter_(parameter), callback_(callback) { | 417 : isolate_(isolate), parameter_(parameter), callback_(callback) { |
| 418 for (int i = 0; i < kInternalFieldsInWeakCallback; ++i) { | 418 for (int i = 0; i < kInternalFieldsInWeakCallback; ++i) { |
| 419 internal_fields_[i] = internal_fields[i]; | 419 internal_fields_[i] = internal_fields[i]; |
| 420 } | 420 } |
| 421 } | 421 } |
| 422 | 422 |
| 423 V8_INLINE Isolate* GetIsolate() const { return isolate_; } | 423 V8_INLINE Isolate* GetIsolate() const { return isolate_; } |
| 424 V8_INLINE T* GetParameter() const { return parameter_; } | 424 V8_INLINE T* GetParameter() const { return parameter_; } |
| 425 V8_INLINE void* GetInternalField(int index) const; | 425 V8_INLINE void* GetInternalField(int index) const; |
| 426 | 426 |
| 427 V8_INLINE V8_DEPRECATE_SOON("use indexed version", | 427 V8_INLINE V8_DEPRECATED("use indexed version", |
| 428 void* GetInternalField1() const) { | 428 void* GetInternalField1() const) { |
| 429 return internal_fields_[0]; | 429 return internal_fields_[0]; |
| 430 } | 430 } |
| 431 V8_INLINE V8_DEPRECATE_SOON("use indexed version", | 431 V8_INLINE V8_DEPRECATED("use indexed version", |
| 432 void* GetInternalField2() const) { | 432 void* GetInternalField2() const) { |
| 433 return internal_fields_[1]; | 433 return internal_fields_[1]; |
| 434 } | 434 } |
| 435 | 435 |
| 436 bool IsFirstPass() const { return callback_ != nullptr; } | 436 bool IsFirstPass() const { return callback_ != nullptr; } |
| 437 | 437 |
| 438 // When first called, the embedder MUST Reset() the Global which triggered the | 438 // When first called, the embedder MUST Reset() the Global which triggered the |
| 439 // callback. The Global itself is unusable for anything else. No v8 other api | 439 // callback. The Global itself is unusable for anything else. No v8 other api |
| 440 // calls may be called in the first callback. Should additional work be | 440 // calls may be called in the first callback. Should additional work be |
| 441 // required, the embedder must set a second pass callback, which will be | 441 // required, the embedder must set a second pass callback, which will be |
| 442 // called after all the initial callbacks are processed. | 442 // called after all the initial callbacks are processed. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 } | 548 } |
| 549 | 549 |
| 550 /** | 550 /** |
| 551 * Install a finalization callback on this object. | 551 * Install a finalization callback on this object. |
| 552 * NOTE: There is no guarantee as to *when* or even *if* the callback is | 552 * NOTE: There is no guarantee as to *when* or even *if* the callback is |
| 553 * invoked. The invocation is performed solely on a best effort basis. | 553 * invoked. The invocation is performed solely on a best effort basis. |
| 554 * As always, GC-based finalization should *not* be relied upon for any | 554 * As always, GC-based finalization should *not* be relied upon for any |
| 555 * critical form of resource management! | 555 * critical form of resource management! |
| 556 */ | 556 */ |
| 557 template <typename P> | 557 template <typename P> |
| 558 V8_INLINE V8_DEPRECATE_SOON( | 558 V8_INLINE V8_DEPRECATED( |
| 559 "use WeakCallbackInfo version", | 559 "use WeakCallbackInfo version", |
| 560 void SetWeak(P* parameter, | 560 void SetWeak(P* parameter, |
| 561 typename WeakCallbackData<T, P>::Callback callback)); | 561 typename WeakCallbackData<T, P>::Callback callback)); |
| 562 | 562 |
| 563 template <typename S, typename P> | 563 template <typename S, typename P> |
| 564 V8_INLINE V8_DEPRECATE_SOON( | 564 V8_INLINE V8_DEPRECATED( |
| 565 "use WeakCallbackInfo version", | 565 "use WeakCallbackInfo version", |
| 566 void SetWeak(P* parameter, | 566 void SetWeak(P* parameter, |
| 567 typename WeakCallbackData<S, P>::Callback callback)); | 567 typename WeakCallbackData<S, P>::Callback callback)); |
| 568 | 568 |
| 569 // Phantom persistents work like weak persistents, except that the pointer to | 569 // Phantom persistents work like weak persistents, except that the pointer to |
| 570 // the object being collected is not available in the finalization callback. | 570 // the object being collected is not available in the finalization callback. |
| 571 // This enables the garbage collector to collect the object and any objects | 571 // This enables the garbage collector to collect the object and any objects |
| 572 // it references transitively in one GC cycle. At the moment you can either | 572 // it references transitively in one GC cycle. At the moment you can either |
| 573 // specify a parameter for the callback or the location of two internal | 573 // specify a parameter for the callback or the location of two internal |
| 574 // fields in the dying object. | 574 // fields in the dying object. |
| 575 template <typename P> | 575 template <typename P> |
| 576 V8_INLINE V8_DEPRECATE_SOON( | 576 V8_INLINE V8_DEPRECATED( |
| 577 "use SetWeak", | 577 "use SetWeak", |
| 578 void SetPhantom(P* parameter, | 578 void SetPhantom(P* parameter, |
| 579 typename WeakCallbackInfo<P>::Callback callback, | 579 typename WeakCallbackInfo<P>::Callback callback, |
| 580 int internal_field_index1 = -1, | 580 int internal_field_index1 = -1, |
| 581 int internal_field_index2 = -1)); | 581 int internal_field_index2 = -1)); |
| 582 | 582 |
| 583 template <typename P> | 583 template <typename P> |
| 584 V8_INLINE void SetWeak(P* parameter, | 584 V8_INLINE void SetWeak(P* parameter, |
| 585 typename WeakCallbackInfo<P>::Callback callback, | 585 typename WeakCallbackInfo<P>::Callback callback, |
| 586 WeakCallbackType type); | 586 WeakCallbackType type); |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 * consumed later to speed up compilation of identical source scripts. | 1310 * consumed later to speed up compilation of identical source scripts. |
| 1311 * | 1311 * |
| 1312 * Note that when producing cached data, the source must point to NULL for | 1312 * Note that when producing cached data, the source must point to NULL for |
| 1313 * cached data. When consuming cached data, the cached data must have been | 1313 * cached data. When consuming cached data, the cached data must have been |
| 1314 * produced by the same version of V8. | 1314 * produced by the same version of V8. |
| 1315 * | 1315 * |
| 1316 * \param source Script source code. | 1316 * \param source Script source code. |
| 1317 * \return Compiled script object (context independent; for running it must be | 1317 * \return Compiled script object (context independent; for running it must be |
| 1318 * bound to a context). | 1318 * bound to a context). |
| 1319 */ | 1319 */ |
| 1320 static V8_DEPRECATE_SOON("Use maybe version", | 1320 static V8_DEPRECATED("Use maybe version", |
| 1321 Local<UnboundScript> CompileUnbound( | 1321 Local<UnboundScript> CompileUnbound( |
| 1322 Isolate* isolate, Source* source, | 1322 Isolate* isolate, Source* source, |
| 1323 CompileOptions options = kNoCompileOptions)); | 1323 CompileOptions options = kNoCompileOptions)); |
| 1324 static V8_WARN_UNUSED_RESULT MaybeLocal<UnboundScript> CompileUnboundScript( | 1324 static V8_WARN_UNUSED_RESULT MaybeLocal<UnboundScript> CompileUnboundScript( |
| 1325 Isolate* isolate, Source* source, | 1325 Isolate* isolate, Source* source, |
| 1326 CompileOptions options = kNoCompileOptions); | 1326 CompileOptions options = kNoCompileOptions); |
| 1327 | 1327 |
| 1328 /** | 1328 /** |
| 1329 * Compiles the specified script (bound to current context). | 1329 * Compiles the specified script (bound to current context). |
| 1330 * | 1330 * |
| 1331 * \param source Script source code. | 1331 * \param source Script source code. |
| 1332 * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile() | 1332 * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile() |
| 1333 * using pre_data speeds compilation if it's done multiple times. | 1333 * using pre_data speeds compilation if it's done multiple times. |
| 1334 * Owned by caller, no references are kept when this function returns. | 1334 * Owned by caller, no references are kept when this function returns. |
| 1335 * \return Compiled script object, bound to the context that was active | 1335 * \return Compiled script object, bound to the context that was active |
| 1336 * when this function was called. When run it will always use this | 1336 * when this function was called. When run it will always use this |
| 1337 * context. | 1337 * context. |
| 1338 */ | 1338 */ |
| 1339 static V8_DEPRECATE_SOON( | 1339 static V8_DEPRECATED( |
| 1340 "Use maybe version", | 1340 "Use maybe version", |
| 1341 Local<Script> Compile(Isolate* isolate, Source* source, | 1341 Local<Script> Compile(Isolate* isolate, Source* source, |
| 1342 CompileOptions options = kNoCompileOptions)); | 1342 CompileOptions options = kNoCompileOptions)); |
| 1343 static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile( | 1343 static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile( |
| 1344 Local<Context> context, Source* source, | 1344 Local<Context> context, Source* source, |
| 1345 CompileOptions options = kNoCompileOptions); | 1345 CompileOptions options = kNoCompileOptions); |
| 1346 | 1346 |
| 1347 /** | 1347 /** |
| 1348 * Returns a task which streams script data into V8, or NULL if the script | 1348 * Returns a task which streams script data into V8, or NULL if the script |
| 1349 * cannot be streamed. The user is responsible for running the task on a | 1349 * cannot be streamed. The user is responsible for running the task on a |
| 1350 * background thread and deleting it. When ran, the task starts parsing the | 1350 * background thread and deleting it. When ran, the task starts parsing the |
| 1351 * script, and it will request data from the StreamedSource as needed. When | 1351 * script, and it will request data from the StreamedSource as needed. When |
| 1352 * ScriptStreamingTask::Run exits, all data has been streamed and the script | 1352 * ScriptStreamingTask::Run exits, all data has been streamed and the script |
| 1353 * can be compiled (see Compile below). | 1353 * can be compiled (see Compile below). |
| 1354 * | 1354 * |
| 1355 * This API allows to start the streaming with as little data as possible, and | 1355 * This API allows to start the streaming with as little data as possible, and |
| 1356 * the remaining data (for example, the ScriptOrigin) is passed to Compile. | 1356 * the remaining data (for example, the ScriptOrigin) is passed to Compile. |
| 1357 */ | 1357 */ |
| 1358 static ScriptStreamingTask* StartStreamingScript( | 1358 static ScriptStreamingTask* StartStreamingScript( |
| 1359 Isolate* isolate, StreamedSource* source, | 1359 Isolate* isolate, StreamedSource* source, |
| 1360 CompileOptions options = kNoCompileOptions); | 1360 CompileOptions options = kNoCompileOptions); |
| 1361 | 1361 |
| 1362 /** | 1362 /** |
| 1363 * Compiles a streamed script (bound to current context). | 1363 * Compiles a streamed script (bound to current context). |
| 1364 * | 1364 * |
| 1365 * This can only be called after the streaming has finished | 1365 * This can only be called after the streaming has finished |
| 1366 * (ScriptStreamingTask has been run). V8 doesn't construct the source string | 1366 * (ScriptStreamingTask has been run). V8 doesn't construct the source string |
| 1367 * during streaming, so the embedder needs to pass the full source here. | 1367 * during streaming, so the embedder needs to pass the full source here. |
| 1368 */ | 1368 */ |
| 1369 static V8_DEPRECATE_SOON( | 1369 static V8_DEPRECATED("Use maybe version", |
| 1370 "Use maybe version", | 1370 Local<Script> Compile(Isolate* isolate, |
| 1371 Local<Script> Compile(Isolate* isolate, StreamedSource* source, | 1371 StreamedSource* source, |
| 1372 Local<String> full_source_string, | 1372 Local<String> full_source_string, |
| 1373 const ScriptOrigin& origin)); | 1373 const ScriptOrigin& origin)); |
| 1374 static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile( | 1374 static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile( |
| 1375 Local<Context> context, StreamedSource* source, | 1375 Local<Context> context, StreamedSource* source, |
| 1376 Local<String> full_source_string, const ScriptOrigin& origin); | 1376 Local<String> full_source_string, const ScriptOrigin& origin); |
| 1377 | 1377 |
| 1378 /** | 1378 /** |
| 1379 * Return a version tag for CachedData for the current V8 version & flags. | 1379 * Return a version tag for CachedData for the current V8 version & flags. |
| 1380 * | 1380 * |
| 1381 * This value is meant only for determining whether a previously generated | 1381 * This value is meant only for determining whether a previously generated |
| 1382 * CachedData instance is still valid; the tag has no other meaing. | 1382 * CachedData instance is still valid; the tag has no other meaing. |
| 1383 * | 1383 * |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1489 * Returns the index within the line of the first character where | 1489 * Returns the index within the line of the first character where |
| 1490 * the error occurred. | 1490 * the error occurred. |
| 1491 */ | 1491 */ |
| 1492 V8_DEPRECATE_SOON("Use maybe version", int GetStartColumn() const); | 1492 V8_DEPRECATE_SOON("Use maybe version", int GetStartColumn() const); |
| 1493 V8_WARN_UNUSED_RESULT Maybe<int> GetStartColumn(Local<Context> context) const; | 1493 V8_WARN_UNUSED_RESULT Maybe<int> GetStartColumn(Local<Context> context) const; |
| 1494 | 1494 |
| 1495 /** | 1495 /** |
| 1496 * Returns the index within the line of the last character where | 1496 * Returns the index within the line of the last character where |
| 1497 * the error occurred. | 1497 * the error occurred. |
| 1498 */ | 1498 */ |
| 1499 V8_DEPRECATE_SOON("Use maybe version", int GetEndColumn() const); | 1499 V8_DEPRECATED("Use maybe version", int GetEndColumn() const); |
| 1500 V8_WARN_UNUSED_RESULT Maybe<int> GetEndColumn(Local<Context> context) const; | 1500 V8_WARN_UNUSED_RESULT Maybe<int> GetEndColumn(Local<Context> context) const; |
| 1501 | 1501 |
| 1502 /** | 1502 /** |
| 1503 * Passes on the value set by the embedder when it fed the script from which | 1503 * Passes on the value set by the embedder when it fed the script from which |
| 1504 * this Message was generated to V8. | 1504 * this Message was generated to V8. |
| 1505 */ | 1505 */ |
| 1506 bool IsSharedCrossOrigin() const; | 1506 bool IsSharedCrossOrigin() const; |
| 1507 bool IsOpaque() const; | 1507 bool IsOpaque() const; |
| 1508 | 1508 |
| 1509 // TODO(1245381): Print to a string instead of on a FILE. | 1509 // TODO(1245381): Print to a string instead of on a FILE. |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1657 */ | 1657 */ |
| 1658 class V8_EXPORT JSON { | 1658 class V8_EXPORT JSON { |
| 1659 public: | 1659 public: |
| 1660 /** | 1660 /** |
| 1661 * Tries to parse the string |json_string| and returns it as value if | 1661 * Tries to parse the string |json_string| and returns it as value if |
| 1662 * successful. | 1662 * successful. |
| 1663 * | 1663 * |
| 1664 * \param json_string The string to parse. | 1664 * \param json_string The string to parse. |
| 1665 * \return The corresponding value if successfully parsed. | 1665 * \return The corresponding value if successfully parsed. |
| 1666 */ | 1666 */ |
| 1667 static V8_DEPRECATE_SOON("Use maybe version", | 1667 static V8_DEPRECATED("Use maybe version", |
| 1668 Local<Value> Parse(Local<String> json_string)); | 1668 Local<Value> Parse(Local<String> json_string)); |
| 1669 static V8_WARN_UNUSED_RESULT MaybeLocal<Value> Parse( | 1669 static V8_WARN_UNUSED_RESULT MaybeLocal<Value> Parse( |
| 1670 Isolate* isolate, Local<String> json_string); | 1670 Isolate* isolate, Local<String> json_string); |
| 1671 }; | 1671 }; |
| 1672 | 1672 |
| 1673 | 1673 |
| 1674 /** | 1674 /** |
| 1675 * A map whose keys are referenced weakly. It is similar to JavaScript WeakMap | 1675 * A map whose keys are referenced weakly. It is similar to JavaScript WeakMap |
| 1676 * but can be created without entering a v8::Context and hence shouldn't | 1676 * but can be created without entering a v8::Context and hence shouldn't |
| 1677 * escape to JavaScript. | 1677 * escape to JavaScript. |
| 1678 */ | 1678 */ |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1970 V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32( | 1970 V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32( |
| 1971 Local<Context> context) const; | 1971 Local<Context> context) const; |
| 1972 V8_WARN_UNUSED_RESULT MaybeLocal<Int32> ToInt32(Local<Context> context) const; | 1972 V8_WARN_UNUSED_RESULT MaybeLocal<Int32> ToInt32(Local<Context> context) const; |
| 1973 | 1973 |
| 1974 V8_DEPRECATE_SOON("Use maybe version", | 1974 V8_DEPRECATE_SOON("Use maybe version", |
| 1975 Local<Boolean> ToBoolean(Isolate* isolate) const); | 1975 Local<Boolean> ToBoolean(Isolate* isolate) const); |
| 1976 V8_DEPRECATE_SOON("Use maybe version", | 1976 V8_DEPRECATE_SOON("Use maybe version", |
| 1977 Local<Number> ToNumber(Isolate* isolate) const); | 1977 Local<Number> ToNumber(Isolate* isolate) const); |
| 1978 V8_DEPRECATE_SOON("Use maybe version", | 1978 V8_DEPRECATE_SOON("Use maybe version", |
| 1979 Local<String> ToString(Isolate* isolate) const); | 1979 Local<String> ToString(Isolate* isolate) const); |
| 1980 V8_DEPRECATE_SOON("Use maybe version", | 1980 V8_DEPRECATED("Use maybe version", |
| 1981 Local<String> ToDetailString(Isolate* isolate) const); | 1981 Local<String> ToDetailString(Isolate* isolate) const); |
| 1982 V8_DEPRECATE_SOON("Use maybe version", | 1982 V8_DEPRECATE_SOON("Use maybe version", |
| 1983 Local<Object> ToObject(Isolate* isolate) const); | 1983 Local<Object> ToObject(Isolate* isolate) const); |
| 1984 V8_DEPRECATE_SOON("Use maybe version", | 1984 V8_DEPRECATE_SOON("Use maybe version", |
| 1985 Local<Integer> ToInteger(Isolate* isolate) const); | 1985 Local<Integer> ToInteger(Isolate* isolate) const); |
| 1986 V8_DEPRECATE_SOON("Use maybe version", | 1986 V8_DEPRECATED("Use maybe version", |
| 1987 Local<Uint32> ToUint32(Isolate* isolate) const); | 1987 Local<Uint32> ToUint32(Isolate* isolate) const); |
| 1988 V8_DEPRECATE_SOON("Use maybe version", | 1988 V8_DEPRECATE_SOON("Use maybe version", |
| 1989 Local<Int32> ToInt32(Isolate* isolate) const); | 1989 Local<Int32> ToInt32(Isolate* isolate) const); |
| 1990 | 1990 |
| 1991 inline V8_DEPRECATE_SOON("Use maybe version", | 1991 inline V8_DEPRECATE_SOON("Use maybe version", |
| 1992 Local<Boolean> ToBoolean() const); | 1992 Local<Boolean> ToBoolean() const); |
| 1993 inline V8_DEPRECATE_SOON("Use maybe version", Local<Number> ToNumber() const); | 1993 inline V8_DEPRECATED("Use maybe version", Local<Number> ToNumber() const); |
| 1994 inline V8_DEPRECATE_SOON("Use maybe version", Local<String> ToString() const); | 1994 inline V8_DEPRECATE_SOON("Use maybe version", Local<String> ToString() const); |
| 1995 inline V8_DEPRECATE_SOON("Use maybe version", | 1995 inline V8_DEPRECATED("Use maybe version", |
| 1996 Local<String> ToDetailString() const); | 1996 Local<String> ToDetailString() const); |
| 1997 inline V8_DEPRECATE_SOON("Use maybe version", Local<Object> ToObject() const); | 1997 inline V8_DEPRECATE_SOON("Use maybe version", Local<Object> ToObject() const); |
| 1998 inline V8_DEPRECATE_SOON("Use maybe version", | 1998 inline V8_DEPRECATE_SOON("Use maybe version", |
| 1999 Local<Integer> ToInteger() const); | 1999 Local<Integer> ToInteger() const); |
| 2000 inline V8_DEPRECATE_SOON("Use maybe version", Local<Uint32> ToUint32() const); | 2000 inline V8_DEPRECATED("Use maybe version", Local<Uint32> ToUint32() const); |
| 2001 inline V8_DEPRECATE_SOON("Use maybe version", Local<Int32> ToInt32() const); | 2001 inline V8_DEPRECATED("Use maybe version", Local<Int32> ToInt32() const); |
| 2002 | 2002 |
| 2003 /** | 2003 /** |
| 2004 * Attempts to convert a string to an array index. | 2004 * Attempts to convert a string to an array index. |
| 2005 * Returns an empty handle if the conversion fails. | 2005 * Returns an empty handle if the conversion fails. |
| 2006 */ | 2006 */ |
| 2007 V8_DEPRECATE_SOON("Use maybe version", Local<Uint32> ToArrayIndex() const); | 2007 V8_DEPRECATED("Use maybe version", Local<Uint32> ToArrayIndex() const); |
| 2008 V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToArrayIndex( | 2008 V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToArrayIndex( |
| 2009 Local<Context> context) const; | 2009 Local<Context> context) const; |
| 2010 | 2010 |
| 2011 V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(Local<Context> context) const; | 2011 V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(Local<Context> context) const; |
| 2012 V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const; | 2012 V8_WARN_UNUSED_RESULT Maybe<double> NumberValue(Local<Context> context) const; |
| 2013 V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue( | 2013 V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue( |
| 2014 Local<Context> context) const; | 2014 Local<Context> context) const; |
| 2015 V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value( | 2015 V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value( |
| 2016 Local<Context> context) const; | 2016 Local<Context> context) const; |
| 2017 V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const; | 2017 V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2301 NewStringType type = kNormalString, | 2301 NewStringType type = kNormalString, |
| 2302 int length = -1)); | 2302 int length = -1)); |
| 2303 | 2303 |
| 2304 /** Allocates a new string from UTF-8 data. Only returns an empty value when | 2304 /** Allocates a new string from UTF-8 data. Only returns an empty value when |
| 2305 * length > kMaxLength. **/ | 2305 * length > kMaxLength. **/ |
| 2306 static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromUtf8( | 2306 static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromUtf8( |
| 2307 Isolate* isolate, const char* data, v8::NewStringType type, | 2307 Isolate* isolate, const char* data, v8::NewStringType type, |
| 2308 int length = -1); | 2308 int length = -1); |
| 2309 | 2309 |
| 2310 /** Allocates a new string from Latin-1 data.*/ | 2310 /** Allocates a new string from Latin-1 data.*/ |
| 2311 static V8_DEPRECATE_SOON( | 2311 static V8_DEPRECATED( |
| 2312 "Use maybe version", | 2312 "Use maybe version", |
| 2313 Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data, | 2313 Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data, |
| 2314 NewStringType type = kNormalString, | 2314 NewStringType type = kNormalString, |
| 2315 int length = -1)); | 2315 int length = -1)); |
| 2316 | 2316 |
| 2317 /** Allocates a new string from Latin-1 data. Only returns an empty value | 2317 /** Allocates a new string from Latin-1 data. Only returns an empty value |
| 2318 * when length > kMaxLength. **/ | 2318 * when length > kMaxLength. **/ |
| 2319 static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromOneByte( | 2319 static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromOneByte( |
| 2320 Isolate* isolate, const uint8_t* data, v8::NewStringType type, | 2320 Isolate* isolate, const uint8_t* data, v8::NewStringType type, |
| 2321 int length = -1); | 2321 int length = -1); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2340 static Local<String> Concat(Local<String> left, Local<String> right); | 2340 static Local<String> Concat(Local<String> left, Local<String> right); |
| 2341 | 2341 |
| 2342 /** | 2342 /** |
| 2343 * Creates a new external string using the data defined in the given | 2343 * Creates a new external string using the data defined in the given |
| 2344 * resource. When the external string is no longer live on V8's heap the | 2344 * resource. When the external string is no longer live on V8's heap the |
| 2345 * resource will be disposed by calling its Dispose method. The caller of | 2345 * resource will be disposed by calling its Dispose method. The caller of |
| 2346 * this function should not otherwise delete or modify the resource. Neither | 2346 * this function should not otherwise delete or modify the resource. Neither |
| 2347 * should the underlying buffer be deallocated or modified except through the | 2347 * should the underlying buffer be deallocated or modified except through the |
| 2348 * destructor of the external string resource. | 2348 * destructor of the external string resource. |
| 2349 */ | 2349 */ |
| 2350 static V8_DEPRECATE_SOON( | 2350 static V8_DEPRECATED("Use maybe version", |
| 2351 "Use maybe version", | 2351 Local<String> NewExternal( |
| 2352 Local<String> NewExternal(Isolate* isolate, | 2352 Isolate* isolate, ExternalStringResource* resource)); |
| 2353 ExternalStringResource* resource)); | |
| 2354 static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewExternalTwoByte( | 2353 static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewExternalTwoByte( |
| 2355 Isolate* isolate, ExternalStringResource* resource); | 2354 Isolate* isolate, ExternalStringResource* resource); |
| 2356 | 2355 |
| 2357 /** | 2356 /** |
| 2358 * Associate an external string resource with this string by transforming it | 2357 * Associate an external string resource with this string by transforming it |
| 2359 * in place so that existing references to this string in the JavaScript heap | 2358 * in place so that existing references to this string in the JavaScript heap |
| 2360 * will use the external string resource. The external string resource's | 2359 * will use the external string resource. The external string resource's |
| 2361 * character contents need to be equivalent to this string. | 2360 * character contents need to be equivalent to this string. |
| 2362 * Returns true if the string has been changed to be an external string. | 2361 * Returns true if the string has been changed to be an external string. |
| 2363 * The string is not modified if the operation fails. See NewExternal for | 2362 * The string is not modified if the operation fails. See NewExternal for |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2660 PropertyAttribute attributes = None); | 2659 PropertyAttribute attributes = None); |
| 2661 | 2660 |
| 2662 // Sets an own property on this object bypassing interceptors and | 2661 // Sets an own property on this object bypassing interceptors and |
| 2663 // overriding accessors or read-only properties. | 2662 // overriding accessors or read-only properties. |
| 2664 // | 2663 // |
| 2665 // Note that if the object has an interceptor the property will be set | 2664 // Note that if the object has an interceptor the property will be set |
| 2666 // locally, but since the interceptor takes precedence the local property | 2665 // locally, but since the interceptor takes precedence the local property |
| 2667 // will only be returned if the interceptor doesn't return a value. | 2666 // will only be returned if the interceptor doesn't return a value. |
| 2668 // | 2667 // |
| 2669 // Note also that this only works for named properties. | 2668 // Note also that this only works for named properties. |
| 2670 V8_DEPRECATE_SOON("Use CreateDataProperty / DefineOwnProperty", | 2669 V8_DEPRECATED("Use CreateDataProperty / DefineOwnProperty", |
| 2671 bool ForceSet(Local<Value> key, Local<Value> value, | 2670 bool ForceSet(Local<Value> key, Local<Value> value, |
| 2672 PropertyAttribute attribs = None)); | 2671 PropertyAttribute attribs = None)); |
| 2673 V8_DEPRECATE_SOON("Use CreateDataProperty / DefineOwnProperty", | 2672 V8_DEPRECATED("Use CreateDataProperty / DefineOwnProperty", |
| 2674 Maybe<bool> ForceSet(Local<Context> context, | 2673 Maybe<bool> ForceSet(Local<Context> context, Local<Value> key, |
| 2675 Local<Value> key, Local<Value> value, | 2674 Local<Value> value, |
| 2676 PropertyAttribute attribs = None)); | 2675 PropertyAttribute attribs = None)); |
| 2677 | 2676 |
| 2678 V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key)); | 2677 V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key)); |
| 2679 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context, | 2678 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context, |
| 2680 Local<Value> key); | 2679 Local<Value> key); |
| 2681 | 2680 |
| 2682 V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(uint32_t index)); | 2681 V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(uint32_t index)); |
| 2683 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context, | 2682 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context, |
| 2684 uint32_t index); | 2683 uint32_t index); |
| 2685 | 2684 |
| 2686 /** | 2685 /** |
| 2687 * Gets the property attributes of a property which can be None or | 2686 * Gets the property attributes of a property which can be None or |
| 2688 * any combination of ReadOnly, DontEnum and DontDelete. Returns | 2687 * any combination of ReadOnly, DontEnum and DontDelete. Returns |
| 2689 * None when the property doesn't exist. | 2688 * None when the property doesn't exist. |
| 2690 */ | 2689 */ |
| 2691 V8_DEPRECATE_SOON("Use maybe version", | 2690 V8_DEPRECATED("Use maybe version", |
| 2692 PropertyAttribute GetPropertyAttributes(Local<Value> key)); | 2691 PropertyAttribute GetPropertyAttributes(Local<Value> key)); |
| 2693 V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetPropertyAttributes( | 2692 V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetPropertyAttributes( |
| 2694 Local<Context> context, Local<Value> key); | 2693 Local<Context> context, Local<Value> key); |
| 2695 | 2694 |
| 2696 /** | 2695 /** |
| 2697 * Returns Object.getOwnPropertyDescriptor as per ES5 section 15.2.3.3. | 2696 * Returns Object.getOwnPropertyDescriptor as per ES5 section 15.2.3.3. |
| 2698 */ | 2697 */ |
| 2699 V8_DEPRECATE_SOON("Use maybe version", | 2698 V8_DEPRECATED("Use maybe version", |
| 2700 Local<Value> GetOwnPropertyDescriptor(Local<String> key)); | 2699 Local<Value> GetOwnPropertyDescriptor(Local<String> key)); |
| 2701 V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetOwnPropertyDescriptor( | 2700 V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetOwnPropertyDescriptor( |
| 2702 Local<Context> context, Local<String> key); | 2701 Local<Context> context, Local<String> key); |
| 2703 | 2702 |
| 2704 V8_DEPRECATE_SOON("Use maybe version", bool Has(Local<Value> key)); | 2703 V8_DEPRECATE_SOON("Use maybe version", bool Has(Local<Value> key)); |
| 2705 V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, | 2704 V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, |
| 2706 Local<Value> key); | 2705 Local<Value> key); |
| 2707 | 2706 |
| 2708 V8_DEPRECATE_SOON("Use maybe version", bool Delete(Local<Value> key)); | 2707 V8_DEPRECATE_SOON("Use maybe version", bool Delete(Local<Value> key)); |
| 2709 // TODO(dcarney): mark V8_WARN_UNUSED_RESULT | 2708 // TODO(dcarney): mark V8_WARN_UNUSED_RESULT |
| 2710 Maybe<bool> Delete(Local<Context> context, Local<Value> key); | 2709 Maybe<bool> Delete(Local<Context> context, Local<Value> key); |
| 2711 | 2710 |
| 2712 V8_DEPRECATE_SOON("Use maybe version", bool Has(uint32_t index)); | 2711 V8_DEPRECATED("Use maybe version", bool Has(uint32_t index)); |
| 2713 V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index); | 2712 V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context, uint32_t index); |
| 2714 | 2713 |
| 2715 V8_DEPRECATE_SOON("Use maybe version", bool Delete(uint32_t index)); | 2714 V8_DEPRECATED("Use maybe version", bool Delete(uint32_t index)); |
| 2716 // TODO(dcarney): mark V8_WARN_UNUSED_RESULT | 2715 // TODO(dcarney): mark V8_WARN_UNUSED_RESULT |
| 2717 Maybe<bool> Delete(Local<Context> context, uint32_t index); | 2716 Maybe<bool> Delete(Local<Context> context, uint32_t index); |
| 2718 | 2717 |
| 2719 V8_DEPRECATE_SOON("Use maybe version", | 2718 V8_DEPRECATED("Use maybe version", |
| 2720 bool SetAccessor(Local<String> name, | 2719 bool SetAccessor(Local<String> name, |
| 2721 AccessorGetterCallback getter, | 2720 AccessorGetterCallback getter, |
| 2722 AccessorSetterCallback setter = 0, | 2721 AccessorSetterCallback setter = 0, |
| 2723 Local<Value> data = Local<Value>(), | 2722 Local<Value> data = Local<Value>(), |
| 2724 AccessControl settings = DEFAULT, | 2723 AccessControl settings = DEFAULT, |
| 2725 PropertyAttribute attribute = None)); | 2724 PropertyAttribute attribute = None)); |
| 2726 V8_DEPRECATE_SOON("Use maybe version", | 2725 V8_DEPRECATED("Use maybe version", |
| 2727 bool SetAccessor(Local<Name> name, | 2726 bool SetAccessor(Local<Name> name, |
| 2728 AccessorNameGetterCallback getter, | 2727 AccessorNameGetterCallback getter, |
| 2729 AccessorNameSetterCallback setter = 0, | 2728 AccessorNameSetterCallback setter = 0, |
| 2730 Local<Value> data = Local<Value>(), | 2729 Local<Value> data = Local<Value>(), |
| 2731 AccessControl settings = DEFAULT, | 2730 AccessControl settings = DEFAULT, |
| 2732 PropertyAttribute attribute = None)); | 2731 PropertyAttribute attribute = None)); |
| 2733 // TODO(dcarney): mark V8_WARN_UNUSED_RESULT | 2732 // TODO(dcarney): mark V8_WARN_UNUSED_RESULT |
| 2734 Maybe<bool> SetAccessor(Local<Context> context, Local<Name> name, | 2733 Maybe<bool> SetAccessor(Local<Context> context, Local<Name> name, |
| 2735 AccessorNameGetterCallback getter, | 2734 AccessorNameGetterCallback getter, |
| 2736 AccessorNameSetterCallback setter = 0, | 2735 AccessorNameSetterCallback setter = 0, |
| 2737 MaybeLocal<Value> data = MaybeLocal<Value>(), | 2736 MaybeLocal<Value> data = MaybeLocal<Value>(), |
| 2738 AccessControl settings = DEFAULT, | 2737 AccessControl settings = DEFAULT, |
| 2739 PropertyAttribute attribute = None); | 2738 PropertyAttribute attribute = None); |
| 2740 | 2739 |
| 2741 void SetAccessorProperty(Local<Name> name, Local<Function> getter, | 2740 void SetAccessorProperty(Local<Name> name, Local<Function> getter, |
| 2742 Local<Function> setter = Local<Function>(), | 2741 Local<Function> setter = Local<Function>(), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2779 * be skipped by __proto__ and it does not consult the security | 2778 * be skipped by __proto__ and it does not consult the security |
| 2780 * handler. | 2779 * handler. |
| 2781 */ | 2780 */ |
| 2782 Local<Value> GetPrototype(); | 2781 Local<Value> GetPrototype(); |
| 2783 | 2782 |
| 2784 /** | 2783 /** |
| 2785 * Set the prototype object. This does not skip objects marked to | 2784 * Set the prototype object. This does not skip objects marked to |
| 2786 * be skipped by __proto__ and it does not consult the security | 2785 * be skipped by __proto__ and it does not consult the security |
| 2787 * handler. | 2786 * handler. |
| 2788 */ | 2787 */ |
| 2789 V8_DEPRECATE_SOON("Use maybe version", | 2788 V8_DEPRECATED("Use maybe version", bool SetPrototype(Local<Value> prototype)); |
| 2790 bool SetPrototype(Local<Value> prototype)); | |
| 2791 V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototype(Local<Context> context, | 2789 V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototype(Local<Context> context, |
| 2792 Local<Value> prototype); | 2790 Local<Value> prototype); |
| 2793 | 2791 |
| 2794 /** | 2792 /** |
| 2795 * Finds an instance of the given function template in the prototype | 2793 * Finds an instance of the given function template in the prototype |
| 2796 * chain. | 2794 * chain. |
| 2797 */ | 2795 */ |
| 2798 Local<Object> FindInstanceInPrototypeChain(Local<FunctionTemplate> tmpl); | 2796 Local<Object> FindInstanceInPrototypeChain(Local<FunctionTemplate> tmpl); |
| 2799 | 2797 |
| 2800 /** | 2798 /** |
| 2801 * Call builtin Object.prototype.toString on this object. | 2799 * Call builtin Object.prototype.toString on this object. |
| 2802 * This is different from Value::ToString() that may call | 2800 * This is different from Value::ToString() that may call |
| 2803 * user-defined toString function. This one does not. | 2801 * user-defined toString function. This one does not. |
| 2804 */ | 2802 */ |
| 2805 V8_DEPRECATE_SOON("Use maybe version", Local<String> ObjectProtoToString()); | 2803 V8_DEPRECATED("Use maybe version", Local<String> ObjectProtoToString()); |
| 2806 V8_WARN_UNUSED_RESULT MaybeLocal<String> ObjectProtoToString( | 2804 V8_WARN_UNUSED_RESULT MaybeLocal<String> ObjectProtoToString( |
| 2807 Local<Context> context); | 2805 Local<Context> context); |
| 2808 | 2806 |
| 2809 /** | 2807 /** |
| 2810 * Returns the name of the function invoked as a constructor for this object. | 2808 * Returns the name of the function invoked as a constructor for this object. |
| 2811 */ | 2809 */ |
| 2812 Local<String> GetConstructorName(); | 2810 Local<String> GetConstructorName(); |
| 2813 | 2811 |
| 2814 /** Gets the number of internal fields for this Object. */ | 2812 /** Gets the number of internal fields for this Object. */ |
| 2815 int InternalFieldCount(); | 2813 int InternalFieldCount(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2840 } | 2838 } |
| 2841 | 2839 |
| 2842 /** | 2840 /** |
| 2843 * Sets a 2-byte-aligned native pointer in an internal field. To retrieve such | 2841 * Sets a 2-byte-aligned native pointer in an internal field. To retrieve such |
| 2844 * a field, GetAlignedPointerFromInternalField must be used, everything else | 2842 * a field, GetAlignedPointerFromInternalField must be used, everything else |
| 2845 * leads to undefined behavior. | 2843 * leads to undefined behavior. |
| 2846 */ | 2844 */ |
| 2847 void SetAlignedPointerInInternalField(int index, void* value); | 2845 void SetAlignedPointerInInternalField(int index, void* value); |
| 2848 | 2846 |
| 2849 // Testers for local properties. | 2847 // Testers for local properties. |
| 2850 V8_DEPRECATE_SOON("Use maybe version", | 2848 V8_DEPRECATED("Use maybe version", bool HasOwnProperty(Local<String> key)); |
| 2851 bool HasOwnProperty(Local<String> key)); | |
| 2852 V8_WARN_UNUSED_RESULT Maybe<bool> HasOwnProperty(Local<Context> context, | 2849 V8_WARN_UNUSED_RESULT Maybe<bool> HasOwnProperty(Local<Context> context, |
| 2853 Local<Name> key); | 2850 Local<Name> key); |
| 2854 V8_DEPRECATE_SOON("Use maybe version", | 2851 V8_DEPRECATE_SOON("Use maybe version", |
| 2855 bool HasRealNamedProperty(Local<String> key)); | 2852 bool HasRealNamedProperty(Local<String> key)); |
| 2856 V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedProperty(Local<Context> context, | 2853 V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedProperty(Local<Context> context, |
| 2857 Local<Name> key); | 2854 Local<Name> key); |
| 2858 V8_DEPRECATE_SOON("Use maybe version", | 2855 V8_DEPRECATE_SOON("Use maybe version", |
| 2859 bool HasRealIndexedProperty(uint32_t index)); | 2856 bool HasRealIndexedProperty(uint32_t index)); |
| 2860 V8_WARN_UNUSED_RESULT Maybe<bool> HasRealIndexedProperty( | 2857 V8_WARN_UNUSED_RESULT Maybe<bool> HasRealIndexedProperty( |
| 2861 Local<Context> context, uint32_t index); | 2858 Local<Context> context, uint32_t index); |
| 2862 V8_DEPRECATE_SOON("Use maybe version", | 2859 V8_DEPRECATE_SOON("Use maybe version", |
| 2863 bool HasRealNamedCallbackProperty(Local<String> key)); | 2860 bool HasRealNamedCallbackProperty(Local<String> key)); |
| 2864 V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedCallbackProperty( | 2861 V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedCallbackProperty( |
| 2865 Local<Context> context, Local<Name> key); | 2862 Local<Context> context, Local<Name> key); |
| 2866 | 2863 |
| 2867 /** | 2864 /** |
| 2868 * If result.IsEmpty() no real property was located in the prototype chain. | 2865 * If result.IsEmpty() no real property was located in the prototype chain. |
| 2869 * This means interceptors in the prototype chain are not called. | 2866 * This means interceptors in the prototype chain are not called. |
| 2870 */ | 2867 */ |
| 2871 V8_DEPRECATE_SOON( | 2868 V8_DEPRECATED( |
| 2872 "Use maybe version", | 2869 "Use maybe version", |
| 2873 Local<Value> GetRealNamedPropertyInPrototypeChain(Local<String> key)); | 2870 Local<Value> GetRealNamedPropertyInPrototypeChain(Local<String> key)); |
| 2874 V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedPropertyInPrototypeChain( | 2871 V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedPropertyInPrototypeChain( |
| 2875 Local<Context> context, Local<Name> key); | 2872 Local<Context> context, Local<Name> key); |
| 2876 | 2873 |
| 2877 /** | 2874 /** |
| 2878 * Gets the property attributes of a real property in the prototype chain, | 2875 * Gets the property attributes of a real property in the prototype chain, |
| 2879 * which can be None or any combination of ReadOnly, DontEnum and DontDelete. | 2876 * which can be None or any combination of ReadOnly, DontEnum and DontDelete. |
| 2880 * Interceptors in the prototype chain are not called. | 2877 * Interceptors in the prototype chain are not called. |
| 2881 */ | 2878 */ |
| 2882 V8_DEPRECATE_SOON( | 2879 V8_DEPRECATED( |
| 2883 "Use maybe version", | 2880 "Use maybe version", |
| 2884 Maybe<PropertyAttribute> GetRealNamedPropertyAttributesInPrototypeChain( | 2881 Maybe<PropertyAttribute> GetRealNamedPropertyAttributesInPrototypeChain( |
| 2885 Local<String> key)); | 2882 Local<String> key)); |
| 2886 V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> | 2883 V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> |
| 2887 GetRealNamedPropertyAttributesInPrototypeChain(Local<Context> context, | 2884 GetRealNamedPropertyAttributesInPrototypeChain(Local<Context> context, |
| 2888 Local<Name> key); | 2885 Local<Name> key); |
| 2889 | 2886 |
| 2890 /** | 2887 /** |
| 2891 * If result.IsEmpty() no real property was located on the object or | 2888 * If result.IsEmpty() no real property was located on the object or |
| 2892 * in the prototype chain. | 2889 * in the prototype chain. |
| 2893 * This means interceptors in the prototype chain are not called. | 2890 * This means interceptors in the prototype chain are not called. |
| 2894 */ | 2891 */ |
| 2895 V8_DEPRECATE_SOON("Use maybe version", | 2892 V8_DEPRECATED("Use maybe version", |
| 2896 Local<Value> GetRealNamedProperty(Local<String> key)); | 2893 Local<Value> GetRealNamedProperty(Local<String> key)); |
| 2897 V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty( | 2894 V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty( |
| 2898 Local<Context> context, Local<Name> key); | 2895 Local<Context> context, Local<Name> key); |
| 2899 | 2896 |
| 2900 /** | 2897 /** |
| 2901 * Gets the property attributes of a real property which can be | 2898 * Gets the property attributes of a real property which can be |
| 2902 * None or any combination of ReadOnly, DontEnum and DontDelete. | 2899 * None or any combination of ReadOnly, DontEnum and DontDelete. |
| 2903 * Interceptors in the prototype chain are not called. | 2900 * Interceptors in the prototype chain are not called. |
| 2904 */ | 2901 */ |
| 2905 V8_DEPRECATE_SOON("Use maybe version", | 2902 V8_DEPRECATED("Use maybe version", |
| 2906 Maybe<PropertyAttribute> GetRealNamedPropertyAttributes( | 2903 Maybe<PropertyAttribute> GetRealNamedPropertyAttributes( |
| 2907 Local<String> key)); | 2904 Local<String> key)); |
| 2908 V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetRealNamedPropertyAttributes( | 2905 V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetRealNamedPropertyAttributes( |
| 2909 Local<Context> context, Local<Name> key); | 2906 Local<Context> context, Local<Name> key); |
| 2910 | 2907 |
| 2911 /** Tests for a named lookup interceptor.*/ | 2908 /** Tests for a named lookup interceptor.*/ |
| 2912 bool HasNamedLookupInterceptor(); | 2909 bool HasNamedLookupInterceptor(); |
| 2913 | 2910 |
| 2914 /** Tests for an index lookup interceptor.*/ | 2911 /** Tests for an index lookup interceptor.*/ |
| 2915 bool HasIndexedLookupInterceptor(); | 2912 bool HasIndexedLookupInterceptor(); |
| 2916 | 2913 |
| 2917 /** | 2914 /** |
| (...skipping 28 matching lines...) Expand all Loading... |
| 2946 * Checks whether a callback is set by the | 2943 * Checks whether a callback is set by the |
| 2947 * ObjectTemplate::SetCallAsFunctionHandler method. | 2944 * ObjectTemplate::SetCallAsFunctionHandler method. |
| 2948 * When an Object is callable this method returns true. | 2945 * When an Object is callable this method returns true. |
| 2949 */ | 2946 */ |
| 2950 bool IsCallable(); | 2947 bool IsCallable(); |
| 2951 | 2948 |
| 2952 /** | 2949 /** |
| 2953 * Call an Object as a function if a callback is set by the | 2950 * Call an Object as a function if a callback is set by the |
| 2954 * ObjectTemplate::SetCallAsFunctionHandler method. | 2951 * ObjectTemplate::SetCallAsFunctionHandler method. |
| 2955 */ | 2952 */ |
| 2956 V8_DEPRECATE_SOON("Use maybe version", | 2953 V8_DEPRECATED("Use maybe version", |
| 2957 Local<Value> CallAsFunction(Local<Value> recv, int argc, | 2954 Local<Value> CallAsFunction(Local<Value> recv, int argc, |
| 2958 Local<Value> argv[])); | 2955 Local<Value> argv[])); |
| 2959 V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsFunction(Local<Context> context, | 2956 V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsFunction(Local<Context> context, |
| 2960 Local<Value> recv, | 2957 Local<Value> recv, |
| 2961 int argc, | 2958 int argc, |
| 2962 Local<Value> argv[]); | 2959 Local<Value> argv[]); |
| 2963 | 2960 |
| 2964 /** | 2961 /** |
| 2965 * Call an Object as a constructor if a callback is set by the | 2962 * Call an Object as a constructor if a callback is set by the |
| 2966 * ObjectTemplate::SetCallAsFunctionHandler method. | 2963 * ObjectTemplate::SetCallAsFunctionHandler method. |
| 2967 * Note: This method behaves like the Function::NewInstance method. | 2964 * Note: This method behaves like the Function::NewInstance method. |
| 2968 */ | 2965 */ |
| 2969 V8_DEPRECATE_SOON("Use maybe version", | 2966 V8_DEPRECATED("Use maybe version", |
| 2970 Local<Value> CallAsConstructor(int argc, | 2967 Local<Value> CallAsConstructor(int argc, Local<Value> argv[])); |
| 2971 Local<Value> argv[])); | |
| 2972 V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsConstructor( | 2968 V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsConstructor( |
| 2973 Local<Context> context, int argc, Local<Value> argv[]); | 2969 Local<Context> context, int argc, Local<Value> argv[]); |
| 2974 | 2970 |
| 2975 /** | 2971 /** |
| 2976 * Return the isolate to which the Object belongs to. | 2972 * Return the isolate to which the Object belongs to. |
| 2977 */ | 2973 */ |
| 2978 V8_DEPRECATE_SOON("Keep track of isolate correctly", Isolate* GetIsolate()); | 2974 V8_DEPRECATE_SOON("Keep track of isolate correctly", Isolate* GetIsolate()); |
| 2979 | 2975 |
| 2980 static Local<Object> New(Isolate* isolate); | 2976 static Local<Object> New(Isolate* isolate); |
| 2981 | 2977 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3219 */ | 3215 */ |
| 3220 static MaybeLocal<Function> New(Local<Context> context, | 3216 static MaybeLocal<Function> New(Local<Context> context, |
| 3221 FunctionCallback callback, | 3217 FunctionCallback callback, |
| 3222 Local<Value> data = Local<Value>(), | 3218 Local<Value> data = Local<Value>(), |
| 3223 int length = 0); | 3219 int length = 0); |
| 3224 static V8_DEPRECATE_SOON( | 3220 static V8_DEPRECATE_SOON( |
| 3225 "Use maybe version", | 3221 "Use maybe version", |
| 3226 Local<Function> New(Isolate* isolate, FunctionCallback callback, | 3222 Local<Function> New(Isolate* isolate, FunctionCallback callback, |
| 3227 Local<Value> data = Local<Value>(), int length = 0)); | 3223 Local<Value> data = Local<Value>(), int length = 0)); |
| 3228 | 3224 |
| 3229 V8_DEPRECATE_SOON("Use maybe version", | 3225 V8_DEPRECATED("Use maybe version", |
| 3230 Local<Object> NewInstance(int argc, Local<Value> argv[]) | 3226 Local<Object> NewInstance(int argc, Local<Value> argv[]) const); |
| 3231 const); | |
| 3232 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( | 3227 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( |
| 3233 Local<Context> context, int argc, Local<Value> argv[]) const; | 3228 Local<Context> context, int argc, Local<Value> argv[]) const; |
| 3234 | 3229 |
| 3235 V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance() const); | 3230 V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const); |
| 3236 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( | 3231 V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance( |
| 3237 Local<Context> context) const { | 3232 Local<Context> context) const { |
| 3238 return NewInstance(context, 0, nullptr); | 3233 return NewInstance(context, 0, nullptr); |
| 3239 } | 3234 } |
| 3240 | 3235 |
| 3241 V8_DEPRECATE_SOON("Use maybe version", | 3236 V8_DEPRECATE_SOON("Use maybe version", |
| 3242 Local<Value> Call(Local<Value> recv, int argc, | 3237 Local<Value> Call(Local<Value> recv, int argc, |
| 3243 Local<Value> argv[])); | 3238 Local<Value> argv[])); |
| 3244 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, | 3239 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context, |
| 3245 Local<Value> recv, int argc, | 3240 Local<Value> recv, int argc, |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3344 Resolver(); | 3339 Resolver(); |
| 3345 static void CheckCast(Value* obj); | 3340 static void CheckCast(Value* obj); |
| 3346 }; | 3341 }; |
| 3347 | 3342 |
| 3348 /** | 3343 /** |
| 3349 * Register a resolution/rejection handler with a promise. | 3344 * Register a resolution/rejection handler with a promise. |
| 3350 * The handler is given the respective resolution/rejection value as | 3345 * The handler is given the respective resolution/rejection value as |
| 3351 * an argument. If the promise is already resolved/rejected, the handler is | 3346 * an argument. If the promise is already resolved/rejected, the handler is |
| 3352 * invoked at the end of turn. | 3347 * invoked at the end of turn. |
| 3353 */ | 3348 */ |
| 3354 V8_DEPRECATE_SOON("Use maybe version of Then", | 3349 V8_DEPRECATED("Use maybe version of Then", |
| 3355 Local<Promise> Chain(Local<Function> handler)); | 3350 Local<Promise> Chain(Local<Function> handler)); |
| 3356 V8_DEPRECATE_SOON("Use Then", | 3351 V8_DEPRECATED("Use Then", |
| 3357 V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Chain( | 3352 V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Chain( |
| 3358 Local<Context> context, Local<Function> handler)); | 3353 Local<Context> context, Local<Function> handler)); |
| 3359 | 3354 |
| 3360 V8_DEPRECATE_SOON("Use maybe version", | 3355 V8_DEPRECATED("Use maybe version", |
| 3361 Local<Promise> Catch(Local<Function> handler)); | 3356 Local<Promise> Catch(Local<Function> handler)); |
| 3362 V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Catch(Local<Context> context, | 3357 V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Catch(Local<Context> context, |
| 3363 Local<Function> handler); | 3358 Local<Function> handler); |
| 3364 | 3359 |
| 3365 V8_DEPRECATE_SOON("Use maybe version", | 3360 V8_DEPRECATED("Use maybe version", |
| 3366 Local<Promise> Then(Local<Function> handler)); | 3361 Local<Promise> Then(Local<Function> handler)); |
| 3367 V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Then(Local<Context> context, | 3362 V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Then(Local<Context> context, |
| 3368 Local<Function> handler); | 3363 Local<Function> handler); |
| 3369 | 3364 |
| 3370 /** | 3365 /** |
| 3371 * Returns true if the promise has at least one derived promise, and | 3366 * Returns true if the promise has at least one derived promise, and |
| 3372 * therefore resolve/reject handlers (including default handler). | 3367 * therefore resolve/reject handlers (including default handler). |
| 3373 */ | 3368 */ |
| 3374 bool HasHandler(); | 3369 bool HasHandler(); |
| 3375 | 3370 |
| 3376 V8_INLINE static Promise* Cast(Value* obj); | 3371 V8_INLINE static Promise* Cast(Value* obj); |
| (...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4717 * Sets access check callback on the object template and enables access | 4712 * Sets access check callback on the object template and enables access |
| 4718 * checks. | 4713 * checks. |
| 4719 * | 4714 * |
| 4720 * When accessing properties on instances of this object template, | 4715 * When accessing properties on instances of this object template, |
| 4721 * the access check callback will be called to determine whether or | 4716 * the access check callback will be called to determine whether or |
| 4722 * not to allow cross-context access to the properties. | 4717 * not to allow cross-context access to the properties. |
| 4723 */ | 4718 */ |
| 4724 void SetAccessCheckCallback(AccessCheckCallback callback, | 4719 void SetAccessCheckCallback(AccessCheckCallback callback, |
| 4725 Local<Value> data = Local<Value>()); | 4720 Local<Value> data = Local<Value>()); |
| 4726 | 4721 |
| 4727 V8_DEPRECATE_SOON( | 4722 V8_DEPRECATED( |
| 4728 "Use SetAccessCheckCallback instead", | 4723 "Use SetAccessCheckCallback instead", |
| 4729 void SetAccessCheckCallbacks(NamedSecurityCallback named_handler, | 4724 void SetAccessCheckCallbacks(NamedSecurityCallback named_handler, |
| 4730 IndexedSecurityCallback indexed_handler, | 4725 IndexedSecurityCallback indexed_handler, |
| 4731 Local<Value> data = Local<Value>())); | 4726 Local<Value> data = Local<Value>())); |
| 4732 | 4727 |
| 4733 /** | 4728 /** |
| 4734 * Gets the number of internal fields for objects generated from | 4729 * Gets the number of internal fields for objects generated from |
| 4735 * this template. | 4730 * this template. |
| 4736 */ | 4731 */ |
| 4737 int InternalFieldCount(); | 4732 int InternalFieldCount(); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4918 static Local<Value> SyntaxError(Local<String> message); | 4913 static Local<Value> SyntaxError(Local<String> message); |
| 4919 static Local<Value> TypeError(Local<String> message); | 4914 static Local<Value> TypeError(Local<String> message); |
| 4920 static Local<Value> Error(Local<String> message); | 4915 static Local<Value> Error(Local<String> message); |
| 4921 | 4916 |
| 4922 /** | 4917 /** |
| 4923 * Creates an error message for the given exception. | 4918 * Creates an error message for the given exception. |
| 4924 * Will try to reconstruct the original stack trace from the exception value, | 4919 * Will try to reconstruct the original stack trace from the exception value, |
| 4925 * or capture the current stack trace if not available. | 4920 * or capture the current stack trace if not available. |
| 4926 */ | 4921 */ |
| 4927 static Local<Message> CreateMessage(Isolate* isolate, Local<Value> exception); | 4922 static Local<Message> CreateMessage(Isolate* isolate, Local<Value> exception); |
| 4928 V8_DEPRECATE_SOON( | 4923 V8_DEPRECATED("Use version with an Isolate*", |
| 4929 "Use version with an Isolate*", | 4924 static Local<Message> CreateMessage(Local<Value> exception)); |
| 4930 static Local<Message> CreateMessage(Local<Value> exception)); | |
| 4931 | 4925 |
| 4932 /** | 4926 /** |
| 4933 * Returns the original stack trace that was captured at the creation time | 4927 * Returns the original stack trace that was captured at the creation time |
| 4934 * of a given exception, or an empty handle if not available. | 4928 * of a given exception, or an empty handle if not available. |
| 4935 */ | 4929 */ |
| 4936 static Local<StackTrace> GetStackTrace(Local<Value> exception); | 4930 static Local<StackTrace> GetStackTrace(Local<Value> exception); |
| 4937 }; | 4931 }; |
| 4938 | 4932 |
| 4939 | 4933 |
| 4940 // --- Counters Callbacks --- | 4934 // --- Counters Callbacks --- |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5040 kGCTypeIncrementalMarking | kGCTypeProcessWeakCallbacks | 5034 kGCTypeIncrementalMarking | kGCTypeProcessWeakCallbacks |
| 5041 }; | 5035 }; |
| 5042 | 5036 |
| 5043 enum GCCallbackFlags { | 5037 enum GCCallbackFlags { |
| 5044 kNoGCCallbackFlags = 0, | 5038 kNoGCCallbackFlags = 0, |
| 5045 kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1, | 5039 kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1, |
| 5046 kGCCallbackFlagForced = 1 << 2, | 5040 kGCCallbackFlagForced = 1 << 2, |
| 5047 kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3 | 5041 kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3 |
| 5048 }; | 5042 }; |
| 5049 | 5043 |
| 5050 V8_DEPRECATE_SOON("Use GCCallBack instead", | |
| 5051 typedef void (*GCPrologueCallback)(GCType type, | |
| 5052 GCCallbackFlags flags)); | |
| 5053 V8_DEPRECATE_SOON("Use GCCallBack instead", | |
| 5054 typedef void (*GCEpilogueCallback)(GCType type, | |
| 5055 GCCallbackFlags flags)); | |
| 5056 typedef void (*GCCallback)(GCType type, GCCallbackFlags flags); | 5044 typedef void (*GCCallback)(GCType type, GCCallbackFlags flags); |
| 5057 | 5045 |
| 5058 typedef void (*InterruptCallback)(Isolate* isolate, void* data); | 5046 typedef void (*InterruptCallback)(Isolate* isolate, void* data); |
| 5059 | 5047 |
| 5060 | 5048 |
| 5061 /** | 5049 /** |
| 5062 * Collection of V8 heap information. | 5050 * Collection of V8 heap information. |
| 5063 * | 5051 * |
| 5064 * Instances of this class can be passed to v8::V8::HeapStatistics to | 5052 * Instances of this class can be passed to v8::V8::HeapStatistics to |
| 5065 * get heap statistics from V8. | 5053 * get heap statistics from V8. |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5655 | 5643 |
| 5656 /** | 5644 /** |
| 5657 * Allows the host application to declare implicit references from an object | 5645 * Allows the host application to declare implicit references from an object |
| 5658 * to another object. If the parent object is alive, the child object is alive | 5646 * to another object. If the parent object is alive, the child object is alive |
| 5659 * too. After each garbage collection, all implicit references are removed. It | 5647 * too. After each garbage collection, all implicit references are removed. It |
| 5660 * is intended to be used in the before-garbage-collection callback function. | 5648 * is intended to be used in the before-garbage-collection callback function. |
| 5661 */ | 5649 */ |
| 5662 template<typename T, typename S> | 5650 template<typename T, typename S> |
| 5663 void SetReference(const Persistent<T>& parent, const Persistent<S>& child); | 5651 void SetReference(const Persistent<T>& parent, const Persistent<S>& child); |
| 5664 | 5652 |
| 5665 V8_DEPRECATE_SOON("Use GCCallBack instead", | |
| 5666 typedef void (*GCPrologueCallback)(Isolate* isolate, | |
| 5667 GCType type, | |
| 5668 GCCallbackFlags flags)); | |
| 5669 V8_DEPRECATE_SOON("Use GCCallBack instead", | |
| 5670 typedef void (*GCEpilogueCallback)(Isolate* isolate, | |
| 5671 GCType type, | |
| 5672 GCCallbackFlags flags)); | |
| 5673 typedef void (*GCCallback)(Isolate* isolate, GCType type, | 5653 typedef void (*GCCallback)(Isolate* isolate, GCType type, |
| 5674 GCCallbackFlags flags); | 5654 GCCallbackFlags flags); |
| 5675 | 5655 |
| 5676 /** | 5656 /** |
| 5677 * Enables the host application to receive a notification before a | 5657 * Enables the host application to receive a notification before a |
| 5678 * garbage collection. Allocations are allowed in the callback function, | 5658 * garbage collection. Allocations are allowed in the callback function, |
| 5679 * but the callback is not re-entrant: if the allocation inside it will | 5659 * but the callback is not re-entrant: if the allocation inside it will |
| 5680 * trigger the garbage collection, the callback won't be called again. | 5660 * trigger the garbage collection, the callback won't be called again. |
| 5681 * It is possible to specify the GCType filter for your callback. But it is | 5661 * It is possible to specify the GCType filter for your callback. But it is |
| 5682 * not possible to register the same callback function two times with | 5662 * not possible to register the same callback function two times with |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5849 * as much cleanup as it will be able to do. | 5829 * as much cleanup as it will be able to do. |
| 5850 * | 5830 * |
| 5851 * The deadline_in_seconds argument specifies the deadline V8 has to finish | 5831 * The deadline_in_seconds argument specifies the deadline V8 has to finish |
| 5852 * garbage collection work. deadline_in_seconds is compared with | 5832 * garbage collection work. deadline_in_seconds is compared with |
| 5853 * MonotonicallyIncreasingTime() and should be based on the same timebase as | 5833 * MonotonicallyIncreasingTime() and should be based on the same timebase as |
| 5854 * that function. There is no guarantee that the actual work will be done | 5834 * that function. There is no guarantee that the actual work will be done |
| 5855 * within the time limit. | 5835 * within the time limit. |
| 5856 */ | 5836 */ |
| 5857 bool IdleNotificationDeadline(double deadline_in_seconds); | 5837 bool IdleNotificationDeadline(double deadline_in_seconds); |
| 5858 | 5838 |
| 5859 V8_DEPRECATE_SOON("use IdleNotificationDeadline()", | 5839 V8_DEPRECATED("use IdleNotificationDeadline()", |
| 5860 bool IdleNotification(int idle_time_in_ms)); | 5840 bool IdleNotification(int idle_time_in_ms)); |
| 5861 | 5841 |
| 5862 /** | 5842 /** |
| 5863 * Optional notification that the system is running low on memory. | 5843 * Optional notification that the system is running low on memory. |
| 5864 * V8 uses these notifications to attempt to free memory. | 5844 * V8 uses these notifications to attempt to free memory. |
| 5865 */ | 5845 */ |
| 5866 void LowMemoryNotification(); | 5846 void LowMemoryNotification(); |
| 5867 | 5847 |
| 5868 /** | 5848 /** |
| 5869 * Optional notification that a context has been disposed. V8 uses | 5849 * Optional notification that a context has been disposed. V8 uses |
| 5870 * these notifications to guide the GC heuristic. Returns the number | 5850 * these notifications to guide the GC heuristic. Returns the number |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6071 typedef uintptr_t (*ReturnAddressLocationResolver)( | 6051 typedef uintptr_t (*ReturnAddressLocationResolver)( |
| 6072 uintptr_t return_addr_location); | 6052 uintptr_t return_addr_location); |
| 6073 | 6053 |
| 6074 | 6054 |
| 6075 /** | 6055 /** |
| 6076 * Container class for static utility functions. | 6056 * Container class for static utility functions. |
| 6077 */ | 6057 */ |
| 6078 class V8_EXPORT V8 { | 6058 class V8_EXPORT V8 { |
| 6079 public: | 6059 public: |
| 6080 /** Set the callback to invoke in case of fatal errors. */ | 6060 /** Set the callback to invoke in case of fatal errors. */ |
| 6081 V8_INLINE static V8_DEPRECATE_SOON( | 6061 V8_INLINE static V8_DEPRECATED( |
| 6082 "Use isolate version", | 6062 "Use isolate version", |
| 6083 void SetFatalErrorHandler(FatalErrorCallback that)); | 6063 void SetFatalErrorHandler(FatalErrorCallback that)); |
| 6084 | 6064 |
| 6085 /** | 6065 /** |
| 6086 * Set the callback to invoke to check if code generation from | 6066 * Set the callback to invoke to check if code generation from |
| 6087 * strings should be allowed. | 6067 * strings should be allowed. |
| 6088 */ | 6068 */ |
| 6089 V8_INLINE static V8_DEPRECATE_SOON( | 6069 V8_INLINE static V8_DEPRECATED( |
| 6090 "Use isolate version", void SetAllowCodeGenerationFromStringsCallback( | 6070 "Use isolate version", void SetAllowCodeGenerationFromStringsCallback( |
| 6091 AllowCodeGenerationFromStringsCallback that)); | 6071 AllowCodeGenerationFromStringsCallback that)); |
| 6092 | 6072 |
| 6093 /** | 6073 /** |
| 6094 * Check if V8 is dead and therefore unusable. This is the case after | 6074 * Check if V8 is dead and therefore unusable. This is the case after |
| 6095 * fatal errors such as out-of-memory situations. | 6075 * fatal errors such as out-of-memory situations. |
| 6096 */ | 6076 */ |
| 6097 V8_INLINE static V8_DEPRECATE_SOON("no alternative", bool IsDead()); | 6077 V8_INLINE static V8_DEPRECATED("Use isolate version", bool IsDead()); |
| 6098 | 6078 |
| 6099 /** | 6079 /** |
| 6100 * Hand startup data to V8, in case the embedder has chosen to build | 6080 * Hand startup data to V8, in case the embedder has chosen to build |
| 6101 * V8 with external startup data. | 6081 * V8 with external startup data. |
| 6102 * | 6082 * |
| 6103 * Note: | 6083 * Note: |
| 6104 * - By default the startup data is linked into the V8 library, in which | 6084 * - By default the startup data is linked into the V8 library, in which |
| 6105 * case this function is not meaningful. | 6085 * case this function is not meaningful. |
| 6106 * - If this needs to be called, it needs to be called before V8 | 6086 * - If this needs to be called, it needs to be called before V8 |
| 6107 * tries to make use of its built-ins. | 6087 * tries to make use of its built-ins. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 6123 | 6103 |
| 6124 /** | 6104 /** |
| 6125 * Adds a message listener. | 6105 * Adds a message listener. |
| 6126 * | 6106 * |
| 6127 * The same message listener can be added more than once and in that | 6107 * The same message listener can be added more than once and in that |
| 6128 * case it will be called more than once for each message. | 6108 * case it will be called more than once for each message. |
| 6129 * | 6109 * |
| 6130 * If data is specified, it will be passed to the callback when it is called. | 6110 * If data is specified, it will be passed to the callback when it is called. |
| 6131 * Otherwise, the exception object will be passed to the callback instead. | 6111 * Otherwise, the exception object will be passed to the callback instead. |
| 6132 */ | 6112 */ |
| 6133 V8_INLINE static V8_DEPRECATE_SOON( | 6113 V8_INLINE static V8_DEPRECATED( |
| 6134 "Use isolate version", | 6114 "Use isolate version", |
| 6135 bool AddMessageListener(MessageCallback that, | 6115 bool AddMessageListener(MessageCallback that, |
| 6136 Local<Value> data = Local<Value>())); | 6116 Local<Value> data = Local<Value>())); |
| 6137 | 6117 |
| 6138 /** | 6118 /** |
| 6139 * Remove all message listeners from the specified callback function. | 6119 * Remove all message listeners from the specified callback function. |
| 6140 */ | 6120 */ |
| 6141 V8_INLINE static V8_DEPRECATE_SOON( | 6121 V8_INLINE static V8_DEPRECATED( |
| 6142 "Use isolate version", void RemoveMessageListeners(MessageCallback that)); | 6122 "Use isolate version", void RemoveMessageListeners(MessageCallback that)); |
| 6143 | 6123 |
| 6144 /** | 6124 /** |
| 6145 * Tells V8 to capture current stack trace when uncaught exception occurs | 6125 * Tells V8 to capture current stack trace when uncaught exception occurs |
| 6146 * and report it to the message listeners. The option is off by default. | 6126 * and report it to the message listeners. The option is off by default. |
| 6147 */ | 6127 */ |
| 6148 V8_INLINE static V8_DEPRECATE_SOON( | 6128 V8_INLINE static V8_DEPRECATED( |
| 6149 "Use isolate version", | 6129 "Use isolate version", |
| 6150 void SetCaptureStackTraceForUncaughtExceptions( | 6130 void SetCaptureStackTraceForUncaughtExceptions( |
| 6151 bool capture, int frame_limit = 10, | 6131 bool capture, int frame_limit = 10, |
| 6152 StackTrace::StackTraceOptions options = StackTrace::kOverview)); | 6132 StackTrace::StackTraceOptions options = StackTrace::kOverview)); |
| 6153 | 6133 |
| 6154 /** | 6134 /** |
| 6155 * Sets V8 flags from a string. | 6135 * Sets V8 flags from a string. |
| 6156 */ | 6136 */ |
| 6157 static void SetFlagsFromString(const char* str, int length); | 6137 static void SetFlagsFromString(const char* str, int length); |
| 6158 | 6138 |
| 6159 /** | 6139 /** |
| 6160 * Sets V8 flags from the command line. | 6140 * Sets V8 flags from the command line. |
| 6161 */ | 6141 */ |
| 6162 static void SetFlagsFromCommandLine(int* argc, | 6142 static void SetFlagsFromCommandLine(int* argc, |
| 6163 char** argv, | 6143 char** argv, |
| 6164 bool remove_flags); | 6144 bool remove_flags); |
| 6165 | 6145 |
| 6166 /** Get the version string. */ | 6146 /** Get the version string. */ |
| 6167 static const char* GetVersion(); | 6147 static const char* GetVersion(); |
| 6168 | 6148 |
| 6169 /** Callback function for reporting failed access checks.*/ | 6149 /** Callback function for reporting failed access checks.*/ |
| 6170 V8_INLINE static V8_DEPRECATE_SOON( | 6150 V8_INLINE static V8_DEPRECATED( |
| 6171 "Use isolate version", | 6151 "Use isolate version", |
| 6172 void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback)); | 6152 void SetFailedAccessCheckCallbackFunction(FailedAccessCheckCallback)); |
| 6173 | 6153 |
| 6174 /** | 6154 /** |
| 6175 * Enables the host application to receive a notification before a | 6155 * Enables the host application to receive a notification before a |
| 6176 * garbage collection. Allocations are not allowed in the | 6156 * garbage collection. Allocations are not allowed in the |
| 6177 * callback function, you therefore cannot manipulate objects (set | 6157 * callback function, you therefore cannot manipulate objects (set |
| 6178 * or delete properties for example) since it is possible such | 6158 * or delete properties for example) since it is possible such |
| 6179 * operations will result in the allocation of objects. It is possible | 6159 * operations will result in the allocation of objects. It is possible |
| 6180 * to specify the GCType filter for your callback. But it is not possible to | 6160 * to specify the GCType filter for your callback. But it is not possible to |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6214 * AddGCEpilogueCallback function. | 6194 * AddGCEpilogueCallback function. |
| 6215 */ | 6195 */ |
| 6216 V8_INLINE static V8_DEPRECATED( | 6196 V8_INLINE static V8_DEPRECATED( |
| 6217 "Use isolate version", | 6197 "Use isolate version", |
| 6218 void RemoveGCEpilogueCallback(GCCallback callback)); | 6198 void RemoveGCEpilogueCallback(GCCallback callback)); |
| 6219 | 6199 |
| 6220 /** | 6200 /** |
| 6221 * Enables the host application to provide a mechanism to be notified | 6201 * Enables the host application to provide a mechanism to be notified |
| 6222 * and perform custom logging when V8 Allocates Executable Memory. | 6202 * and perform custom logging when V8 Allocates Executable Memory. |
| 6223 */ | 6203 */ |
| 6224 V8_INLINE static V8_DEPRECATE_SOON( | 6204 V8_INLINE static V8_DEPRECATED( |
| 6225 "Use isolate version", | 6205 "Use isolate version", |
| 6226 void AddMemoryAllocationCallback(MemoryAllocationCallback callback, | 6206 void AddMemoryAllocationCallback(MemoryAllocationCallback callback, |
| 6227 ObjectSpace space, | 6207 ObjectSpace space, |
| 6228 AllocationAction action)); | 6208 AllocationAction action)); |
| 6229 | 6209 |
| 6230 /** | 6210 /** |
| 6231 * Removes callback that was installed by AddMemoryAllocationCallback. | 6211 * Removes callback that was installed by AddMemoryAllocationCallback. |
| 6232 */ | 6212 */ |
| 6233 V8_INLINE static V8_DEPRECATE_SOON( | 6213 V8_INLINE static V8_DEPRECATED( |
| 6234 "Use isolate version", | 6214 "Use isolate version", |
| 6235 void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback)); | 6215 void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback)); |
| 6236 | 6216 |
| 6237 /** | 6217 /** |
| 6238 * Initializes V8. This function needs to be called before the first Isolate | 6218 * Initializes V8. This function needs to be called before the first Isolate |
| 6239 * is created. It always returns true. | 6219 * is created. It always returns true. |
| 6240 */ | 6220 */ |
| 6241 static bool Initialize(); | 6221 static bool Initialize(); |
| 6242 | 6222 |
| 6243 /** | 6223 /** |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6255 | 6235 |
| 6256 /** | 6236 /** |
| 6257 * Forcefully terminate the current thread of JavaScript execution | 6237 * Forcefully terminate the current thread of JavaScript execution |
| 6258 * in the given isolate. | 6238 * in the given isolate. |
| 6259 * | 6239 * |
| 6260 * This method can be used by any thread even if that thread has not | 6240 * This method can be used by any thread even if that thread has not |
| 6261 * acquired the V8 lock with a Locker object. | 6241 * acquired the V8 lock with a Locker object. |
| 6262 * | 6242 * |
| 6263 * \param isolate The isolate in which to terminate the current JS execution. | 6243 * \param isolate The isolate in which to terminate the current JS execution. |
| 6264 */ | 6244 */ |
| 6265 V8_INLINE static V8_DEPRECATE_SOON("Use isolate version", | 6245 V8_INLINE static V8_DEPRECATED("Use isolate version", |
| 6266 void TerminateExecution(Isolate* isolate)); | 6246 void TerminateExecution(Isolate* isolate)); |
| 6267 | 6247 |
| 6268 /** | 6248 /** |
| 6269 * Is V8 terminating JavaScript execution. | 6249 * Is V8 terminating JavaScript execution. |
| 6270 * | 6250 * |
| 6271 * Returns true if JavaScript execution is currently terminating | 6251 * Returns true if JavaScript execution is currently terminating |
| 6272 * because of a call to TerminateExecution. In that case there are | 6252 * because of a call to TerminateExecution. In that case there are |
| 6273 * still JavaScript frames on the stack and the termination | 6253 * still JavaScript frames on the stack and the termination |
| 6274 * exception is still active. | 6254 * exception is still active. |
| 6275 * | 6255 * |
| 6276 * \param isolate The isolate in which to check. | 6256 * \param isolate The isolate in which to check. |
| 6277 */ | 6257 */ |
| 6278 V8_INLINE static V8_DEPRECATE_SOON( | 6258 V8_INLINE static V8_DEPRECATED( |
| 6279 "Use isolate version", | 6259 "Use isolate version", |
| 6280 bool IsExecutionTerminating(Isolate* isolate = NULL)); | 6260 bool IsExecutionTerminating(Isolate* isolate = NULL)); |
| 6281 | 6261 |
| 6282 /** | 6262 /** |
| 6283 * Resume execution capability in the given isolate, whose execution | 6263 * Resume execution capability in the given isolate, whose execution |
| 6284 * was previously forcefully terminated using TerminateExecution(). | 6264 * was previously forcefully terminated using TerminateExecution(). |
| 6285 * | 6265 * |
| 6286 * When execution is forcefully terminated using TerminateExecution(), | 6266 * When execution is forcefully terminated using TerminateExecution(), |
| 6287 * the isolate can not resume execution until all JavaScript frames | 6267 * the isolate can not resume execution until all JavaScript frames |
| 6288 * have propagated the uncatchable exception which is generated. This | 6268 * have propagated the uncatchable exception which is generated. This |
| 6289 * method allows the program embedding the engine to handle the | 6269 * method allows the program embedding the engine to handle the |
| 6290 * termination event and resume execution capability, even if | 6270 * termination event and resume execution capability, even if |
| 6291 * JavaScript frames remain on the stack. | 6271 * JavaScript frames remain on the stack. |
| 6292 * | 6272 * |
| 6293 * This method can be used by any thread even if that thread has not | 6273 * This method can be used by any thread even if that thread has not |
| 6294 * acquired the V8 lock with a Locker object. | 6274 * acquired the V8 lock with a Locker object. |
| 6295 * | 6275 * |
| 6296 * \param isolate The isolate in which to resume execution capability. | 6276 * \param isolate The isolate in which to resume execution capability. |
| 6297 */ | 6277 */ |
| 6298 V8_INLINE static V8_DEPRECATE_SOON( | 6278 V8_INLINE static V8_DEPRECATED( |
| 6299 "Use isolate version", void CancelTerminateExecution(Isolate* isolate)); | 6279 "Use isolate version", void CancelTerminateExecution(Isolate* isolate)); |
| 6300 | 6280 |
| 6301 /** | 6281 /** |
| 6302 * Releases any resources used by v8 and stops any utility threads | 6282 * Releases any resources used by v8 and stops any utility threads |
| 6303 * that may be running. Note that disposing v8 is permanent, it | 6283 * that may be running. Note that disposing v8 is permanent, it |
| 6304 * cannot be reinitialized. | 6284 * cannot be reinitialized. |
| 6305 * | 6285 * |
| 6306 * It should generally not be necessary to dispose v8 before exiting | 6286 * It should generally not be necessary to dispose v8 before exiting |
| 6307 * a process, this should happen automatically. It is only necessary | 6287 * a process, this should happen automatically. It is only necessary |
| 6308 * to use if the process needs the resources taken up by v8. | 6288 * to use if the process needs the resources taken up by v8. |
| 6309 */ | 6289 */ |
| 6310 static bool Dispose(); | 6290 static bool Dispose(); |
| 6311 | 6291 |
| 6312 /** | 6292 /** |
| 6313 * Iterates through all external resources referenced from current isolate | 6293 * Iterates through all external resources referenced from current isolate |
| 6314 * heap. GC is not invoked prior to iterating, therefore there is no | 6294 * heap. GC is not invoked prior to iterating, therefore there is no |
| 6315 * guarantee that visited objects are still alive. | 6295 * guarantee that visited objects are still alive. |
| 6316 */ | 6296 */ |
| 6317 V8_INLINE static V8_DEPRECATE_SOON( | 6297 V8_INLINE static V8_DEPRECATED( |
| 6318 "Use isolate version", | 6298 "Use isolate version", |
| 6319 void VisitExternalResources(ExternalResourceVisitor* visitor)); | 6299 void VisitExternalResources(ExternalResourceVisitor* visitor)); |
| 6320 | 6300 |
| 6321 /** | 6301 /** |
| 6322 * Iterates through all the persistent handles in the current isolate's heap | 6302 * Iterates through all the persistent handles in the current isolate's heap |
| 6323 * that have class_ids. | 6303 * that have class_ids. |
| 6324 */ | 6304 */ |
| 6325 V8_INLINE static V8_DEPRECATE_SOON( | 6305 V8_INLINE static V8_DEPRECATED( |
| 6326 "Use isolate version", | 6306 "Use isolate version", |
| 6327 void VisitHandlesWithClassIds(PersistentHandleVisitor* visitor)); | 6307 void VisitHandlesWithClassIds(PersistentHandleVisitor* visitor)); |
| 6328 | 6308 |
| 6329 /** | 6309 /** |
| 6330 * Iterates through all the persistent handles in isolate's heap that have | 6310 * Iterates through all the persistent handles in isolate's heap that have |
| 6331 * class_ids. | 6311 * class_ids. |
| 6332 */ | 6312 */ |
| 6333 V8_INLINE static V8_DEPRECATE_SOON( | 6313 V8_INLINE static V8_DEPRECATED( |
| 6334 "Use isolate version", | 6314 "Use isolate version", |
| 6335 void VisitHandlesWithClassIds(Isolate* isolate, | 6315 void VisitHandlesWithClassIds(Isolate* isolate, |
| 6336 PersistentHandleVisitor* visitor)); | 6316 PersistentHandleVisitor* visitor)); |
| 6337 | 6317 |
| 6338 /** | 6318 /** |
| 6339 * Iterates through all the persistent handles in the current isolate's heap | 6319 * Iterates through all the persistent handles in the current isolate's heap |
| 6340 * that have class_ids and are candidates to be marked as partially dependent | 6320 * that have class_ids and are candidates to be marked as partially dependent |
| 6341 * handles. This will visit handles to young objects created since the last | 6321 * handles. This will visit handles to young objects created since the last |
| 6342 * garbage collection but is free to visit an arbitrary superset of these | 6322 * garbage collection but is free to visit an arbitrary superset of these |
| 6343 * objects. | 6323 * objects. |
| 6344 */ | 6324 */ |
| 6345 V8_INLINE static V8_DEPRECATE_SOON( | 6325 V8_INLINE static V8_DEPRECATED( |
| 6346 "Use isolate version", | 6326 "Use isolate version", |
| 6347 void VisitHandlesForPartialDependence(Isolate* isolate, | 6327 void VisitHandlesForPartialDependence(Isolate* isolate, |
| 6348 PersistentHandleVisitor* visitor)); | 6328 PersistentHandleVisitor* visitor)); |
| 6349 | 6329 |
| 6350 /** | 6330 /** |
| 6351 * Initialize the ICU library bundled with V8. The embedder should only | 6331 * Initialize the ICU library bundled with V8. The embedder should only |
| 6352 * invoke this method when using the bundled ICU. Returns true on success. | 6332 * invoke this method when using the bundled ICU. Returns true on success. |
| 6353 * | 6333 * |
| 6354 * If V8 was compiled with the ICU data in an external file, the location | 6334 * If V8 was compiled with the ICU data in an external file, the location |
| 6355 * of the data file has to be provided. | 6335 * of the data file has to be provided. |
| (...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8483 */ | 8463 */ |
| 8484 | 8464 |
| 8485 | 8465 |
| 8486 } // namespace v8 | 8466 } // namespace v8 |
| 8487 | 8467 |
| 8488 | 8468 |
| 8489 #undef TYPE_CHECK | 8469 #undef TYPE_CHECK |
| 8490 | 8470 |
| 8491 | 8471 |
| 8492 #endif // INCLUDE_V8_H_ | 8472 #endif // INCLUDE_V8_H_ |
| OLD | NEW |