libv8 5.1.281.59.1-amd64-freebsd-10 → 5.2.361.43.1-amd64-freebsd-10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e17f9b9df09283629a7c90e42d202a576c9710d
4
- data.tar.gz: 4e18770bed7da22348c88ee09b200672ee809724
3
+ metadata.gz: ff46a55a5f2b9668a2ec61ceda25ad0e569cef12
4
+ data.tar.gz: 185dee58ae08f90871d7e110c395e7e8a3403273
5
5
  SHA512:
6
- metadata.gz: 90947d669d6711314d22ed9b896cd4c7fdb9341513c0e7390688cfe5b742d51713b9e92edefac5ee03c6bbed58a8698410e4c024fb5c43590e1d1e41040e1b97
7
- data.tar.gz: b4993e743e032b0ba482786254ad1b0b906dd6224083350f2c6b4583bd49264f6bf38e7b845bb260f7f0a8fcfeca6c1ee7ecef069df52de6901ddb03c82c1df0
6
+ metadata.gz: fe5bb449ffbcd5b23b2cf8ce6debcf24aa9631014d9500f1b35716cefb7416ab2d7871e93c12522cabee34440713da82d38b1115aefdbeb09a1206025a42d002
7
+ data.tar.gz: 5b3226b86f0ba0213fb8ad50395181f8bc68a3c615d1ba2bfdabd9b740fec08bfb2c8ef86d99c8c5ce686e5af4bf59ee9070813335c341bde988c132a9626b9b
@@ -1,3 +1,3 @@
1
1
  module Libv8
2
- VERSION = "5.1.281.59.1"
2
+ VERSION = "5.2.361.43.1"
3
3
  end
@@ -515,6 +515,11 @@ class V8_EXPORT AllocationProfile {
515
515
  */
516
516
  class V8_EXPORT HeapProfiler {
517
517
  public:
518
+ enum SamplingFlags {
519
+ kSamplingNoFlags = 0,
520
+ kSamplingForceGC = 1 << 0,
521
+ };
522
+
518
523
  /**
519
524
  * Callback function invoked for obtaining RetainedObjectInfo for
520
525
  * the given JavaScript wrapper object. It is prohibited to enter V8
@@ -640,7 +645,8 @@ class V8_EXPORT HeapProfiler {
640
645
  * Returns false if a sampling heap profiler is already running.
641
646
  */
642
647
  bool StartSamplingHeapProfiler(uint64_t sample_interval = 512 * 1024,
643
- int stack_depth = 16);
648
+ int stack_depth = 16,
649
+ SamplingFlags flags = kSamplingNoFlags);
644
650
 
645
651
  /**
646
652
  * Stops the sampling heap profile and discards the current profile.
@@ -95,12 +95,12 @@ class DefaultPersistentValueMapTraits : public StdMapTraits<K, V> {
95
95
  MapType* map, const K& key, Local<V> value) {
96
96
  return NULL;
97
97
  }
98
- static MapType* MapFromWeakCallbackData(
99
- const WeakCallbackData<V, WeakCallbackDataType>& data) {
98
+ static MapType* MapFromWeakCallbackInfo(
99
+ const WeakCallbackInfo<WeakCallbackDataType>& data) {
100
100
  return NULL;
101
101
  }
102
- static K KeyFromWeakCallbackData(
103
- const WeakCallbackData<V, WeakCallbackDataType>& data) {
102
+ static K KeyFromWeakCallbackInfo(
103
+ const WeakCallbackInfo<WeakCallbackDataType>& data) {
104
104
  return K();
105
105
  }
106
106
  static void DisposeCallbackData(WeakCallbackDataType* data) { }
@@ -205,6 +205,17 @@ class PersistentValueMapBase {
205
205
  reinterpret_cast<internal::Object**>(FromVal(Traits::Get(&impl_, key))));
206
206
  }
207
207
 
208
+ /**
209
+ * Call V8::RegisterExternallyReferencedObject with the map value for given
210
+ * key.
211
+ */
212
+ void RegisterExternallyReferencedObject(K& key) {
213
+ DCHECK(Contains(key));
214
+ V8::RegisterExternallyReferencedObject(
215
+ reinterpret_cast<internal::Object**>(FromVal(Traits::Get(&impl_, key))),
216
+ reinterpret_cast<internal::Isolate*>(GetIsolate()));
217
+ }
218
+
208
219
  /**
209
220
  * Return value for key and remove it from the map.
210
221
  */
@@ -402,11 +413,11 @@ class PersistentValueMap : public PersistentValueMapBase<K, V, Traits> {
402
413
 
403
414
  private:
404
415
  static void WeakCallback(
405
- const WeakCallbackData<V, typename Traits::WeakCallbackDataType>& data) {
416
+ const WeakCallbackInfo<typename Traits::WeakCallbackDataType>& data) {
406
417
  if (Traits::kCallbackType != kNotWeak) {
407
418
  PersistentValueMap<K, V, Traits>* persistentValueMap =
408
- Traits::MapFromWeakCallbackData(data);
409
- K key = Traits::KeyFromWeakCallbackData(data);
419
+ Traits::MapFromWeakCallbackInfo(data);
420
+ K key = Traits::KeyFromWeakCallbackInfo(data);
410
421
  Traits::Dispose(data.GetIsolate(),
411
422
  persistentValueMap->Remove(key).Pass(), key);
412
423
  Traits::DisposeCallbackData(data.GetParameter());
@@ -9,9 +9,9 @@
9
9
  // NOTE these macros are used by some of the tool scripts and the build
10
10
  // system so their names cannot be changed without changing the scripts.
11
11
  #define V8_MAJOR_VERSION 5
12
- #define V8_MINOR_VERSION 1
13
- #define V8_BUILD_NUMBER 281
14
- #define V8_PATCH_LEVEL 59
12
+ #define V8_MINOR_VERSION 2
13
+ #define V8_BUILD_NUMBER 361
14
+ #define V8_PATCH_LEVEL 43
15
15
 
16
16
  // Use 1 for candidates and 0 otherwise.
17
17
  // (Boolean macro values are not supported by all preprocessors.)
@@ -457,32 +457,12 @@ class WeakCallbackInfo {
457
457
  };
458
458
 
459
459
 
460
- template <class T, class P>
461
- class WeakCallbackData {
462
- public:
463
- typedef void (*Callback)(const WeakCallbackData<T, P>& data);
464
-
465
- WeakCallbackData(Isolate* isolate, P* parameter, Local<T> handle)
466
- : isolate_(isolate), parameter_(parameter), handle_(handle) {}
467
-
468
- V8_INLINE Isolate* GetIsolate() const { return isolate_; }
469
- V8_INLINE P* GetParameter() const { return parameter_; }
470
- V8_INLINE Local<T> GetValue() const { return handle_; }
471
-
472
- private:
473
- Isolate* isolate_;
474
- P* parameter_;
475
- Local<T> handle_;
476
- };
477
-
478
-
479
- // TODO(dcarney): delete this with WeakCallbackData
480
- template <class T>
481
- using PhantomCallbackData = WeakCallbackInfo<T>;
482
-
483
-
484
- enum class WeakCallbackType { kParameter, kInternalFields };
485
-
460
+ // kParameter will pass a void* parameter back to the callback, kInternalFields
461
+ // will pass the first two internal fields back to the callback, kFinalizer
462
+ // will pass a void* parameter back, but is invoked before the object is
463
+ // actually collected, so it can be resurrected. In the last case, it is not
464
+ // possible to request a second pass callback.
465
+ enum class WeakCallbackType { kParameter, kInternalFields, kFinalizer };
486
466
 
487
467
  /**
488
468
  * An object reference that is independent of any handle scope. Where
@@ -561,36 +541,19 @@ template <class T> class PersistentBase {
561
541
  * critical form of resource management!
562
542
  */
563
543
  template <typename P>
564
- V8_INLINE V8_DEPRECATED(
565
- "use WeakCallbackInfo version",
566
- void SetWeak(P* parameter,
567
- typename WeakCallbackData<T, P>::Callback callback));
568
-
569
- template <typename S, typename P>
570
- V8_INLINE V8_DEPRECATED(
571
- "use WeakCallbackInfo version",
572
- void SetWeak(P* parameter,
573
- typename WeakCallbackData<S, P>::Callback callback));
574
-
575
- // Phantom persistents work like weak persistents, except that the pointer to
576
- // the object being collected is not available in the finalization callback.
577
- // This enables the garbage collector to collect the object and any objects
578
- // it references transitively in one GC cycle. At the moment you can either
579
- // specify a parameter for the callback or the location of two internal
580
- // fields in the dying object.
581
- template <typename P>
582
- V8_INLINE V8_DEPRECATED(
583
- "use SetWeak",
584
- void SetPhantom(P* parameter,
585
- typename WeakCallbackInfo<P>::Callback callback,
586
- int internal_field_index1 = -1,
587
- int internal_field_index2 = -1));
588
-
589
- template <typename P>
590
544
  V8_INLINE void SetWeak(P* parameter,
591
545
  typename WeakCallbackInfo<P>::Callback callback,
592
546
  WeakCallbackType type);
593
547
 
548
+ /**
549
+ * Turns this handle into a weak phantom handle without finalization callback.
550
+ * The handle will be reset automatically when the garbage collector detects
551
+ * that the object is no longer reachable.
552
+ * A related function Isolate::NumberOfPhantomHandleResetsSinceLastCall
553
+ * returns how many phantom handles were reset by the garbage collector.
554
+ */
555
+ V8_INLINE void SetWeak();
556
+
594
557
  template<typename P>
595
558
  V8_INLINE P* ClearWeak();
596
559
 
@@ -602,7 +565,7 @@ template <class T> class PersistentBase {
602
565
  * is alive. Only allowed when the embedder is asked to trace its heap by
603
566
  * EmbedderHeapTracer.
604
567
  */
605
- V8_INLINE void RegisterExternalReference(Isolate* isolate);
568
+ V8_INLINE void RegisterExternalReference(Isolate* isolate) const;
606
569
 
607
570
  /**
608
571
  * Marks the reference to this object independent. Garbage collector is free
@@ -620,7 +583,9 @@ template <class T> class PersistentBase {
620
583
  * external dependencies. This mark is automatically cleared after each
621
584
  * garbage collection.
622
585
  */
623
- V8_INLINE void MarkPartiallyDependent();
586
+ V8_INLINE V8_DEPRECATED(
587
+ "deprecated optimization, do not use partially dependent groups",
588
+ void MarkPartiallyDependent());
624
589
 
625
590
  /**
626
591
  * Marks the reference to this object as active. The scavenge garbage
@@ -1665,9 +1630,8 @@ struct SampleInfo {
1665
1630
  StateTag vm_state;
1666
1631
  };
1667
1632
 
1668
-
1669
1633
  /**
1670
- * A JSON Parser.
1634
+ * A JSON Parser and Stringifier.
1671
1635
  */
1672
1636
  class V8_EXPORT JSON {
1673
1637
  public:
@@ -1678,10 +1642,23 @@ class V8_EXPORT JSON {
1678
1642
  * \param json_string The string to parse.
1679
1643
  * \return The corresponding value if successfully parsed.
1680
1644
  */
1681
- static V8_DEPRECATED("Use maybe version",
1645
+ static V8_DEPRECATED("Use the maybe version taking context",
1682
1646
  Local<Value> Parse(Local<String> json_string));
1647
+ static V8_DEPRECATE_SOON("Use the maybe version taking context",
1648
+ MaybeLocal<Value> Parse(Isolate* isolate,
1649
+ Local<String> json_string));
1683
1650
  static V8_WARN_UNUSED_RESULT MaybeLocal<Value> Parse(
1684
- Isolate* isolate, Local<String> json_string);
1651
+ Local<Context> context, Local<String> json_string);
1652
+
1653
+ /**
1654
+ * Tries to stringify the JSON-serializable object |json_object| and returns
1655
+ * it as string if successful.
1656
+ *
1657
+ * \param json_object The JSON-serializable object to stringify.
1658
+ * \return The corresponding string if successfully stringified.
1659
+ */
1660
+ static V8_WARN_UNUSED_RESULT MaybeLocal<String> Stringify(
1661
+ Local<Context> context, Local<Object> json_object);
1685
1662
  };
1686
1663
 
1687
1664
 
@@ -2050,6 +2027,8 @@ class V8_EXPORT Value : public Data {
2050
2027
 
2051
2028
  template <class T> V8_INLINE static Value* Cast(T* value);
2052
2029
 
2030
+ Local<String> TypeOf(v8::Isolate*);
2031
+
2053
2032
  private:
2054
2033
  V8_INLINE bool QuickIsUndefined() const;
2055
2034
  V8_INLINE bool QuickIsNull() const;
@@ -2639,6 +2618,18 @@ enum AccessControl {
2639
2618
  PROHIBITS_OVERWRITING = 1 << 2
2640
2619
  };
2641
2620
 
2621
+ /**
2622
+ * Property filter bits. They can be or'ed to build a composite filter.
2623
+ */
2624
+ enum PropertyFilter {
2625
+ ALL_PROPERTIES = 0,
2626
+ ONLY_WRITABLE = 1,
2627
+ ONLY_ENUMERABLE = 2,
2628
+ ONLY_CONFIGURABLE = 4,
2629
+ SKIP_STRINGS = 8,
2630
+ SKIP_SYMBOLS = 16
2631
+ };
2632
+
2642
2633
  /**
2643
2634
  * Integrity level for objects.
2644
2635
  */
@@ -2798,6 +2789,15 @@ class V8_EXPORT Object : public Value {
2798
2789
  V8_WARN_UNUSED_RESULT MaybeLocal<Array> GetOwnPropertyNames(
2799
2790
  Local<Context> context);
2800
2791
 
2792
+ /**
2793
+ * Returns an array containing the names of the filtered properties
2794
+ * of this object, including properties from prototype objects. The
2795
+ * array returned by this method contains the same values as would
2796
+ * be enumerated by a for-in statement over this object.
2797
+ */
2798
+ V8_WARN_UNUSED_RESULT MaybeLocal<Array> GetOwnPropertyNames(
2799
+ Local<Context> context, PropertyFilter filter);
2800
+
2801
2801
  /**
2802
2802
  * Get the prototype object. This does not skip objects marked to
2803
2803
  * be skipped by __proto__ and it does not consult the security
@@ -2878,6 +2878,8 @@ class V8_EXPORT Object : public Value {
2878
2878
  V8_DEPRECATED("Use maybe version", bool HasOwnProperty(Local<String> key));
2879
2879
  V8_WARN_UNUSED_RESULT Maybe<bool> HasOwnProperty(Local<Context> context,
2880
2880
  Local<Name> key);
2881
+ V8_WARN_UNUSED_RESULT Maybe<bool> HasOwnProperty(Local<Context> context,
2882
+ uint32_t index);
2881
2883
  V8_DEPRECATE_SOON("Use maybe version",
2882
2884
  bool HasRealNamedProperty(Local<String> key));
2883
2885
  V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedProperty(Local<Context> context,
@@ -2950,13 +2952,6 @@ class V8_EXPORT Object : public Value {
2950
2952
  */
2951
2953
  int GetIdentityHash();
2952
2954
 
2953
- V8_DEPRECATED("Use v8::Object::SetPrivate instead.",
2954
- bool SetHiddenValue(Local<String> key, Local<Value> value));
2955
- V8_DEPRECATED("Use v8::Object::GetPrivate instead.",
2956
- Local<Value> GetHiddenValue(Local<String> key));
2957
- V8_DEPRECATED("Use v8::Object::DeletePrivate instead.",
2958
- bool DeleteHiddenValue(Local<String> key));
2959
-
2960
2955
  /**
2961
2956
  * Clone this object with a fast but shallow copy. Values will point
2962
2957
  * to the same values as the original object.
@@ -2976,6 +2971,11 @@ class V8_EXPORT Object : public Value {
2976
2971
  */
2977
2972
  bool IsCallable();
2978
2973
 
2974
+ /**
2975
+ * True if this object is a constructor.
2976
+ */
2977
+ bool IsConstructor();
2978
+
2979
2979
  /**
2980
2980
  * Call an Object as a function if a callback is set by the
2981
2981
  * ObjectTemplate::SetCallAsFunctionHandler method.
@@ -3177,12 +3177,13 @@ class FunctionCallbackInfo {
3177
3177
  Local<Function> Callee() const);
3178
3178
  V8_INLINE Local<Object> This() const;
3179
3179
  V8_INLINE Local<Object> Holder() const;
3180
+ V8_INLINE Local<Value> NewTarget() const;
3180
3181
  V8_INLINE bool IsConstructCall() const;
3181
3182
  V8_INLINE Local<Value> Data() const;
3182
3183
  V8_INLINE Isolate* GetIsolate() const;
3183
3184
  V8_INLINE ReturnValue<T> GetReturnValue() const;
3184
3185
  // This shouldn't be public, but the arm compiler needs it.
3185
- static const int kArgsLength = 7;
3186
+ static const int kArgsLength = 8;
3186
3187
 
3187
3188
  protected:
3188
3189
  friend class internal::FunctionCallbackArguments;
@@ -3194,15 +3195,13 @@ class FunctionCallbackInfo {
3194
3195
  static const int kDataIndex = 4;
3195
3196
  static const int kCalleeIndex = 5;
3196
3197
  static const int kContextSaveIndex = 6;
3198
+ static const int kNewTargetIndex = 7;
3197
3199
 
3198
3200
  V8_INLINE FunctionCallbackInfo(internal::Object** implicit_args,
3199
- internal::Object** values,
3200
- int length,
3201
- bool is_construct_call);
3201
+ internal::Object** values, int length);
3202
3202
  internal::Object** implicit_args_;
3203
3203
  internal::Object** values_;
3204
3204
  int length_;
3205
- int is_construct_call_;
3206
3205
  };
3207
3206
 
3208
3207
 
@@ -3241,6 +3240,7 @@ class PropertyCallbackInfo {
3241
3240
 
3242
3241
  typedef void (*FunctionCallback)(const FunctionCallbackInfo<Value>& info);
3243
3242
 
3243
+ enum class ConstructorBehavior { kThrow, kAllow };
3244
3244
 
3245
3245
  /**
3246
3246
  * A JavaScript function object (ECMA-262, 15.3).
@@ -3251,10 +3251,10 @@ class V8_EXPORT Function : public Object {
3251
3251
  * Create a function in the current execution context
3252
3252
  * for a given FunctionCallback.
3253
3253
  */
3254
- static MaybeLocal<Function> New(Local<Context> context,
3255
- FunctionCallback callback,
3256
- Local<Value> data = Local<Value>(),
3257
- int length = 0);
3254
+ static MaybeLocal<Function> New(
3255
+ Local<Context> context, FunctionCallback callback,
3256
+ Local<Value> data = Local<Value>(), int length = 0,
3257
+ ConstructorBehavior behavior = ConstructorBehavior::kAllow);
3258
3258
  static V8_DEPRECATE_SOON(
3259
3259
  "Use maybe version",
3260
3260
  Local<Function> New(Isolate* isolate, FunctionCallback callback,
@@ -3456,10 +3456,20 @@ enum class ArrayBufferCreationMode { kInternalized, kExternalized };
3456
3456
  class V8_EXPORT ArrayBuffer : public Object {
3457
3457
  public:
3458
3458
  /**
3459
- * Allocator that V8 uses to allocate |ArrayBuffer|'s memory.
3459
+ * A thread-safe allocator that V8 uses to allocate |ArrayBuffer|'s memory.
3460
3460
  * The allocator is a global V8 setting. It has to be set via
3461
3461
  * Isolate::CreateParams.
3462
3462
  *
3463
+ * Memory allocated through this allocator by V8 is accounted for as external
3464
+ * memory by V8. Note that V8 keeps track of the memory for all internalized
3465
+ * |ArrayBuffer|s. Responsibility for tracking external memory (using
3466
+ * Isolate::AdjustAmountOfExternalAllocatedMemory) is handed over to the
3467
+ * embedder upon externalization and taken over upon internalization (creating
3468
+ * an internalized buffer from an existing buffer).
3469
+ *
3470
+ * Note that it is unsafe to call back into V8 from any of the allocator
3471
+ * functions.
3472
+ *
3463
3473
  * This API is experimental and may change significantly.
3464
3474
  */
3465
3475
  class V8_EXPORT Allocator { // NOLINT
@@ -4127,7 +4137,11 @@ enum Intrinsic {
4127
4137
  */
4128
4138
  class V8_EXPORT Template : public Data {
4129
4139
  public:
4130
- /** Adds a property to each instance created by this template.*/
4140
+ /**
4141
+ * Adds a property to each instance created by this template.
4142
+ *
4143
+ * The property must be defined either as a primitive value, or a template.
4144
+ */
4131
4145
  void Set(Local<Name> name, Local<Data> value,
4132
4146
  PropertyAttribute attributes = None);
4133
4147
  V8_INLINE void Set(Isolate* isolate, const char* name, Local<Data> value);
@@ -4477,7 +4491,8 @@ class V8_EXPORT FunctionTemplate : public Template {
4477
4491
  static Local<FunctionTemplate> New(
4478
4492
  Isolate* isolate, FunctionCallback callback = 0,
4479
4493
  Local<Value> data = Local<Value>(),
4480
- Local<Signature> signature = Local<Signature>(), int length = 0);
4494
+ Local<Signature> signature = Local<Signature>(), int length = 0,
4495
+ ConstructorBehavior behavior = ConstructorBehavior::kAllow);
4481
4496
 
4482
4497
  /**
4483
4498
  * Creates a function template with a fast handler. If a fast handler is set,
@@ -5121,6 +5136,11 @@ class V8_EXPORT MicrotasksScope {
5121
5136
  */
5122
5137
  static int GetCurrentDepth(Isolate* isolate);
5123
5138
 
5139
+ /**
5140
+ * Returns true while microtasks are being executed.
5141
+ */
5142
+ static bool IsRunningMicrotasks(Isolate* isolate);
5143
+
5124
5144
  private:
5125
5145
  internal::Isolate* const isolate_;
5126
5146
  bool run_;
@@ -5394,31 +5414,29 @@ enum class MemoryPressureLevel { kNone, kModerate, kCritical };
5394
5414
  * trace through its heap and call PersistentBase::RegisterExternalReference on
5395
5415
  * each js object reachable from any of the given wrappers.
5396
5416
  *
5397
- * Before the first call to the TraceWrappableFrom function v8 will call
5398
- * TraceRoots. When the v8 garbage collection is finished, v8 will call
5399
- * ClearTracingMarks.
5417
+ * Before the first call to the TraceWrappersFrom function TracePrologue will be
5418
+ * called. When the garbage collection cycle is finished, TraceEpilogue will be
5419
+ * called.
5400
5420
  */
5401
- class EmbedderHeapTracer {
5421
+ class V8_EXPORT EmbedderHeapTracer {
5402
5422
  public:
5403
5423
  /**
5404
5424
  * V8 will call this method at the beginning of the gc cycle.
5405
5425
  */
5406
- virtual void TraceRoots(Isolate* isolate) = 0;
5407
-
5426
+ virtual void TracePrologue() = 0;
5408
5427
  /**
5409
5428
  * V8 will call this method with internal fields of a potential wrappers.
5410
5429
  * Embedder is expected to trace its heap (synchronously) and call
5411
5430
  * PersistentBase::RegisterExternalReference() on all wrappers reachable from
5412
5431
  * any of the given wrappers.
5413
5432
  */
5414
- virtual void TraceWrappableFrom(
5415
- Isolate* isolate,
5433
+ virtual void TraceWrappersFrom(
5416
5434
  const std::vector<std::pair<void*, void*> >& internal_fields) = 0;
5417
5435
  /**
5418
5436
  * V8 will call this method at the end of the gc cycle. Allocation is *not*
5419
- * allowed in the ClearTracingMarks.
5437
+ * allowed in the TraceEpilogue.
5420
5438
  */
5421
- virtual void ClearTracingMarks(Isolate* isolate) = 0;
5439
+ virtual void TraceEpilogue() = 0;
5422
5440
 
5423
5441
  protected:
5424
5442
  virtual ~EmbedderHeapTracer() = default;
@@ -5621,9 +5639,10 @@ class V8_EXPORT Isolate {
5621
5639
  kLegacyFunctionDeclaration = 29,
5622
5640
  kRegExpPrototypeSourceGetter = 30,
5623
5641
  kRegExpPrototypeOldFlagGetter = 31,
5642
+ kDecimalWithLeadingZeroInStrictMode = 32,
5624
5643
 
5625
- // If you add new values here, you'll also need to update V8Initializer.cpp
5626
- // in Chromium.
5644
+ // If you add new values here, you'll also need to update Chromium's:
5645
+ // UseCounter.h, V8PerIsolateData.cpp, histograms.xml
5627
5646
  kUseCounterFeatureCount // This enum value must be last.
5628
5647
  };
5629
5648
 
@@ -5795,6 +5814,12 @@ class V8_EXPORT Isolate {
5795
5814
  V8_INLINE int64_t
5796
5815
  AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes);
5797
5816
 
5817
+ /**
5818
+ * Returns the number of phantom handles without callbacks that were reset
5819
+ * by the garbage collector since the last call to this function.
5820
+ */
5821
+ size_t NumberOfPhantomHandleResetsSinceLastCall();
5822
+
5798
5823
  /**
5799
5824
  * Returns heap profiler for this isolate. Will return NULL until the isolate
5800
5825
  * is initialized.
@@ -6234,13 +6259,17 @@ class V8_EXPORT Isolate {
6234
6259
  * Enables the host application to provide a mechanism to be notified
6235
6260
  * and perform custom logging when V8 Allocates Executable Memory.
6236
6261
  */
6237
- void AddMemoryAllocationCallback(MemoryAllocationCallback callback,
6238
- ObjectSpace space, AllocationAction action);
6262
+ void V8_DEPRECATED(
6263
+ "Use a combination of RequestInterrupt and GCCallback instead",
6264
+ AddMemoryAllocationCallback(MemoryAllocationCallback callback,
6265
+ ObjectSpace space, AllocationAction action));
6239
6266
 
6240
6267
  /**
6241
6268
  * Removes callback that was installed by AddMemoryAllocationCallback.
6242
6269
  */
6243
- void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback);
6270
+ void V8_DEPRECATED(
6271
+ "Use a combination of RequestInterrupt and GCCallback instead",
6272
+ RemoveMemoryAllocationCallback(MemoryAllocationCallback callback));
6244
6273
 
6245
6274
  /**
6246
6275
  * Iterates through all external resources referenced from current isolate
@@ -6476,23 +6505,6 @@ class V8_EXPORT V8 {
6476
6505
  "Use isolate version",
6477
6506
  void RemoveGCEpilogueCallback(GCCallback callback));
6478
6507
 
6479
- /**
6480
- * Enables the host application to provide a mechanism to be notified
6481
- * and perform custom logging when V8 Allocates Executable Memory.
6482
- */
6483
- V8_INLINE static V8_DEPRECATED(
6484
- "Use isolate version",
6485
- void AddMemoryAllocationCallback(MemoryAllocationCallback callback,
6486
- ObjectSpace space,
6487
- AllocationAction action));
6488
-
6489
- /**
6490
- * Removes callback that was installed by AddMemoryAllocationCallback.
6491
- */
6492
- V8_INLINE static V8_DEPRECATED(
6493
- "Use isolate version",
6494
- void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback));
6495
-
6496
6508
  /**
6497
6509
  * Initializes V8. This function needs to be called before the first Isolate
6498
6510
  * is created. It always returns true.
@@ -6653,26 +6665,27 @@ class V8_EXPORT V8 {
6653
6665
  internal::Object** handle);
6654
6666
  static internal::Object** CopyPersistent(internal::Object** handle);
6655
6667
  static void DisposeGlobal(internal::Object** global_handle);
6656
- typedef WeakCallbackData<Value, void>::Callback WeakCallback;
6657
- static void RegisterExternallyReferencedObject(internal::Object** object,
6658
- internal::Isolate* isolate);
6659
- static void MakeWeak(internal::Object** global_handle, void* data,
6660
- WeakCallback weak_callback);
6661
- static void MakeWeak(internal::Object** global_handle, void* data,
6668
+ static void MakeWeak(internal::Object** location, void* data,
6662
6669
  WeakCallbackInfo<void>::Callback weak_callback,
6663
6670
  WeakCallbackType type);
6664
- static void MakeWeak(internal::Object** global_handle, void* data,
6671
+ static void MakeWeak(internal::Object** location, void* data,
6665
6672
  // Must be 0 or -1.
6666
6673
  int internal_field_index1,
6667
6674
  // Must be 1 or -1.
6668
6675
  int internal_field_index2,
6669
6676
  WeakCallbackInfo<void>::Callback weak_callback);
6670
- static void* ClearWeak(internal::Object** global_handle);
6677
+ static void MakeWeak(internal::Object*** location_addr);
6678
+ static void* ClearWeak(internal::Object** location);
6671
6679
  static void Eternalize(Isolate* isolate,
6672
6680
  Value* handle,
6673
6681
  int* index);
6674
6682
  static Local<Value> GetEternal(Isolate* isolate, int index);
6675
6683
 
6684
+ static void RegisterExternallyReferencedObject(internal::Object** object,
6685
+ internal::Isolate* isolate);
6686
+ template <class K, class V, class T>
6687
+ friend class PersistentValueMapBase;
6688
+
6676
6689
  static void FromJustIsNothing();
6677
6690
  static void ToLocalEmpty();
6678
6691
  static void InternalFieldOutOfBounds(int index);
@@ -7330,7 +7343,7 @@ class Internals {
7330
7343
  1 * kApiPointerSize + kApiIntSize;
7331
7344
  static const int kStringResourceOffset = 3 * kApiPointerSize;
7332
7345
 
7333
- static const int kOddballKindOffset = 5 * kApiPointerSize;
7346
+ static const int kOddballKindOffset = 5 * kApiPointerSize + sizeof(double);
7334
7347
  static const int kForeignAddressOffset = kApiPointerSize;
7335
7348
  static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
7336
7349
  static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
@@ -7370,7 +7383,8 @@ class Internals {
7370
7383
  static const int kNodeIsPartiallyDependentShift = 4;
7371
7384
  static const int kNodeIsActiveShift = 4;
7372
7385
 
7373
- static const int kJSObjectType = 0xb8;
7386
+ static const int kJSObjectType = 0xb7;
7387
+ static const int kJSApiObjectType = 0xb6;
7374
7388
  static const int kFirstNonstringType = 0x80;
7375
7389
  static const int kOddballType = 0x83;
7376
7390
  static const int kForeignType = 0x87;
@@ -7623,39 +7637,6 @@ void PersistentBase<T>::Reset(Isolate* isolate,
7623
7637
  }
7624
7638
 
7625
7639
 
7626
- template <class T>
7627
- template <typename S, typename P>
7628
- void PersistentBase<T>::SetWeak(
7629
- P* parameter,
7630
- typename WeakCallbackData<S, P>::Callback callback) {
7631
- TYPE_CHECK(S, T);
7632
- typedef typename WeakCallbackData<Value, void>::Callback Callback;
7633
- V8::MakeWeak(reinterpret_cast<internal::Object**>(this->val_), parameter,
7634
- reinterpret_cast<Callback>(callback));
7635
- }
7636
-
7637
-
7638
- template <class T>
7639
- template <typename P>
7640
- void PersistentBase<T>::SetWeak(
7641
- P* parameter,
7642
- typename WeakCallbackData<T, P>::Callback callback) {
7643
- SetWeak<T, P>(parameter, callback);
7644
- }
7645
-
7646
-
7647
- template <class T>
7648
- template <typename P>
7649
- void PersistentBase<T>::SetPhantom(
7650
- P* parameter, typename WeakCallbackInfo<P>::Callback callback,
7651
- int internal_field_index1, int internal_field_index2) {
7652
- typedef typename WeakCallbackInfo<void>::Callback Callback;
7653
- V8::MakeWeak(reinterpret_cast<internal::Object**>(this->val_), parameter,
7654
- internal_field_index1, internal_field_index2,
7655
- reinterpret_cast<Callback>(callback));
7656
- }
7657
-
7658
-
7659
7640
  template <class T>
7660
7641
  template <typename P>
7661
7642
  V8_INLINE void PersistentBase<T>::SetWeak(
@@ -7666,6 +7647,10 @@ V8_INLINE void PersistentBase<T>::SetWeak(
7666
7647
  reinterpret_cast<Callback>(callback), type);
7667
7648
  }
7668
7649
 
7650
+ template <class T>
7651
+ void PersistentBase<T>::SetWeak() {
7652
+ V8::MakeWeak(reinterpret_cast<internal::Object***>(&this->val_));
7653
+ }
7669
7654
 
7670
7655
  template <class T>
7671
7656
  template <typename P>
@@ -7675,7 +7660,7 @@ P* PersistentBase<T>::ClearWeak() {
7675
7660
  }
7676
7661
 
7677
7662
  template <class T>
7678
- void PersistentBase<T>::RegisterExternalReference(Isolate* isolate) {
7663
+ void PersistentBase<T>::RegisterExternalReference(Isolate* isolate) const {
7679
7664
  if (IsEmpty()) return;
7680
7665
  V8::RegisterExternallyReferencedObject(
7681
7666
  reinterpret_cast<internal::Object**>(this->val_),
@@ -7857,17 +7842,11 @@ internal::Object* ReturnValue<T>::GetDefaultValue() {
7857
7842
  return value_[-1];
7858
7843
  }
7859
7844
 
7860
-
7861
- template<typename T>
7845
+ template <typename T>
7862
7846
  FunctionCallbackInfo<T>::FunctionCallbackInfo(internal::Object** implicit_args,
7863
7847
  internal::Object** values,
7864
- int length,
7865
- bool is_construct_call)
7866
- : implicit_args_(implicit_args),
7867
- values_(values),
7868
- length_(length),
7869
- is_construct_call_(is_construct_call) { }
7870
-
7848
+ int length)
7849
+ : implicit_args_(implicit_args), values_(values), length_(length) {}
7871
7850
 
7872
7851
  template<typename T>
7873
7852
  Local<Value> FunctionCallbackInfo<T>::operator[](int i) const {
@@ -7895,8 +7874,13 @@ Local<Object> FunctionCallbackInfo<T>::Holder() const {
7895
7874
  &implicit_args_[kHolderIndex]));
7896
7875
  }
7897
7876
 
7877
+ template <typename T>
7878
+ Local<Value> FunctionCallbackInfo<T>::NewTarget() const {
7879
+ return Local<Value>(
7880
+ reinterpret_cast<Value*>(&implicit_args_[kNewTargetIndex]));
7881
+ }
7898
7882
 
7899
- template<typename T>
7883
+ template <typename T>
7900
7884
  Local<Value> FunctionCallbackInfo<T>::Data() const {
7901
7885
  return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex]));
7902
7886
  }
@@ -7916,7 +7900,7 @@ ReturnValue<T> FunctionCallbackInfo<T>::GetReturnValue() const {
7916
7900
 
7917
7901
  template<typename T>
7918
7902
  bool FunctionCallbackInfo<T>::IsConstructCall() const {
7919
- return is_construct_call_ & 0x1;
7903
+ return !NewTarget()->IsUndefined();
7920
7904
  }
7921
7905
 
7922
7906
 
@@ -8010,7 +7994,9 @@ Local<Value> Object::GetInternalField(int index) {
8010
7994
  O* obj = *reinterpret_cast<O**>(this);
8011
7995
  // Fast path: If the object is a plain JSObject, which is the common case, we
8012
7996
  // know where to find the internal fields and can return the value directly.
8013
- if (I::GetInstanceType(obj) == I::kJSObjectType) {
7997
+ auto instance_type = I::GetInstanceType(obj);
7998
+ if (instance_type == I::kJSObjectType ||
7999
+ instance_type == I::kJSApiObjectType) {
8014
8000
  int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index);
8015
8001
  O* value = I::ReadField<O*>(obj, offset);
8016
8002
  O** result = HandleScope::CreateHandle(reinterpret_cast<HO*>(obj), value);
@@ -8028,7 +8014,9 @@ void* Object::GetAlignedPointerFromInternalField(int index) {
8028
8014
  O* obj = *reinterpret_cast<O**>(this);
8029
8015
  // Fast path: If the object is a plain JSObject, which is the common case, we
8030
8016
  // know where to find the internal fields and can return the value directly.
8031
- if (V8_LIKELY(I::GetInstanceType(obj) == I::kJSObjectType)) {
8017
+ auto instance_type = I::GetInstanceType(obj);
8018
+ if (V8_LIKELY(instance_type == I::kJSObjectType ||
8019
+ instance_type == I::kJSApiObjectType)) {
8032
8020
  int offset = I::kJSObjectHeaderSize + (internal::kApiPointerSize * index);
8033
8021
  return I::ReadField<void*>(obj, offset);
8034
8022
  }
@@ -8708,21 +8696,6 @@ void V8::RemoveGCEpilogueCallback(GCCallback callback) {
8708
8696
  reinterpret_cast<v8::Isolate::GCCallback>(callback));
8709
8697
  }
8710
8698
 
8711
-
8712
- void V8::AddMemoryAllocationCallback(MemoryAllocationCallback callback,
8713
- ObjectSpace space,
8714
- AllocationAction action) {
8715
- Isolate* isolate = Isolate::GetCurrent();
8716
- isolate->AddMemoryAllocationCallback(callback, space, action);
8717
- }
8718
-
8719
-
8720
- void V8::RemoveMemoryAllocationCallback(MemoryAllocationCallback callback) {
8721
- Isolate* isolate = Isolate::GetCurrent();
8722
- isolate->RemoveMemoryAllocationCallback(callback);
8723
- }
8724
-
8725
-
8726
8699
  void V8::TerminateExecution(Isolate* isolate) { isolate->TerminateExecution(); }
8727
8700
 
8728
8701
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libv8
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.281.59.1
4
+ version: 5.2.361.43.1
5
5
  platform: amd64-freebsd-10
6
6
  authors:
7
7
  - Charles Lowell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-15 00:00:00.000000000 Z
11
+ date: 2016-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -81,11 +81,11 @@ files:
81
81
  - vendor/v8/out/x64.release/libv8_libplatform.a
82
82
  - vendor/v8/out/x64.release/libv8_nosnapshot.a
83
83
  - vendor/v8/out/x64.release/libv8_snapshot.a
84
- - vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a
85
- - vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_libbase.a
86
- - vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_libplatform.a
87
- - vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_nosnapshot.a
88
- - vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_snapshot.a
84
+ - vendor/v8/out/x64.release/obj.target/src/libv8_base.a
85
+ - vendor/v8/out/x64.release/obj.target/src/libv8_libbase.a
86
+ - vendor/v8/out/x64.release/obj.target/src/libv8_libplatform.a
87
+ - vendor/v8/out/x64.release/obj.target/src/libv8_nosnapshot.a
88
+ - vendor/v8/out/x64.release/obj.target/src/libv8_snapshot.a
89
89
  homepage: http://github.com/cowboyd/libv8
90
90
  licenses:
91
91
  - MIT
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  version: '0'
108
108
  requirements: []
109
109
  rubyforge_project: libv8
110
- rubygems_version: 2.5.1
110
+ rubygems_version: 2.6.4
111
111
  signing_key:
112
112
  specification_version: 4
113
113
  summary: Distribution of the V8 JavaScript engine