libv8 5.2.361.43.1-universal-darwin-15 → 5.3.332.38.0beta2-universal-darwin-15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef9c18b3f3007a56144729dfdff837a31512e953
4
- data.tar.gz: 58a4bbdd702e483d6cf08d10e4a69a4e2762ef98
3
+ metadata.gz: 7795c9b4317765f14f03503af072a6390b3de400
4
+ data.tar.gz: 78e8257f69efe9412a0598dcd80295ddb5fe2476
5
5
  SHA512:
6
- metadata.gz: fce6714eb643a2b0c2413b1c5ca4688579624d918179583015a8c1feb5f470c119c7c616e7251f45b39b6c402bc702b292108ed23ce6406a1c9d4c1e76acd2ed
7
- data.tar.gz: 89f266469b346a5dd1c640dec9ae8072074979ccf4a63c760c102a30d72fb715e5d7d944e9c5fb158aa11f0d6adbf36001b498d43e81730ea8caf5920ecb1e81
6
+ metadata.gz: ca0eebc41efb1a1fe2fc81cfbd8f680b1fb30eec2f0fcffb50979c6cf9916028d2251e83234449d1f742c41c4d708cb23593c6f1ba8711a9a4a61e085c57f9bf
7
+ data.tar.gz: 28a5174bacfb0d7f3610f090a3e4f2c20f3332498a21525312111212759eaf42426b1b32552a20f050c8067b3beacbc6ff1a9c9f41ff99930a39b6e9c6807afa
data/ext/libv8/paths.rb CHANGED
@@ -11,7 +11,7 @@ module Libv8
11
11
  end
12
12
 
13
13
  def object_paths
14
- [:base, :libplatform, :libbase, :snapshot].map do |name|
14
+ [:base, :libplatform, :libsampler, :libbase, :snapshot].map do |name|
15
15
  Shellwords.escape libv8_object(name)
16
16
  end
17
17
  end
data/lib/libv8/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Libv8
2
- VERSION = "5.2.361.43.1"
2
+ VERSION = "5.3.332.38.0beta2"
3
3
  end
@@ -125,6 +125,8 @@ class V8_EXPORT Debug {
125
125
  */
126
126
  virtual ClientData* GetClientData() const = 0;
127
127
 
128
+ virtual Isolate* GetIsolate() const = 0;
129
+
128
130
  virtual ~EventDetails() {}
129
131
  };
130
132
 
@@ -259,6 +261,11 @@ class V8_EXPORT Debug {
259
261
  V8_DEPRECATED("Use version with an Isolate",
260
262
  static Local<Context> GetDebugContext());
261
263
 
264
+ /**
265
+ * While in the debug context, this method returns the top-most non-debug
266
+ * context, if it exists.
267
+ */
268
+ static MaybeLocal<Context> GetDebuggedContext(Isolate* isolate);
262
269
 
263
270
  /**
264
271
  * Enable/disable LiveEdit functionality for the given Isolate
@@ -694,7 +694,6 @@ class V8_EXPORT HeapProfiler {
694
694
  HeapProfiler& operator=(const HeapProfiler&);
695
695
  };
696
696
 
697
-
698
697
  /**
699
698
  * Interface for providing information about embedder's objects
700
699
  * held by global handles. This information is reported in two ways:
@@ -709,7 +708,7 @@ class V8_EXPORT HeapProfiler {
709
708
  * were not previously reported via AddObjectGroup.
710
709
  *
711
710
  * Thus, if an embedder wants to provide information about native
712
- * objects for heap snapshots, he can do it in a GC prologue
711
+ * objects for heap snapshots, it can do it in a GC prologue
713
712
  * handler, and / or by assigning wrapper class ids in the following way:
714
713
  *
715
714
  * 1. Bind a callback to class id by calling SetWrapperClassInfoProvider.
@@ -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 2
13
- #define V8_BUILD_NUMBER 361
14
- #define V8_PATCH_LEVEL 43
12
+ #define V8_MINOR_VERSION 3
13
+ #define V8_BUILD_NUMBER 332
14
+ #define V8_PATCH_LEVEL 38
15
15
 
16
16
  // Use 1 for candidates and 0 otherwise.
17
17
  // (Boolean macro values are not supported by all preprocessors.)
@@ -1613,21 +1613,21 @@ class V8_EXPORT StackFrame {
1613
1613
  // A StateTag represents a possible state of the VM.
1614
1614
  enum StateTag { JS, GC, COMPILER, OTHER, EXTERNAL, IDLE };
1615
1615
 
1616
-
1617
1616
  // A RegisterState represents the current state of registers used
1618
1617
  // by the sampling profiler API.
1619
1618
  struct RegisterState {
1620
- RegisterState() : pc(NULL), sp(NULL), fp(NULL) {}
1619
+ RegisterState() : pc(nullptr), sp(nullptr), fp(nullptr) {}
1621
1620
  void* pc; // Instruction pointer.
1622
1621
  void* sp; // Stack pointer.
1623
1622
  void* fp; // Frame pointer.
1624
1623
  };
1625
1624
 
1626
-
1627
1625
  // The output structure filled up by GetStackSample API function.
1628
1626
  struct SampleInfo {
1629
- size_t frames_count;
1630
- StateTag vm_state;
1627
+ size_t frames_count; // Number of frames collected.
1628
+ StateTag vm_state; // Current VM state.
1629
+ void* external_callback_entry; // External callback address if VM is
1630
+ // executing an external callback.
1631
1631
  };
1632
1632
 
1633
1633
  /**
@@ -1658,7 +1658,8 @@ class V8_EXPORT JSON {
1658
1658
  * \return The corresponding string if successfully stringified.
1659
1659
  */
1660
1660
  static V8_WARN_UNUSED_RESULT MaybeLocal<String> Stringify(
1661
- Local<Context> context, Local<Object> json_object);
1661
+ Local<Context> context, Local<Object> json_object,
1662
+ Local<String> gap = Local<String>());
1662
1663
  };
1663
1664
 
1664
1665
 
@@ -2630,6 +2631,21 @@ enum PropertyFilter {
2630
2631
  SKIP_SYMBOLS = 16
2631
2632
  };
2632
2633
 
2634
+ /**
2635
+ * Keys/Properties filter enums:
2636
+ *
2637
+ * KeyCollectionMode limits the range of collected properties. kOwnOnly limits
2638
+ * the collected properties to the given Object only. kIncludesPrototypes will
2639
+ * include all keys of the objects's prototype chain as well.
2640
+ */
2641
+ enum class KeyCollectionMode { kOwnOnly, kIncludePrototypes };
2642
+
2643
+ /**
2644
+ * kIncludesIndices allows for integer indices to be collected, while
2645
+ * kSkipIndices will exclude integer indicies from being collected.
2646
+ */
2647
+ enum class IndexFilter { kIncludeIndices, kSkipIndices };
2648
+
2633
2649
  /**
2634
2650
  * Integrity level for objects.
2635
2651
  */
@@ -2779,6 +2795,9 @@ class V8_EXPORT Object : public Value {
2779
2795
  V8_DEPRECATE_SOON("Use maybe version", Local<Array> GetPropertyNames());
2780
2796
  V8_WARN_UNUSED_RESULT MaybeLocal<Array> GetPropertyNames(
2781
2797
  Local<Context> context);
2798
+ V8_WARN_UNUSED_RESULT MaybeLocal<Array> GetPropertyNames(
2799
+ Local<Context> context, KeyCollectionMode mode,
2800
+ PropertyFilter property_filter, IndexFilter index_filter);
2782
2801
 
2783
2802
  /**
2784
2803
  * This function has the same functionality as GetPropertyNames but
@@ -4367,28 +4386,6 @@ enum AccessType {
4367
4386
  typedef bool (*AccessCheckCallback)(Local<Context> accessing_context,
4368
4387
  Local<Object> accessed_object,
4369
4388
  Local<Value> data);
4370
- typedef bool (*DeprecatedAccessCheckCallback)(Local<Context> accessing_context,
4371
- Local<Object> accessed_object);
4372
-
4373
- /**
4374
- * Returns true if cross-context access should be allowed to the named
4375
- * property with the given key on the host object.
4376
- */
4377
- typedef bool (*NamedSecurityCallback)(Local<Object> host,
4378
- Local<Value> key,
4379
- AccessType type,
4380
- Local<Value> data);
4381
-
4382
-
4383
- /**
4384
- * Returns true if cross-context access should be allowed to the indexed
4385
- * property with the given index on the host object.
4386
- */
4387
- typedef bool (*IndexedSecurityCallback)(Local<Object> host,
4388
- uint32_t index,
4389
- AccessType type,
4390
- Local<Value> data);
4391
-
4392
4389
 
4393
4390
  /**
4394
4391
  * A FunctionTemplate is used to create functions at runtime. There
@@ -4494,6 +4491,9 @@ class V8_EXPORT FunctionTemplate : public Template {
4494
4491
  Local<Signature> signature = Local<Signature>(), int length = 0,
4495
4492
  ConstructorBehavior behavior = ConstructorBehavior::kAllow);
4496
4493
 
4494
+ /** Get a template included in the snapshot by index. */
4495
+ static Local<FunctionTemplate> FromSnapshot(Isolate* isolate, size_t index);
4496
+
4497
4497
  /**
4498
4498
  * Creates a function template with a fast handler. If a fast handler is set,
4499
4499
  * the callback cannot be null.
@@ -4669,6 +4669,9 @@ class V8_EXPORT ObjectTemplate : public Template {
4669
4669
  Local<FunctionTemplate> constructor = Local<FunctionTemplate>());
4670
4670
  static V8_DEPRECATED("Use isolate version", Local<ObjectTemplate> New());
4671
4671
 
4672
+ /** Get a template included in the snapshot by index. */
4673
+ static Local<ObjectTemplate> FromSnapshot(Isolate* isolate, size_t index);
4674
+
4672
4675
  /** Creates a new instance of this template.*/
4673
4676
  V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance());
4674
4677
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context);
@@ -4799,16 +4802,18 @@ class V8_EXPORT ObjectTemplate : public Template {
4799
4802
  */
4800
4803
  void SetAccessCheckCallback(AccessCheckCallback callback,
4801
4804
  Local<Value> data = Local<Value>());
4802
- V8_DEPRECATED(
4803
- "Use SetAccessCheckCallback with new AccessCheckCallback signature.",
4804
- void SetAccessCheckCallback(DeprecatedAccessCheckCallback callback,
4805
- Local<Value> data = Local<Value>()));
4806
4805
 
4807
- V8_DEPRECATED(
4808
- "Use SetAccessCheckCallback instead",
4809
- void SetAccessCheckCallbacks(NamedSecurityCallback named_handler,
4810
- IndexedSecurityCallback indexed_handler,
4811
- Local<Value> data = Local<Value>()));
4806
+ /**
4807
+ * Like SetAccessCheckCallback but invokes an interceptor on failed access
4808
+ * checks instead of looking up all-can-read properties. You can only use
4809
+ * either this method or SetAccessCheckCallback, but not both at the same
4810
+ * time.
4811
+ */
4812
+ void SetAccessCheckCallbackAndHandler(
4813
+ AccessCheckCallback callback,
4814
+ const NamedPropertyHandlerConfiguration& named_handler,
4815
+ const IndexedPropertyHandlerConfiguration& indexed_handler,
4816
+ Local<Value> data = Local<Value>());
4812
4817
 
4813
4818
  /**
4814
4819
  * Gets the number of internal fields for objects generated from
@@ -5053,10 +5058,6 @@ enum ObjectSpace {
5053
5058
  kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree
5054
5059
  };
5055
5060
 
5056
- typedef void (*MemoryAllocationCallback)(ObjectSpace space,
5057
- AllocationAction action,
5058
- int size);
5059
-
5060
5061
  // --- Enter/Leave Script Callback ---
5061
5062
  typedef void (*BeforeCallEnteredCallback)(Isolate*);
5062
5063
  typedef void (*CallCompletedCallback)(Isolate*);
@@ -5277,6 +5278,18 @@ class V8_EXPORT HeapObjectStatistics {
5277
5278
  friend class Isolate;
5278
5279
  };
5279
5280
 
5281
+ class V8_EXPORT HeapCodeStatistics {
5282
+ public:
5283
+ HeapCodeStatistics();
5284
+ size_t code_and_metadata_size() { return code_and_metadata_size_; }
5285
+ size_t bytecode_and_metadata_size() { return bytecode_and_metadata_size_; }
5286
+
5287
+ private:
5288
+ size_t code_and_metadata_size_;
5289
+ size_t bytecode_and_metadata_size_;
5290
+
5291
+ friend class Isolate;
5292
+ };
5280
5293
 
5281
5294
  class RetainedObjectInfo;
5282
5295
 
@@ -5359,6 +5372,31 @@ struct JitCodeEvent {
5359
5372
  };
5360
5373
  };
5361
5374
 
5375
+ /**
5376
+ * Option flags passed to the SetRAILMode function.
5377
+ * See documentation https://developers.google.com/web/tools/chrome-devtools/
5378
+ * profile/evaluate-performance/rail
5379
+ */
5380
+ enum RAILMode {
5381
+ // Default performance mode: V8 will optimize for both latency and
5382
+ // throughput in this mode.
5383
+ PERFORMANCE_DEFAULT,
5384
+ // Response performance mode: In this mode very low virtual machine latency
5385
+ // is provided. V8 will try to avoid JavaScript execution interruptions.
5386
+ // Throughput may be throttled.
5387
+ PERFORMANCE_RESPONSE,
5388
+ // Animation performance mode: In this mode low virtual machine latency is
5389
+ // provided. V8 will try to avoid as many JavaScript execution interruptions
5390
+ // as possible. Throughput may be throttled
5391
+ PERFORMANCE_ANIMATION,
5392
+ // Idle performance mode: The embedder is idle. V8 can complete deferred work
5393
+ // in this mode.
5394
+ PERFORMANCE_IDLE,
5395
+ // Load performance mode: In this mode high throughput is provided. V8 may
5396
+ // turn off latency optimizations.
5397
+ PERFORMANCE_LOAD
5398
+ };
5399
+
5362
5400
  /**
5363
5401
  * Option flags passed to the SetJitCodeEventHandler function.
5364
5402
  */
@@ -5420,24 +5458,51 @@ enum class MemoryPressureLevel { kNone, kModerate, kCritical };
5420
5458
  */
5421
5459
  class V8_EXPORT EmbedderHeapTracer {
5422
5460
  public:
5461
+ enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION };
5462
+ struct AdvanceTracingActions {
5463
+ explicit AdvanceTracingActions(ForceCompletionAction force_completion_)
5464
+ : force_completion(force_completion_) {}
5465
+
5466
+ ForceCompletionAction force_completion;
5467
+ };
5468
+ /**
5469
+ * V8 will call this method with internal fields of found wrappers.
5470
+ * Embedder is expected to store them in it's marking deque and trace
5471
+ * reachable wrappers from them when asked by AdvanceTracing method.
5472
+ */
5473
+ virtual void RegisterV8References(
5474
+ const std::vector<std::pair<void*, void*> >& internal_fields) = 0;
5423
5475
  /**
5424
5476
  * V8 will call this method at the beginning of the gc cycle.
5425
5477
  */
5426
5478
  virtual void TracePrologue() = 0;
5427
5479
  /**
5428
- * V8 will call this method with internal fields of a potential wrappers.
5429
- * Embedder is expected to trace its heap (synchronously) and call
5430
- * PersistentBase::RegisterExternalReference() on all wrappers reachable from
5431
- * any of the given wrappers.
5480
+ * Embedder is expected to trace its heap starting from wrappers reported by
5481
+ * RegisterV8References method, and call
5482
+ * PersistentBase::RegisterExternalReference() on all reachable wrappers.
5483
+ * Embedder is expected to stop tracing by the given deadline.
5484
+ *
5485
+ * Returns true if there is still work to do.
5432
5486
  */
5433
- virtual void TraceWrappersFrom(
5434
- const std::vector<std::pair<void*, void*> >& internal_fields) = 0;
5487
+ virtual bool AdvanceTracing(double deadline_in_ms,
5488
+ AdvanceTracingActions actions) = 0;
5435
5489
  /**
5436
5490
  * V8 will call this method at the end of the gc cycle. Allocation is *not*
5437
5491
  * allowed in the TraceEpilogue.
5438
5492
  */
5439
5493
  virtual void TraceEpilogue() = 0;
5440
5494
 
5495
+ /**
5496
+ * Let embedder know v8 entered final marking pause (no more incremental steps
5497
+ * will follow).
5498
+ */
5499
+ virtual void EnterFinalPause() {}
5500
+
5501
+ /**
5502
+ * Throw away all intermediate data and reset to the initial state.
5503
+ */
5504
+ virtual void AbortTracing() {}
5505
+
5441
5506
  protected:
5442
5507
  virtual ~EmbedderHeapTracer() = default;
5443
5508
  };
@@ -5457,20 +5522,21 @@ class V8_EXPORT Isolate {
5457
5522
  */
5458
5523
  struct CreateParams {
5459
5524
  CreateParams()
5460
- : entry_hook(NULL),
5461
- code_event_handler(NULL),
5462
- snapshot_blob(NULL),
5463
- counter_lookup_callback(NULL),
5464
- create_histogram_callback(NULL),
5465
- add_histogram_sample_callback(NULL),
5466
- array_buffer_allocator(NULL) {}
5525
+ : entry_hook(nullptr),
5526
+ code_event_handler(nullptr),
5527
+ snapshot_blob(nullptr),
5528
+ counter_lookup_callback(nullptr),
5529
+ create_histogram_callback(nullptr),
5530
+ add_histogram_sample_callback(nullptr),
5531
+ array_buffer_allocator(nullptr),
5532
+ external_references(nullptr) {}
5467
5533
 
5468
5534
  /**
5469
5535
  * The optional entry_hook allows the host application to provide the
5470
5536
  * address of a function that's invoked on entry to every V8-generated
5471
5537
  * function. Note that entry_hook is invoked at the very start of each
5472
- * generated function. Furthermore, if an entry_hook is given, V8 will
5473
- * always run without a context snapshot.
5538
+ * generated function. Furthermore, if an entry_hook is given, V8 will
5539
+ * not use a snapshot, including custom snapshots.
5474
5540
  */
5475
5541
  FunctionEntryHook entry_hook;
5476
5542
 
@@ -5511,6 +5577,14 @@ class V8_EXPORT Isolate {
5511
5577
  * store of ArrayBuffers.
5512
5578
  */
5513
5579
  ArrayBuffer::Allocator* array_buffer_allocator;
5580
+
5581
+ /**
5582
+ * Specifies an optional nullptr-terminated array of raw addresses in the
5583
+ * embedder that V8 can match against during serialization and use for
5584
+ * deserialization. This array and its content must stay valid for the
5585
+ * entire lifetime of the isolate.
5586
+ */
5587
+ intptr_t* external_references;
5514
5588
  };
5515
5589
 
5516
5590
 
@@ -5640,6 +5714,8 @@ class V8_EXPORT Isolate {
5640
5714
  kRegExpPrototypeSourceGetter = 30,
5641
5715
  kRegExpPrototypeOldFlagGetter = 31,
5642
5716
  kDecimalWithLeadingZeroInStrictMode = 32,
5717
+ kLegacyDateParser = 33,
5718
+ kDefineGetterOrSetterWouldThrow = 34,
5643
5719
 
5644
5720
  // If you add new values here, you'll also need to update Chromium's:
5645
5721
  // UseCounter.h, V8PerIsolateData.cpp, histograms.xml
@@ -5783,6 +5859,15 @@ class V8_EXPORT Isolate {
5783
5859
  bool GetHeapObjectStatisticsAtLastGC(HeapObjectStatistics* object_statistics,
5784
5860
  size_t type_index);
5785
5861
 
5862
+ /**
5863
+ * Get statistics about code and its metadata in the heap.
5864
+ *
5865
+ * \param object_statistics The HeapCodeStatistics object to fill in
5866
+ * statistics of code, bytecode and their metadata.
5867
+ * \returns true on success.
5868
+ */
5869
+ bool GetHeapCodeAndMetadataStatistics(HeapCodeStatistics* object_statistics);
5870
+
5786
5871
  /**
5787
5872
  * Get a call stack sample from the isolate.
5788
5873
  * \param state Execution state.
@@ -6160,6 +6245,15 @@ class V8_EXPORT Isolate {
6160
6245
  */
6161
6246
  void IsolateInBackgroundNotification();
6162
6247
 
6248
+ /**
6249
+ * Optional notification to tell V8 the current performance requirements
6250
+ * of the embedder based on RAIL.
6251
+ * V8 uses these notifications to guide heuristics.
6252
+ * This is an unfinished experimental feature. Semantics and implementation
6253
+ * may change frequently.
6254
+ */
6255
+ void SetRAILMode(RAILMode rail_mode);
6256
+
6163
6257
  /**
6164
6258
  * Allows the host application to provide the address of a function that is
6165
6259
  * notified each time code is added, moved or removed.
@@ -6255,22 +6349,6 @@ class V8_EXPORT Isolate {
6255
6349
  bool capture, int frame_limit = 10,
6256
6350
  StackTrace::StackTraceOptions options = StackTrace::kOverview);
6257
6351
 
6258
- /**
6259
- * Enables the host application to provide a mechanism to be notified
6260
- * and perform custom logging when V8 Allocates Executable Memory.
6261
- */
6262
- void V8_DEPRECATED(
6263
- "Use a combination of RequestInterrupt and GCCallback instead",
6264
- AddMemoryAllocationCallback(MemoryAllocationCallback callback,
6265
- ObjectSpace space, AllocationAction action));
6266
-
6267
- /**
6268
- * Removes callback that was installed by AddMemoryAllocationCallback.
6269
- */
6270
- void V8_DEPRECATED(
6271
- "Use a combination of RequestInterrupt and GCCallback instead",
6272
- RemoveMemoryAllocationCallback(MemoryAllocationCallback callback));
6273
-
6274
6352
  /**
6275
6353
  * Iterates through all external resources referenced from current isolate
6276
6354
  * heap. GC is not invoked prior to iterating, therefore there is no
@@ -6300,6 +6378,12 @@ class V8_EXPORT Isolate {
6300
6378
  */
6301
6379
  void VisitWeakHandles(PersistentHandleVisitor* visitor);
6302
6380
 
6381
+ /**
6382
+ * Check if this isolate is in use.
6383
+ * True if at least one thread Enter'ed this isolate.
6384
+ */
6385
+ bool IsInUse();
6386
+
6303
6387
  private:
6304
6388
  template <class K, class V, class Traits>
6305
6389
  friend class PersistentValueMapBase;
@@ -6625,7 +6709,24 @@ class V8_EXPORT V8 {
6625
6709
  * If V8 was compiled with the ICU data in an external file, the location
6626
6710
  * of the data file has to be provided.
6627
6711
  */
6628
- static bool InitializeICU(const char* icu_data_file = NULL);
6712
+ V8_DEPRECATE_SOON(
6713
+ "Use version with default location.",
6714
+ static bool InitializeICU(const char* icu_data_file = nullptr));
6715
+
6716
+ /**
6717
+ * Initialize the ICU library bundled with V8. The embedder should only
6718
+ * invoke this method when using the bundled ICU. If V8 was compiled with
6719
+ * the ICU data in an external file and when the default location of that
6720
+ * file should be used, a path to the executable must be provided.
6721
+ * Returns true on success.
6722
+ *
6723
+ * The default is a file called icudtl.dat side-by-side with the executable.
6724
+ *
6725
+ * Optionally, the location of the data file can be provided to override the
6726
+ * default.
6727
+ */
6728
+ static bool InitializeICUDefaultLocation(const char* exec_path,
6729
+ const char* icu_data_file = nullptr);
6629
6730
 
6630
6731
  /**
6631
6732
  * Initialize the external startup data. The embedder only needs to
@@ -6702,6 +6803,60 @@ class V8_EXPORT V8 {
6702
6803
  friend class Context;
6703
6804
  };
6704
6805
 
6806
+ /**
6807
+ * Helper class to create a snapshot data blob.
6808
+ */
6809
+ class SnapshotCreator {
6810
+ public:
6811
+ enum class FunctionCodeHandling { kClear, kKeep };
6812
+
6813
+ /**
6814
+ * Create and enter an isolate, and set it up for serialization.
6815
+ * The isolate is either created from scratch or from an existing snapshot.
6816
+ * The caller keeps ownership of the argument snapshot.
6817
+ * \param existing_blob existing snapshot from which to create this one.
6818
+ * \param external_references a null-terminated array of external references
6819
+ * that must be equivalent to CreateParams::external_references.
6820
+ */
6821
+ SnapshotCreator(intptr_t* external_references = nullptr,
6822
+ StartupData* existing_blob = nullptr);
6823
+
6824
+ ~SnapshotCreator();
6825
+
6826
+ /**
6827
+ * \returns the isolate prepared by the snapshot creator.
6828
+ */
6829
+ Isolate* GetIsolate();
6830
+
6831
+ /**
6832
+ * Add a context to be included in the snapshot blob.
6833
+ * \returns the index of the context in the snapshot blob.
6834
+ */
6835
+ size_t AddContext(Local<Context> context);
6836
+
6837
+ /**
6838
+ * Add a template to be included in the snapshot blob.
6839
+ * \returns the index of the template in the snapshot blob.
6840
+ */
6841
+ size_t AddTemplate(Local<Template> template_obj);
6842
+
6843
+ /**
6844
+ * Created a snapshot data blob.
6845
+ * This must not be called from within a handle scope.
6846
+ * \param function_code_handling whether to include compiled function code
6847
+ * in the snapshot.
6848
+ * \returns { nullptr, 0 } on failure, and a startup snapshot on success. The
6849
+ * caller acquires ownership of the data array in the return value.
6850
+ */
6851
+ StartupData CreateBlob(FunctionCodeHandling function_code_handling);
6852
+
6853
+ private:
6854
+ void* data_;
6855
+
6856
+ // Disallow copying and assigning.
6857
+ SnapshotCreator(const SnapshotCreator&);
6858
+ void operator=(const SnapshotCreator&);
6859
+ };
6705
6860
 
6706
6861
  /**
6707
6862
  * A simple Maybe type, representing an object which may or may not have a
@@ -6988,7 +7143,8 @@ class V8_EXPORT Context {
6988
7143
  static Local<Context> New(
6989
7144
  Isolate* isolate, ExtensionConfiguration* extensions = NULL,
6990
7145
  Local<ObjectTemplate> global_template = Local<ObjectTemplate>(),
6991
- Local<Value> global_object = Local<Value>());
7146
+ Local<Value> global_object = Local<Value>(),
7147
+ size_t context_snapshot_index = 0);
6992
7148
 
6993
7149
  /**
6994
7150
  * Sets the security token for the context. To access an object in
@@ -7355,13 +7511,12 @@ class Internals {
7355
7511
  static const int kExternalOneByteRepresentationTag = 0x06;
7356
7512
 
7357
7513
  static const int kIsolateEmbedderDataOffset = 0 * kApiPointerSize;
7358
- static const int kAmountOfExternalAllocatedMemoryOffset =
7359
- 4 * kApiPointerSize;
7360
- static const int kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset =
7361
- kAmountOfExternalAllocatedMemoryOffset + kApiInt64Size;
7362
- static const int kIsolateRootsOffset =
7363
- kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset + kApiInt64Size +
7364
- kApiPointerSize;
7514
+ static const int kExternalMemoryOffset = 4 * kApiPointerSize;
7515
+ static const int kExternalMemoryLimitOffset =
7516
+ kExternalMemoryOffset + kApiInt64Size;
7517
+ static const int kIsolateRootsOffset = kExternalMemoryLimitOffset +
7518
+ kApiInt64Size + kApiInt64Size +
7519
+ kApiPointerSize + kApiPointerSize;
7365
7520
  static const int kUndefinedValueRootIndex = 4;
7366
7521
  static const int kTheHoleValueRootIndex = 5;
7367
7522
  static const int kNullValueRootIndex = 6;
@@ -7369,10 +7524,6 @@ class Internals {
7369
7524
  static const int kFalseValueRootIndex = 8;
7370
7525
  static const int kEmptyStringRootIndex = 9;
7371
7526
 
7372
- // The external allocation limit should be below 256 MB on all architectures
7373
- // to avoid that resource-constrained embedders run low on memory.
7374
- static const int kExternalAllocationLimit = 192 * 1024 * 1024;
7375
-
7376
7527
  static const int kNodeClassIdOffset = 1 * kApiPointerSize;
7377
7528
  static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3;
7378
7529
  static const int kNodeStateMask = 0x7;
@@ -8567,21 +8718,16 @@ uint32_t Isolate::GetNumberOfDataSlots() {
8567
8718
  int64_t Isolate::AdjustAmountOfExternalAllocatedMemory(
8568
8719
  int64_t change_in_bytes) {
8569
8720
  typedef internal::Internals I;
8570
- int64_t* amount_of_external_allocated_memory =
8571
- reinterpret_cast<int64_t*>(reinterpret_cast<uint8_t*>(this) +
8572
- I::kAmountOfExternalAllocatedMemoryOffset);
8573
- int64_t* amount_of_external_allocated_memory_at_last_global_gc =
8574
- reinterpret_cast<int64_t*>(
8575
- reinterpret_cast<uint8_t*>(this) +
8576
- I::kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset);
8577
- int64_t amount = *amount_of_external_allocated_memory + change_in_bytes;
8578
- if (change_in_bytes > 0 &&
8579
- amount - *amount_of_external_allocated_memory_at_last_global_gc >
8580
- I::kExternalAllocationLimit) {
8721
+ int64_t* external_memory = reinterpret_cast<int64_t*>(
8722
+ reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryOffset);
8723
+ const int64_t external_memory_limit = *reinterpret_cast<int64_t*>(
8724
+ reinterpret_cast<uint8_t*>(this) + I::kExternalMemoryLimitOffset);
8725
+ const int64_t amount = *external_memory + change_in_bytes;
8726
+ *external_memory = amount;
8727
+ if (change_in_bytes > 0 && amount > external_memory_limit) {
8581
8728
  ReportExternalAllocationLimitReached();
8582
8729
  }
8583
- *amount_of_external_allocated_memory = amount;
8584
- return *amount_of_external_allocated_memory;
8730
+ return *external_memory;
8585
8731
  }
8586
8732
 
8587
8733
 
Binary file
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.2.361.43.1
4
+ version: 5.3.332.38.0beta2
5
5
  platform: universal-darwin-15
6
6
  authors:
7
7
  - Charles Lowell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-27 00:00:00.000000000 Z
11
+ date: 2016-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -79,6 +79,7 @@ files:
79
79
  - vendor/v8/out/x64.release/libv8_base.a
80
80
  - vendor/v8/out/x64.release/libv8_libbase.a
81
81
  - vendor/v8/out/x64.release/libv8_libplatform.a
82
+ - vendor/v8/out/x64.release/libv8_libsampler.a
82
83
  - vendor/v8/out/x64.release/libv8_nosnapshot.a
83
84
  - vendor/v8/out/x64.release/libv8_snapshot.a
84
85
  homepage: http://github.com/cowboyd/libv8
@@ -97,9 +98,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
98
  version: '0'
98
99
  required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  requirements:
100
- - - '>='
101
+ - - '>'
101
102
  - !ruby/object:Gem::Version
102
- version: '0'
103
+ version: 1.3.1
103
104
  requirements: []
104
105
  rubyforge_project: libv8
105
106
  rubygems_version: 2.0.14.1