libv8 5.0.71.48.3-x86-linux → 5.1.281.59.1-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: af5d2946925993edd48e3725047f606194f48e15
4
+ data.tar.gz: 491454910554a5b9947d33c9b47fd57a4afe7170
5
+ SHA512:
6
+ metadata.gz: 355164e30e955bbf46335916cd576b6bcaa44a93c18e15b31fa45d45c40bee576be7570aa036444fd71817118b5c0e4905dc8481156d511c6bc3cb66f07aee2b
7
+ data.tar.gz: b7839e465ca0386860480f743b4256c1e50837188957f3bcd9280222d08a5579e14b4f39c527facd31dc1cabba1b7c20cda6be90d69d54462e05be2daebc59ea
@@ -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,62 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libv8
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.71.48.3
5
- prerelease:
4
+ version: 5.1.281.59.1
6
5
  platform: x86-linux
7
6
  authors:
8
7
  - Charles Lowell
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2016-05-14 00:00:00.000000000 Z
11
+ date: 2016-06-15 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rake
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '11'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '11'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake-compiler
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
47
  version: '3'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
54
  version: '3'
62
55
  description: Distributes the V8 JavaScript engine in binary and source forms in order
@@ -67,62 +60,55 @@ executables: []
67
60
  extensions: []
68
61
  extra_rdoc_files: []
69
62
  files:
70
- - lib/libv8.rb
71
- - lib/libv8/version.rb
63
+ - ext/libv8/.location.yml
72
64
  - ext/libv8/arch.rb
73
65
  - ext/libv8/location.rb
74
66
  - ext/libv8/paths.rb
75
- - ext/libv8/.location.yml
76
- - vendor/v8/include/v8-platform.h
77
- - vendor/v8/include/v8.h
67
+ - lib/libv8.rb
68
+ - lib/libv8/version.rb
78
69
  - vendor/v8/include/libplatform/libplatform.h
79
- - vendor/v8/include/v8config.h
80
- - vendor/v8/include/v8-version.h
81
- - vendor/v8/include/v8-util.h
82
- - vendor/v8/include/v8-testing.h
70
+ - vendor/v8/include/v8-debug.h
83
71
  - vendor/v8/include/v8-experimental.h
72
+ - vendor/v8/include/v8-platform.h
84
73
  - vendor/v8/include/v8-profiler.h
85
- - vendor/v8/include/v8-debug.h
74
+ - vendor/v8/include/v8-testing.h
75
+ - vendor/v8/include/v8-util.h
76
+ - vendor/v8/include/v8-version.h
77
+ - vendor/v8/include/v8.h
78
+ - vendor/v8/include/v8config.h
79
+ - vendor/v8/out/ia32.release/libv8_base.a
86
80
  - vendor/v8/out/ia32.release/libv8_libbase.a
87
- - vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_libbase.a
88
- - vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_snapshot.a
89
- - vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_nosnapshot.a
81
+ - vendor/v8/out/ia32.release/libv8_libplatform.a
82
+ - vendor/v8/out/ia32.release/libv8_nosnapshot.a
83
+ - vendor/v8/out/ia32.release/libv8_snapshot.a
90
84
  - vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a
85
+ - vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_libbase.a
91
86
  - vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_libplatform.a
92
- - vendor/v8/out/ia32.release/libv8_snapshot.a
93
- - vendor/v8/out/ia32.release/libv8_nosnapshot.a
94
- - vendor/v8/out/ia32.release/libv8_base.a
95
- - vendor/v8/out/ia32.release/libv8_libplatform.a
87
+ - vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_nosnapshot.a
88
+ - vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_snapshot.a
96
89
  homepage: http://github.com/cowboyd/libv8
97
90
  licenses:
98
91
  - MIT
92
+ metadata: {}
99
93
  post_install_message:
100
94
  rdoc_options: []
101
95
  require_paths:
102
96
  - lib
103
97
  - ext
104
98
  required_ruby_version: !ruby/object:Gem::Requirement
105
- none: false
106
99
  requirements:
107
- - - ! '>='
100
+ - - ">="
108
101
  - !ruby/object:Gem::Version
109
102
  version: '0'
110
- segments:
111
- - 0
112
- hash: 642477261
113
103
  required_rubygems_version: !ruby/object:Gem::Requirement
114
- none: false
115
104
  requirements:
116
- - - ! '>='
105
+ - - ">="
117
106
  - !ruby/object:Gem::Version
118
107
  version: '0'
119
- segments:
120
- - 0
121
- hash: 642477261
122
108
  requirements: []
123
109
  rubyforge_project: libv8
124
- rubygems_version: 1.8.23
110
+ rubygems_version: 2.5.1
125
111
  signing_key:
126
- specification_version: 3
112
+ specification_version: 4
127
113
  summary: Distribution of the V8 JavaScript engine
128
114
  test_files: []