libv8 5.0.71.48.3-amd64-freebsd-10 → 5.1.281.59.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: 6bb6a93f36820e657cc0384a7aef44d3aa8f011f
4
- data.tar.gz: 4fe622d5096ed3af7ee7f9b2f4d9a530a1c88302
3
+ metadata.gz: 4e17f9b9df09283629a7c90e42d202a576c9710d
4
+ data.tar.gz: 4e18770bed7da22348c88ee09b200672ee809724
5
5
  SHA512:
6
- metadata.gz: 582353c77b75e877e21155f13a1507e4b238fa2946a03d6d0d06c97275ca15d6029604275a46d7e9cdf958ffd86630eaa94868fddb5d03baf0af07180b8cabfe
7
- data.tar.gz: 744991258638851a52716cce8592a9d38a3ab51e316c51bf8d21f302c56fb48c391ff03bac65ae7aa6abc267f8e503369bcb82f8687ad27d34f3c6501e8b26cd
6
+ metadata.gz: 90947d669d6711314d22ed9b896cd4c7fdb9341513c0e7390688cfe5b742d51713b9e92edefac5ee03c6bbed58a8698410e4c024fb5c43590e1d1e41040e1b97
7
+ data.tar.gz: b4993e743e032b0ba482786254ad1b0b906dd6224083350f2c6b4583bd49264f6bf38e7b845bb260f7f0a8fcfeca6c1ee7ecef069df52de6901ddb03c82c1df0
@@ -26,21 +26,24 @@ module Libv8
26
26
  verify_installation!
27
27
  return exit_status
28
28
  end
29
+
29
30
  def configure(context = MkmfContext.new)
30
- context.incflags.insert 0, Libv8::Paths.include_paths.map{|p| "-I#{p}"}.join(" ") + " "
31
+ context.incflags.insert 0, Libv8::Paths.include_paths.map{ |p| "-I#{p}" }.join(" ") + " "
31
32
  context.ldflags.insert 0, Libv8::Paths.object_paths.join(" ") + " "
32
33
  end
33
34
 
34
35
  def verify_installation!
35
36
  include_paths = Libv8::Paths.include_paths
36
- unless include_paths.detect { |p| Pathname(p).join('include/v8.h').exist? }
37
- fail HeaderNotFound, "Unable to locate 'include/v8.h' in the libv8 header paths: #{include_paths.inspect}"
37
+ unless include_paths.detect { |p| Pathname(p).join('v8.h').exist? }
38
+ fail HeaderNotFound, "Unable to locate 'v8.h' in the libv8 header paths: #{include_paths.inspect}"
38
39
  end
39
40
  Libv8::Paths.object_paths.each do |p|
40
41
  fail ArchiveNotFound, p unless File.exist? p
41
42
  end
42
43
  end
44
+
43
45
  class HeaderNotFound < StandardError; end
46
+
44
47
  class ArchiveNotFound < StandardError
45
48
  def initialize(filename)
46
49
  super "libv8 did not install properly, expected binary v8 archive '#{filename}'to exist, but it was not found"
@@ -59,14 +62,14 @@ module Libv8
59
62
  class NotFoundError < StandardError
60
63
  def initialize(*args)
61
64
  super(<<-EOS)
62
- By using --with-system-v8, you have chosen to use the version
63
- of V8 found on your system and *not* the one that is bundled with
64
- the libv8 rubygem.
65
+ By using --with-system-v8, you have chosen to use the version
66
+ of V8 found on your system and *not* the one that is bundled with
67
+ the libv8 rubygem.
65
68
 
66
- However, your system version of v8 could not be located.
69
+ However, your system version of v8 could not be located.
67
70
 
68
- Please make sure your system version of v8 that is compatible
69
- with #{Libv8::VERSION} installed. You may need to use the
71
+ Please make sure your system version of v8 that is compatible
72
+ with #{Libv8::VERSION} installed. You may need to use the
70
73
  --with-v8-dir option if it is installed in a non-standard location
71
74
  EOS
72
75
  end
@@ -7,7 +7,7 @@ module Libv8
7
7
  module_function
8
8
 
9
9
  def include_paths
10
- [Shellwords.escape(vendored_source_path)]
10
+ [Shellwords.escape(File.join(vendored_source_path, 'include'))]
11
11
  end
12
12
 
13
13
  def object_paths
@@ -1,3 +1,3 @@
1
1
  module Libv8
2
- VERSION = "5.0.71.48.3"
2
+ VERSION = "5.1.281.59.1"
3
3
  end
@@ -5,7 +5,7 @@
5
5
  #ifndef V8_LIBPLATFORM_LIBPLATFORM_H_
6
6
  #define V8_LIBPLATFORM_LIBPLATFORM_H_
7
7
 
8
- #include "include/v8-platform.h"
8
+ #include "v8-platform.h" // NOLINT(build/include)
9
9
 
10
10
  namespace v8 {
11
11
  namespace platform {
@@ -18,13 +18,11 @@ enum DebugEvent {
18
18
  Exception = 2,
19
19
  NewFunction = 3,
20
20
  BeforeCompile = 4,
21
- AfterCompile = 5,
21
+ AfterCompile = 5,
22
22
  CompileError = 6,
23
- PromiseEvent = 7,
24
- AsyncTaskEvent = 8,
23
+ AsyncTaskEvent = 7,
25
24
  };
26
25
 
27
-
28
26
  class V8_EXPORT Debug {
29
27
  public:
30
28
  /**
@@ -276,6 +274,14 @@ class V8_EXPORT Debug {
276
274
  */
277
275
  static MaybeLocal<Array> GetInternalProperties(Isolate* isolate,
278
276
  Local<Value> value);
277
+
278
+ /**
279
+ * Defines if the ES2015 tail call elimination feature is enabled or not.
280
+ * The change of this flag triggers deoptimization of all functions that
281
+ * contain calls at tail position.
282
+ */
283
+ static bool IsTailCallEliminationEnabled(Isolate* isolate);
284
+ static void SetTailCallEliminationEnabled(Isolate* isolate, bool enabled);
279
285
  };
280
286
 
281
287
 
@@ -10,7 +10,7 @@
10
10
  #ifndef V8_INCLUDE_V8_EXPERIMENTAL_H_
11
11
  #define V8_INCLUDE_V8_EXPERIMENTAL_H_
12
12
 
13
- #include "include/v8.h"
13
+ #include "v8.h" // NOLINT(build/include)
14
14
 
15
15
  namespace v8 {
16
16
  namespace experimental {
@@ -152,9 +152,9 @@ class Platform {
152
152
  */
153
153
  virtual uint64_t AddTraceEvent(
154
154
  char phase, const uint8_t* category_enabled_flag, const char* name,
155
- uint64_t id, uint64_t bind_id, int32_t num_args, const char** arg_names,
156
- const uint8_t* arg_types, const uint64_t* arg_values,
157
- unsigned int flags) {
155
+ const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
156
+ const char** arg_names, const uint8_t* arg_types,
157
+ const uint64_t* arg_values, unsigned int flags) {
158
158
  return 0;
159
159
  }
160
160
 
@@ -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 0
13
- #define V8_BUILD_NUMBER 71
14
- #define V8_PATCH_LEVEL 48
12
+ #define V8_MINOR_VERSION 1
13
+ #define V8_BUILD_NUMBER 281
14
+ #define V8_PATCH_LEVEL 59
15
15
 
16
16
  // Use 1 for candidates and 0 otherwise.
17
17
  // (Boolean macro values are not supported by all preprocessors.)
@@ -18,6 +18,8 @@
18
18
  #include <stddef.h>
19
19
  #include <stdint.h>
20
20
  #include <stdio.h>
21
+ #include <utility>
22
+ #include <vector>
21
23
 
22
24
  #include "v8-version.h" // NOLINT(build/include)
23
25
  #include "v8config.h" // NOLINT(build/include)
@@ -328,6 +330,8 @@ class Local {
328
330
  template <class F1, class F2, class F3>
329
331
  friend class PersistentValueMapBase;
330
332
  template<class F1, class F2> friend class PersistentValueVector;
333
+ template <class F>
334
+ friend class ReturnValue;
331
335
 
332
336
  explicit V8_INLINE Local(T* that) : val_(that) {}
333
337
  V8_INLINE static Local<T> New(Isolate* isolate, T* that);
@@ -593,6 +597,13 @@ template <class T> class PersistentBase {
593
597
  // TODO(dcarney): remove this.
594
598
  V8_INLINE void ClearWeak() { ClearWeak<void>(); }
595
599
 
600
+ /**
601
+ * Allows the embedder to tell the v8 garbage collector that a certain object
602
+ * is alive. Only allowed when the embedder is asked to trace its heap by
603
+ * EmbedderHeapTracer.
604
+ */
605
+ V8_INLINE void RegisterExternalReference(Isolate* isolate);
606
+
596
607
  /**
597
608
  * Marks the reference to this object independent. Garbage collector is free
598
609
  * to ignore any object groups containing this object. Weak callback for an
@@ -2628,6 +2639,10 @@ enum AccessControl {
2628
2639
  PROHIBITS_OVERWRITING = 1 << 2
2629
2640
  };
2630
2641
 
2642
+ /**
2643
+ * Integrity level for objects.
2644
+ */
2645
+ enum class IntegrityLevel { kFrozen, kSealed };
2631
2646
 
2632
2647
  /**
2633
2648
  * A JavaScript object (ECMA-262, 4.3.3)
@@ -2819,6 +2834,11 @@ class V8_EXPORT Object : public Value {
2819
2834
  */
2820
2835
  Local<String> GetConstructorName();
2821
2836
 
2837
+ /**
2838
+ * Sets the integrity level of the object.
2839
+ */
2840
+ Maybe<bool> SetIntegrityLevel(Local<Context> context, IntegrityLevel level);
2841
+
2822
2842
  /** Gets the number of internal fields for this Object. */
2823
2843
  int InternalFieldCount();
2824
2844
 
@@ -3118,12 +3138,17 @@ class ReturnValue {
3118
3138
  V8_INLINE void SetUndefined();
3119
3139
  V8_INLINE void SetEmptyString();
3120
3140
  // Convenience getter for Isolate
3121
- V8_INLINE Isolate* GetIsolate();
3141
+ V8_INLINE Isolate* GetIsolate() const;
3122
3142
 
3123
3143
  // Pointer setter: Uncompilable to prevent inadvertent misuse.
3124
3144
  template <typename S>
3125
3145
  V8_INLINE void Set(S* whatever);
3126
3146
 
3147
+ // Getter. Creates a new Local<> so it comes with a certain performance
3148
+ // hit. If the ReturnValue was not yet set, this will return the undefined
3149
+ // value.
3150
+ V8_INLINE Local<Value> Get() const;
3151
+
3127
3152
  private:
3128
3153
  template<class F> friend class ReturnValue;
3129
3154
  template<class F> friend class FunctionCallbackInfo;
@@ -4886,7 +4911,6 @@ V8_INLINE Local<Primitive> Null(Isolate* isolate);
4886
4911
  V8_INLINE Local<Boolean> True(Isolate* isolate);
4887
4912
  V8_INLINE Local<Boolean> False(Isolate* isolate);
4888
4913
 
4889
-
4890
4914
  /**
4891
4915
  * A set of constraints that specifies the limits of the runtime's memory use.
4892
4916
  * You must set the heap size before initializing the VM - the size cannot be
@@ -4895,6 +4919,9 @@ V8_INLINE Local<Boolean> False(Isolate* isolate);
4895
4919
  * If you are using threads then you should hold the V8::Locker lock while
4896
4920
  * setting the stack limit and you must set a non-default stack limit separately
4897
4921
  * for each thread.
4922
+ *
4923
+ * The arguments for set_max_semi_space_size, set_max_old_space_size,
4924
+ * set_max_executable_size, set_code_range_size specify limits in MB.
4898
4925
  */
4899
4926
  class V8_EXPORT ResourceConstraints {
4900
4927
  public:
@@ -4913,17 +4940,23 @@ class V8_EXPORT ResourceConstraints {
4913
4940
  uint64_t virtual_memory_limit);
4914
4941
 
4915
4942
  int max_semi_space_size() const { return max_semi_space_size_; }
4916
- void set_max_semi_space_size(int value) { max_semi_space_size_ = value; }
4943
+ void set_max_semi_space_size(int limit_in_mb) {
4944
+ max_semi_space_size_ = limit_in_mb;
4945
+ }
4917
4946
  int max_old_space_size() const { return max_old_space_size_; }
4918
- void set_max_old_space_size(int value) { max_old_space_size_ = value; }
4947
+ void set_max_old_space_size(int limit_in_mb) {
4948
+ max_old_space_size_ = limit_in_mb;
4949
+ }
4919
4950
  int max_executable_size() const { return max_executable_size_; }
4920
- void set_max_executable_size(int value) { max_executable_size_ = value; }
4951
+ void set_max_executable_size(int limit_in_mb) {
4952
+ max_executable_size_ = limit_in_mb;
4953
+ }
4921
4954
  uint32_t* stack_limit() const { return stack_limit_; }
4922
4955
  // Sets an address beyond which the VM's stack may not grow.
4923
4956
  void set_stack_limit(uint32_t* value) { stack_limit_ = value; }
4924
4957
  size_t code_range_size() const { return code_range_size_; }
4925
- void set_code_range_size(size_t value) {
4926
- code_range_size_ = value;
4958
+ void set_code_range_size(size_t limit_in_mb) {
4959
+ code_range_size_ = limit_in_mb;
4927
4960
  }
4928
4961
 
4929
4962
  private:
@@ -5047,9 +5080,57 @@ class PromiseRejectMessage {
5047
5080
 
5048
5081
  typedef void (*PromiseRejectCallback)(PromiseRejectMessage message);
5049
5082
 
5050
- // --- Microtask Callback ---
5083
+ // --- Microtasks Callbacks ---
5084
+ typedef void (*MicrotasksCompletedCallback)(Isolate*);
5051
5085
  typedef void (*MicrotaskCallback)(void* data);
5052
5086
 
5087
+
5088
+ /**
5089
+ * Policy for running microtasks:
5090
+ * - explicit: microtasks are invoked with Isolate::RunMicrotasks() method;
5091
+ * - scoped: microtasks invocation is controlled by MicrotasksScope objects;
5092
+ * - auto: microtasks are invoked when the script call depth decrements
5093
+ * to zero.
5094
+ */
5095
+ enum class MicrotasksPolicy { kExplicit, kScoped, kAuto };
5096
+
5097
+
5098
+ /**
5099
+ * This scope is used to control microtasks when kScopeMicrotasksInvocation
5100
+ * is used on Isolate. In this mode every non-primitive call to V8 should be
5101
+ * done inside some MicrotasksScope.
5102
+ * Microtasks are executed when topmost MicrotasksScope marked as kRunMicrotasks
5103
+ * exits.
5104
+ * kDoNotRunMicrotasks should be used to annotate calls not intended to trigger
5105
+ * microtasks.
5106
+ */
5107
+ class V8_EXPORT MicrotasksScope {
5108
+ public:
5109
+ enum Type { kRunMicrotasks, kDoNotRunMicrotasks };
5110
+
5111
+ MicrotasksScope(Isolate* isolate, Type type);
5112
+ ~MicrotasksScope();
5113
+
5114
+ /**
5115
+ * Runs microtasks if no kRunMicrotasks scope is currently active.
5116
+ */
5117
+ static void PerformCheckpoint(Isolate* isolate);
5118
+
5119
+ /**
5120
+ * Returns current depth of nested kRunMicrotasks scopes.
5121
+ */
5122
+ static int GetCurrentDepth(Isolate* isolate);
5123
+
5124
+ private:
5125
+ internal::Isolate* const isolate_;
5126
+ bool run_;
5127
+
5128
+ // Prevent copying.
5129
+ MicrotasksScope(const MicrotasksScope&);
5130
+ MicrotasksScope& operator=(const MicrotasksScope&);
5131
+ };
5132
+
5133
+
5053
5134
  // --- Failed Access Check Callback ---
5054
5135
  typedef void (*FailedAccessCheckCallback)(Local<Object> target,
5055
5136
  AccessType type,
@@ -5121,6 +5202,7 @@ class V8_EXPORT HeapStatistics {
5121
5202
  size_t total_available_size() { return total_available_size_; }
5122
5203
  size_t used_heap_size() { return used_heap_size_; }
5123
5204
  size_t heap_size_limit() { return heap_size_limit_; }
5205
+ size_t malloced_memory() { return malloced_memory_; }
5124
5206
  size_t does_zap_garbage() { return does_zap_garbage_; }
5125
5207
 
5126
5208
  private:
@@ -5130,6 +5212,7 @@ class V8_EXPORT HeapStatistics {
5130
5212
  size_t total_available_size_;
5131
5213
  size_t used_heap_size_;
5132
5214
  size_t heap_size_limit_;
5215
+ size_t malloced_memory_;
5133
5216
  bool does_zap_garbage_;
5134
5217
 
5135
5218
  friend class V8;
@@ -5294,6 +5377,52 @@ class V8_EXPORT PersistentHandleVisitor { // NOLINT
5294
5377
  uint16_t class_id) {}
5295
5378
  };
5296
5379
 
5380
+ /**
5381
+ * Memory pressure level for the MemoryPressureNotification.
5382
+ * kNone hints V8 that there is no memory pressure.
5383
+ * kModerate hints V8 to speed up incremental garbage collection at the cost of
5384
+ * of higher latency due to garbage collection pauses.
5385
+ * kCritical hints V8 to free memory as soon as possible. Garbage collection
5386
+ * pauses at this level will be large.
5387
+ */
5388
+ enum class MemoryPressureLevel { kNone, kModerate, kCritical };
5389
+
5390
+ /**
5391
+ * Interface for tracing through the embedder heap. During the v8 garbage
5392
+ * collection, v8 collects hidden fields of all potential wrappers, and at the
5393
+ * end of its marking phase iterates the collection and asks the embedder to
5394
+ * trace through its heap and call PersistentBase::RegisterExternalReference on
5395
+ * each js object reachable from any of the given wrappers.
5396
+ *
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.
5400
+ */
5401
+ class EmbedderHeapTracer {
5402
+ public:
5403
+ /**
5404
+ * V8 will call this method at the beginning of the gc cycle.
5405
+ */
5406
+ virtual void TraceRoots(Isolate* isolate) = 0;
5407
+
5408
+ /**
5409
+ * V8 will call this method with internal fields of a potential wrappers.
5410
+ * Embedder is expected to trace its heap (synchronously) and call
5411
+ * PersistentBase::RegisterExternalReference() on all wrappers reachable from
5412
+ * any of the given wrappers.
5413
+ */
5414
+ virtual void TraceWrappableFrom(
5415
+ Isolate* isolate,
5416
+ const std::vector<std::pair<void*, void*> >& internal_fields) = 0;
5417
+ /**
5418
+ * V8 will call this method at the end of the gc cycle. Allocation is *not*
5419
+ * allowed in the ClearTracingMarks.
5420
+ */
5421
+ virtual void ClearTracingMarks(Isolate* isolate) = 0;
5422
+
5423
+ protected:
5424
+ virtual ~EmbedderHeapTracer() = default;
5425
+ };
5297
5426
 
5298
5427
  /**
5299
5428
  * Isolate represents an isolated instance of the V8 engine. V8 isolates have
@@ -5489,6 +5618,9 @@ class V8_EXPORT Isolate {
5489
5618
  kArrayPrototypeConstructorModified = 26,
5490
5619
  kArrayInstanceProtoModified = 27,
5491
5620
  kArrayInstanceConstructorModified = 28,
5621
+ kLegacyFunctionDeclaration = 29,
5622
+ kRegExpPrototypeSourceGetter = 30,
5623
+ kRegExpPrototypeOldFlagGetter = 31,
5492
5624
 
5493
5625
  // If you add new values here, you'll also need to update V8Initializer.cpp
5494
5626
  // in Chromium.
@@ -5531,6 +5663,14 @@ class V8_EXPORT Isolate {
5531
5663
  void SetAbortOnUncaughtExceptionCallback(
5532
5664
  AbortOnUncaughtExceptionCallback callback);
5533
5665
 
5666
+ /**
5667
+ * Optional notification that the system is running low on memory.
5668
+ * V8 uses these notifications to guide heuristics.
5669
+ * It is allowed to call this function from another thread while
5670
+ * the isolate is executing long running JavaScript code.
5671
+ */
5672
+ void MemoryPressureNotification(MemoryPressureLevel level);
5673
+
5534
5674
  /**
5535
5675
  * Methods below this point require holding a lock (using Locker) in
5536
5676
  * a multi-threaded environment.
@@ -5752,6 +5892,11 @@ class V8_EXPORT Isolate {
5752
5892
  */
5753
5893
  void RemoveGCPrologueCallback(GCCallback callback);
5754
5894
 
5895
+ /**
5896
+ * Sets the embedder heap tracer for the isolate.
5897
+ */
5898
+ void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer);
5899
+
5755
5900
  /**
5756
5901
  * Enables the host application to receive a notification after a
5757
5902
  * garbage collection. Allocations are allowed in the callback function,
@@ -5888,17 +6033,39 @@ class V8_EXPORT Isolate {
5888
6033
  */
5889
6034
  void EnqueueMicrotask(MicrotaskCallback microtask, void* data = NULL);
5890
6035
 
5891
- /**
5892
- * Experimental: Controls whether the Microtask Work Queue is automatically
5893
- * run when the script call depth decrements to zero.
6036
+ /**
6037
+ * Experimental: Controls how Microtasks are invoked. See MicrotasksPolicy
6038
+ * for details.
5894
6039
  */
5895
- void SetAutorunMicrotasks(bool autorun);
6040
+ void SetMicrotasksPolicy(MicrotasksPolicy policy);
6041
+ V8_DEPRECATE_SOON("Use SetMicrotasksPolicy",
6042
+ void SetAutorunMicrotasks(bool autorun));
5896
6043
 
5897
6044
  /**
5898
- * Experimental: Returns whether the Microtask Work Queue is automatically
5899
- * run when the script call depth decrements to zero.
6045
+ * Experimental: Returns the policy controlling how Microtasks are invoked.
5900
6046
  */
5901
- bool WillAutorunMicrotasks() const;
6047
+ MicrotasksPolicy GetMicrotasksPolicy() const;
6048
+ V8_DEPRECATE_SOON("Use GetMicrotasksPolicy",
6049
+ bool WillAutorunMicrotasks() const);
6050
+
6051
+ /**
6052
+ * Experimental: adds a callback to notify the host application after
6053
+ * microtasks were run. The callback is triggered by explicit RunMicrotasks
6054
+ * call or automatic microtasks execution (see SetAutorunMicrotasks).
6055
+ *
6056
+ * Callback will trigger even if microtasks were attempted to run,
6057
+ * but the microtasks queue was empty and no single microtask was actually
6058
+ * executed.
6059
+ *
6060
+ * Executing scriptsinside the callback will not re-trigger microtasks and
6061
+ * the callback.
6062
+ */
6063
+ void AddMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
6064
+
6065
+ /**
6066
+ * Removes callback that was installed by AddMicrotasksCompletedCallback.
6067
+ */
6068
+ void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallback callback);
5902
6069
 
5903
6070
  /**
5904
6071
  * Sets a callback for counting the number of times a feature of V8 is used.
@@ -6195,11 +6362,23 @@ class V8_EXPORT V8 {
6195
6362
  static void SetSnapshotDataBlob(StartupData* startup_blob);
6196
6363
 
6197
6364
  /**
6198
- * Create a new isolate and context for the purpose of capturing a snapshot
6365
+ * Bootstrap an isolate and a context from scratch to create a startup
6366
+ * snapshot. Include the side-effects of running the optional script.
6199
6367
  * Returns { NULL, 0 } on failure.
6200
- * The caller owns the data array in the return value.
6368
+ * The caller acquires ownership of the data array in the return value.
6201
6369
  */
6202
- static StartupData CreateSnapshotDataBlob(const char* custom_source = NULL);
6370
+ static StartupData CreateSnapshotDataBlob(const char* embedded_source = NULL);
6371
+
6372
+ /**
6373
+ * Bootstrap an isolate and a context from the cold startup blob, run the
6374
+ * warm-up script to trigger code compilation. The side effects are then
6375
+ * discarded. The resulting startup snapshot will include compiled code.
6376
+ * Returns { NULL, 0 } on failure.
6377
+ * The caller acquires ownership of the data array in the return value.
6378
+ * The argument startup blob is untouched.
6379
+ */
6380
+ static StartupData WarmUpSnapshotDataBlob(StartupData cold_startup_blob,
6381
+ const char* warmup_source);
6203
6382
 
6204
6383
  /**
6205
6384
  * Adds a message listener.
@@ -6475,6 +6654,8 @@ class V8_EXPORT V8 {
6475
6654
  static internal::Object** CopyPersistent(internal::Object** handle);
6476
6655
  static void DisposeGlobal(internal::Object** global_handle);
6477
6656
  typedef WeakCallbackData<Value, void>::Callback WeakCallback;
6657
+ static void RegisterExternallyReferencedObject(internal::Object** object,
6658
+ internal::Isolate* isolate);
6478
6659
  static void MakeWeak(internal::Object** global_handle, void* data,
6479
6660
  WeakCallback weak_callback);
6480
6661
  static void MakeWeak(internal::Object** global_handle, void* data,
@@ -7149,7 +7330,7 @@ class Internals {
7149
7330
  1 * kApiPointerSize + kApiIntSize;
7150
7331
  static const int kStringResourceOffset = 3 * kApiPointerSize;
7151
7332
 
7152
- static const int kOddballKindOffset = 4 * kApiPointerSize;
7333
+ static const int kOddballKindOffset = 5 * kApiPointerSize;
7153
7334
  static const int kForeignAddressOffset = kApiPointerSize;
7154
7335
  static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
7155
7336
  static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
@@ -7168,11 +7349,12 @@ class Internals {
7168
7349
  static const int kIsolateRootsOffset =
7169
7350
  kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset + kApiInt64Size +
7170
7351
  kApiPointerSize;
7171
- static const int kUndefinedValueRootIndex = 5;
7172
- static const int kNullValueRootIndex = 7;
7173
- static const int kTrueValueRootIndex = 8;
7174
- static const int kFalseValueRootIndex = 9;
7175
- static const int kEmptyStringRootIndex = 10;
7352
+ static const int kUndefinedValueRootIndex = 4;
7353
+ static const int kTheHoleValueRootIndex = 5;
7354
+ static const int kNullValueRootIndex = 6;
7355
+ static const int kTrueValueRootIndex = 7;
7356
+ static const int kFalseValueRootIndex = 8;
7357
+ static const int kEmptyStringRootIndex = 9;
7176
7358
 
7177
7359
  // The external allocation limit should be below 256 MB on all architectures
7178
7360
  // to avoid that resource-constrained embedders run low on memory.
@@ -7188,7 +7370,7 @@ class Internals {
7188
7370
  static const int kNodeIsPartiallyDependentShift = 4;
7189
7371
  static const int kNodeIsActiveShift = 4;
7190
7372
 
7191
- static const int kJSObjectType = 0xb5;
7373
+ static const int kJSObjectType = 0xb8;
7192
7374
  static const int kFirstNonstringType = 0x80;
7193
7375
  static const int kOddballType = 0x83;
7194
7376
  static const int kForeignType = 0x87;
@@ -7492,6 +7674,13 @@ P* PersistentBase<T>::ClearWeak() {
7492
7674
  V8::ClearWeak(reinterpret_cast<internal::Object**>(this->val_)));
7493
7675
  }
7494
7676
 
7677
+ template <class T>
7678
+ void PersistentBase<T>::RegisterExternalReference(Isolate* isolate) {
7679
+ if (IsEmpty()) return;
7680
+ V8::RegisterExternallyReferencedObject(
7681
+ reinterpret_cast<internal::Object**>(this->val_),
7682
+ reinterpret_cast<internal::Isolate*>(isolate));
7683
+ }
7495
7684
 
7496
7685
  template <class T>
7497
7686
  void PersistentBase<T>::MarkIndependent() {
@@ -7641,14 +7830,22 @@ void ReturnValue<T>::SetEmptyString() {
7641
7830
  *value_ = *I::GetRoot(GetIsolate(), I::kEmptyStringRootIndex);
7642
7831
  }
7643
7832
 
7644
- template<typename T>
7645
- Isolate* ReturnValue<T>::GetIsolate() {
7833
+ template <typename T>
7834
+ Isolate* ReturnValue<T>::GetIsolate() const {
7646
7835
  // Isolate is always the pointer below the default value on the stack.
7647
7836
  return *reinterpret_cast<Isolate**>(&value_[-2]);
7648
7837
  }
7649
7838
 
7650
- template<typename T>
7651
- template<typename S>
7839
+ template <typename T>
7840
+ Local<Value> ReturnValue<T>::Get() const {
7841
+ typedef internal::Internals I;
7842
+ if (*value_ == *I::GetRoot(GetIsolate(), I::kTheHoleValueRootIndex))
7843
+ return Local<Value>(*Undefined(GetIsolate()));
7844
+ return Local<Value>::New(GetIsolate(), reinterpret_cast<Value*>(value_));
7845
+ }
7846
+
7847
+ template <typename T>
7848
+ template <typename S>
7652
7849
  void ReturnValue<T>::Set(S* whatever) {
7653
7850
  // Uncompilable to prevent inadvertent misuse.
7654
7851
  TYPE_CHECK(S*, Primitive);
@@ -266,13 +266,7 @@
266
266
  # define V8_HAS_BUILTIN_FRAME_ADDRESS (V8_GNUC_PREREQ(2, 96, 0))
267
267
  # define V8_HAS_BUILTIN_POPCOUNT (V8_GNUC_PREREQ(3, 4, 0))
268
268
 
269
- // g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality
270
- // without warnings (functionality used by the macros below). These modes
271
- // are detectable by checking whether __GXX_EXPERIMENTAL_CXX0X__ is defined or,
272
- // more standardly, by checking whether __cplusplus has a C++11 or greater
273
- // value. Current versions of g++ do not correctly set __cplusplus, so we check
274
- // both for forward compatibility.
275
- # if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
269
+ # if __cplusplus >= 201103L
276
270
  # define V8_HAS_CXX11_ALIGNAS (V8_GNUC_PREREQ(4, 8, 0))
277
271
  # define V8_HAS_CXX11_ALIGNOF (V8_GNUC_PREREQ(4, 8, 0))
278
272
  # endif
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.0.71.48.3
4
+ version: 5.1.281.59.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-05-14 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake