libv8 3.16.14.19-arm-linux → 5.0.71.48.3-arm-linux

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bd4ead52e280db292ea797aaf39611ee4ae020fb
4
+ data.tar.gz: 32526d9da9280ba5dd38c45f0a4326addce100e6
5
+ SHA512:
6
+ metadata.gz: 1fc434dec0caedd6347b1350003afcb51699b93d7312334f8680c9438bc06a27a73c09f5162c6c255240b780022c9eb2642cdff2d7528e7562f35178fba49250
7
+ data.tar.gz: 096ebfc0cb613c7806996443e63bd079eef93def55c0c1bf9477a2cb18d5b701b7e48d4da71e523123981ade083d412745c387ebf366652254b37d29ee80fa02
data/ext/libv8/arch.rb CHANGED
@@ -1,42 +1,19 @@
1
- require 'rbconfig'
1
+ require 'rubygems'
2
2
 
3
3
  module Libv8
4
4
  module Arch
5
5
  module_function
6
6
 
7
- def x86_64_from_build_cpu
8
- RbConfig::MAKEFILE_CONFIG['build_cpu'] == 'x86_64'
9
- end
10
-
11
- def x86_64_from_byte_length
12
- ['foo'].pack('p').size == 8
13
- end
14
-
15
- def x86_64_from_arch_flag
16
- RbConfig::MAKEFILE_CONFIG['ARCH_FLAG'] =~ /x86_64/
17
- end
18
-
19
- def rubinius?
20
- Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "rbx"
21
- end
22
-
23
- # TODO fix false positive on 64-bit ARM
24
- def x64?
25
- if rubinius?
26
- x86_64_from_build_cpu || x86_64_from_arch_flag
27
- else
28
- x86_64_from_byte_length
29
- end
30
- end
31
-
32
- def arm?
33
- RbConfig::MAKEFILE_CONFIG['build_cpu'] =~ /^arm/
34
- end
35
-
36
7
  def libv8_arch
37
- if arm? then "arm"
38
- elsif x64? then "x64"
39
- else "ia32"
8
+ case Gem::Platform.local.cpu
9
+ when /^arm$/ then 'arm'
10
+ when /^a(rm|arch)64$/ then 'arm64'
11
+ when /^x86$/ then 'ia32'
12
+ when /^(x86_64|amd64)$/ then 'x64'
13
+ when /^universal$/ then 'x64' # OS X
14
+ else
15
+ warn "Unsupported target: #{Gem::Platform.local.cpu}"
16
+ Gem::Platform.local.cpu
40
17
  end
41
18
  end
42
19
  end
@@ -32,11 +32,15 @@ module Libv8
32
32
  end
33
33
 
34
34
  def verify_installation!
35
+ 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}"
38
+ end
35
39
  Libv8::Paths.object_paths.each do |p|
36
40
  fail ArchiveNotFound, p unless File.exist? p
37
41
  end
38
42
  end
39
-
43
+ class HeaderNotFound < StandardError; end
40
44
  class ArchiveNotFound < StandardError
41
45
  def initialize(filename)
42
46
  super "libv8 did not install properly, expected binary v8 archive '#{filename}'to exist, but it was not found"
@@ -48,6 +52,7 @@ module Libv8
48
52
  def configure(context = MkmfContext.new)
49
53
  context.send(:dir_config, 'v8')
50
54
  context.send(:find_header, 'v8.h') or fail NotFoundError
55
+ context.send(:find_header, 'libplatform/libplatform.h') or fail NotFoundError
51
56
  context.send(:have_library, 'v8') or fail NotFoundError
52
57
  end
53
58
 
data/ext/libv8/paths.rb CHANGED
@@ -7,12 +7,12 @@ module Libv8
7
7
  module_function
8
8
 
9
9
  def include_paths
10
- [Shellwords.escape("#{vendored_source_path}/include")]
10
+ [Shellwords.escape(vendored_source_path)]
11
11
  end
12
12
 
13
13
  def object_paths
14
- [libv8_object(:base), libv8_object(:snapshot)].map do |path|
15
- Shellwords.escape path
14
+ [:base, :libplatform, :libbase, :snapshot].map do |name|
15
+ Shellwords.escape libv8_object(name)
16
16
  end
17
17
  end
18
18
 
data/lib/libv8/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Libv8
2
- VERSION = "3.16.14.19"
2
+ VERSION = "5.0.71.48.3"
3
3
  end
@@ -0,0 +1,38 @@
1
+ // Copyright 2014 the V8 project authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ #ifndef V8_LIBPLATFORM_LIBPLATFORM_H_
6
+ #define V8_LIBPLATFORM_LIBPLATFORM_H_
7
+
8
+ #include "include/v8-platform.h"
9
+
10
+ namespace v8 {
11
+ namespace platform {
12
+
13
+ /**
14
+ * Returns a new instance of the default v8::Platform implementation.
15
+ *
16
+ * The caller will take ownership of the returned pointer. |thread_pool_size|
17
+ * is the number of worker threads to allocate for background jobs. If a value
18
+ * of zero is passed, a suitable default based on the current number of
19
+ * processors online will be chosen.
20
+ */
21
+ v8::Platform* CreateDefaultPlatform(int thread_pool_size = 0);
22
+
23
+
24
+ /**
25
+ * Pumps the message loop for the given isolate.
26
+ *
27
+ * The caller has to make sure that this is called from the right thread.
28
+ * Returns true if a task was executed, and false otherwise. This call does
29
+ * not block if no task is pending. The |platform| has to be created using
30
+ * |CreateDefaultPlatform|.
31
+ */
32
+ bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate);
33
+
34
+
35
+ } // namespace platform
36
+ } // namespace v8
37
+
38
+ #endif // V8_LIBPLATFORM_LIBPLATFORM_H_
@@ -1,68 +1,11 @@
1
1
  // Copyright 2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
27
4
 
28
5
  #ifndef V8_V8_DEBUG_H_
29
6
  #define V8_V8_DEBUG_H_
30
7
 
31
- #include "v8.h"
32
-
33
- #ifdef _WIN32
34
- typedef int int32_t;
35
- typedef unsigned int uint32_t;
36
- typedef unsigned short uint16_t; // NOLINT
37
- typedef long long int64_t; // NOLINT
38
-
39
- // Setup for Windows DLL export/import. See v8.h in this directory for
40
- // information on how to build/use V8 as a DLL.
41
- #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
42
- #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
43
- build configuration to ensure that at most one of these is set
44
- #endif
45
-
46
- #ifdef BUILDING_V8_SHARED
47
- #define EXPORT __declspec(dllexport)
48
- #elif USING_V8_SHARED
49
- #define EXPORT __declspec(dllimport)
50
- #else
51
- #define EXPORT
52
- #endif
53
-
54
- #else // _WIN32
55
-
56
- // Setup for Linux shared library export. See v8.h in this directory for
57
- // information on how to build/use V8 as shared library.
58
- #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED)
59
- #define EXPORT __attribute__ ((visibility("default")))
60
- #else // defined(__GNUC__) && (__GNUC__ >= 4)
61
- #define EXPORT
62
- #endif // defined(__GNUC__) && (__GNUC__ >= 4)
63
-
64
- #endif // _WIN32
65
-
8
+ #include "v8.h" // NOLINT(build/include)
66
9
 
67
10
  /**
68
11
  * Debugger support for the V8 JavaScript engine.
@@ -76,12 +19,13 @@ enum DebugEvent {
76
19
  NewFunction = 3,
77
20
  BeforeCompile = 4,
78
21
  AfterCompile = 5,
79
- ScriptCollected = 6,
80
- BreakForCommand = 7
22
+ CompileError = 6,
23
+ PromiseEvent = 7,
24
+ AsyncTaskEvent = 8,
81
25
  };
82
26
 
83
27
 
84
- class EXPORT Debug {
28
+ class V8_EXPORT Debug {
85
29
  public:
86
30
  /**
87
31
  * A client object passed to the v8 debugger whose ownership will be taken by
@@ -116,20 +60,20 @@ class EXPORT Debug {
116
60
  * callbacks as their content becomes invalid. These objects are from the
117
61
  * debugger event that started the debug message loop.
118
62
  */
119
- virtual Handle<Object> GetExecutionState() const = 0;
120
- virtual Handle<Object> GetEventData() const = 0;
63
+ virtual Local<Object> GetExecutionState() const = 0;
64
+ virtual Local<Object> GetEventData() const = 0;
121
65
 
122
66
  /**
123
67
  * Get the debugger protocol JSON.
124
68
  */
125
- virtual Handle<String> GetJSON() const = 0;
69
+ virtual Local<String> GetJSON() const = 0;
126
70
 
127
71
  /**
128
72
  * Get the context active when the debug event happened. Note this is not
129
73
  * the current active context as the JavaScript part of the debugger is
130
74
  * running in its own context which is entered at this point.
131
75
  */
132
- virtual Handle<Context> GetEventContext() const = 0;
76
+ virtual Local<Context> GetEventContext() const = 0;
133
77
 
134
78
  /**
135
79
  * Client data passed with the corresponding request if any. This is the
@@ -140,6 +84,8 @@ class EXPORT Debug {
140
84
  */
141
85
  virtual ClientData* GetClientData() const = 0;
142
86
 
87
+ virtual Isolate* GetIsolate() const = 0;
88
+
143
89
  virtual ~Message() {}
144
90
  };
145
91
 
@@ -158,21 +104,21 @@ class EXPORT Debug {
158
104
  * Access to execution state and event data of the debug event. Don't store
159
105
  * these cross callbacks as their content becomes invalid.
160
106
  */
161
- virtual Handle<Object> GetExecutionState() const = 0;
162
- virtual Handle<Object> GetEventData() const = 0;
107
+ virtual Local<Object> GetExecutionState() const = 0;
108
+ virtual Local<Object> GetEventData() const = 0;
163
109
 
164
110
  /**
165
111
  * Get the context active when the debug event happened. Note this is not
166
112
  * the current active context as the JavaScript part of the debugger is
167
113
  * running in its own context which is entered at this point.
168
114
  */
169
- virtual Handle<Context> GetEventContext() const = 0;
115
+ virtual Local<Context> GetEventContext() const = 0;
170
116
 
171
117
  /**
172
118
  * Client data passed with the corresponding callback when it was
173
119
  * registered.
174
120
  */
175
- virtual Handle<Value> GetCallbackData() const = 0;
121
+ virtual Local<Value> GetCallbackData() const = 0;
176
122
 
177
123
  /**
178
124
  * Client data passed to DebugBreakForCommand function. The
@@ -184,21 +130,6 @@ class EXPORT Debug {
184
130
  virtual ~EventDetails() {}
185
131
  };
186
132
 
187
-
188
- /**
189
- * Debug event callback function.
190
- *
191
- * \param event the type of the debug event that triggered the callback
192
- * (enum DebugEvent)
193
- * \param exec_state execution state (JavaScript object)
194
- * \param event_data event specific data (JavaScript object)
195
- * \param data value passed by the user to SetDebugEventListener
196
- */
197
- typedef void (*EventCallback)(DebugEvent event,
198
- Handle<Object> exec_state,
199
- Handle<Object> event_data,
200
- Handle<Value> data);
201
-
202
133
  /**
203
134
  * Debug event callback function.
204
135
  *
@@ -207,100 +138,48 @@ class EXPORT Debug {
207
138
  * A EventCallback2 does not take possession of the event data,
208
139
  * and must not rely on the data persisting after the handler returns.
209
140
  */
210
- typedef void (*EventCallback2)(const EventDetails& event_details);
211
-
212
- /**
213
- * Debug message callback function.
214
- *
215
- * \param message the debug message handler message object
216
- * \param length length of the message
217
- * \param client_data the data value passed when registering the message handler
218
-
219
- * A MessageHandler does not take possession of the message string,
220
- * and must not rely on the data persisting after the handler returns.
221
- *
222
- * This message handler is deprecated. Use MessageHandler2 instead.
223
- */
224
- typedef void (*MessageHandler)(const uint16_t* message, int length,
225
- ClientData* client_data);
141
+ typedef void (*EventCallback)(const EventDetails& event_details);
226
142
 
227
143
  /**
228
144
  * Debug message callback function.
229
145
  *
230
146
  * \param message the debug message handler message object
231
147
  *
232
- * A MessageHandler does not take possession of the message data,
148
+ * A MessageHandler2 does not take possession of the message data,
233
149
  * and must not rely on the data persisting after the handler returns.
234
150
  */
235
- typedef void (*MessageHandler2)(const Message& message);
236
-
237
- /**
238
- * Debug host dispatch callback function.
239
- */
240
- typedef void (*HostDispatchHandler)();
151
+ typedef void (*MessageHandler)(const Message& message);
241
152
 
242
153
  /**
243
154
  * Callback function for the host to ensure debug messages are processed.
244
155
  */
245
156
  typedef void (*DebugMessageDispatchHandler)();
246
157
 
247
- // Set a C debug event listener.
248
- static bool SetDebugEventListener(EventCallback that,
249
- Handle<Value> data = Handle<Value>());
250
- static bool SetDebugEventListener2(EventCallback2 that,
251
- Handle<Value> data = Handle<Value>());
252
-
253
- // Set a JavaScript debug event listener.
254
- static bool SetDebugEventListener(v8::Handle<v8::Object> that,
255
- Handle<Value> data = Handle<Value>());
158
+ static bool SetDebugEventListener(Isolate* isolate, EventCallback that,
159
+ Local<Value> data = Local<Value>());
160
+ V8_DEPRECATED("Use version with an Isolate",
161
+ static bool SetDebugEventListener(
162
+ EventCallback that, Local<Value> data = Local<Value>()));
256
163
 
257
164
  // Schedule a debugger break to happen when JavaScript code is run
258
- // in the given isolate. If no isolate is provided the default
259
- // isolate is used.
260
- static void DebugBreak(Isolate* isolate = NULL);
165
+ // in the given isolate.
166
+ static void DebugBreak(Isolate* isolate);
261
167
 
262
168
  // Remove scheduled debugger break in given isolate if it has not
263
- // happened yet. If no isolate is provided the default isolate is
264
- // used.
265
- static void CancelDebugBreak(Isolate* isolate = NULL);
266
-
267
- // Break execution of JavaScript in the given isolate (this method
268
- // can be invoked from a non-VM thread) for further client command
269
- // execution on a VM thread. Client data is then passed in
270
- // EventDetails to EventCallback at the moment when the VM actually
271
- // stops. If no isolate is provided the default isolate is used.
272
- static void DebugBreakForCommand(ClientData* data = NULL,
273
- Isolate* isolate = NULL);
274
-
275
- // Message based interface. The message protocol is JSON. NOTE the message
276
- // handler thread is not supported any more parameter must be false.
277
- static void SetMessageHandler(MessageHandler handler,
278
- bool message_handler_thread = false);
279
- static void SetMessageHandler2(MessageHandler2 handler);
280
-
281
- // If no isolate is provided the default isolate is
282
- // used.
283
- static void SendCommand(const uint16_t* command, int length,
284
- ClientData* client_data = NULL,
285
- Isolate* isolate = NULL);
286
-
287
- // Dispatch interface.
288
- static void SetHostDispatchHandler(HostDispatchHandler handler,
289
- int period = 100);
169
+ // happened yet.
170
+ static void CancelDebugBreak(Isolate* isolate);
290
171
 
291
- /**
292
- * Register a callback function to be called when a debug message has been
293
- * received and is ready to be processed. For the debug messages to be
294
- * processed V8 needs to be entered, and in certain embedding scenarios this
295
- * callback can be used to make sure V8 is entered for the debug message to
296
- * be processed. Note that debug messages will only be processed if there is
297
- * a V8 break. This can happen automatically by using the option
298
- * --debugger-auto-break.
299
- * \param provide_locker requires that V8 acquires v8::Locker for you before
300
- * calling handler
301
- */
302
- static void SetDebugMessageDispatchHandler(
303
- DebugMessageDispatchHandler handler, bool provide_locker = false);
172
+ // Check if a debugger break is scheduled in the given isolate.
173
+ static bool CheckDebugBreak(Isolate* isolate);
174
+
175
+ // Message based interface. The message protocol is JSON.
176
+ static void SetMessageHandler(Isolate* isolate, MessageHandler handler);
177
+ V8_DEPRECATED("Use version with an Isolate",
178
+ static void SetMessageHandler(MessageHandler handler));
179
+
180
+ static void SendCommand(Isolate* isolate,
181
+ const uint16_t* command, int length,
182
+ ClientData* client_data = NULL);
304
183
 
305
184
  /**
306
185
  * Run a JavaScript function in the debugger.
@@ -320,29 +199,21 @@ class EXPORT Debug {
320
199
  * }
321
200
  * \endcode
322
201
  */
323
- static Local<Value> Call(v8::Handle<v8::Function> fun,
324
- Handle<Value> data = Handle<Value>());
202
+ static V8_DEPRECATED("Use maybe version",
203
+ Local<Value> Call(v8::Local<v8::Function> fun,
204
+ Local<Value> data = Local<Value>()));
205
+ // TODO(dcarney): data arg should be a MaybeLocal
206
+ static MaybeLocal<Value> Call(Local<Context> context,
207
+ v8::Local<v8::Function> fun,
208
+ Local<Value> data = Local<Value>());
325
209
 
326
210
  /**
327
211
  * Returns a mirror object for the given object.
328
212
  */
329
- static Local<Value> GetMirror(v8::Handle<v8::Value> obj);
330
-
331
- /**
332
- * Enable the V8 builtin debug agent. The debugger agent will listen on the
333
- * supplied TCP/IP port for remote debugger connection.
334
- * \param name the name of the embedding application
335
- * \param port the TCP/IP port to listen on
336
- * \param wait_for_connection whether V8 should pause on a first statement
337
- * allowing remote debugger to connect before anything interesting happened
338
- */
339
- static bool EnableAgent(const char* name, int port,
340
- bool wait_for_connection = false);
341
-
342
- /**
343
- * Disable the V8 builtin debug agent. The TCP/IP connection will be closed.
344
- */
345
- static void DisableAgent();
213
+ static V8_DEPRECATED("Use maybe version",
214
+ Local<Value> GetMirror(v8::Local<v8::Value> obj));
215
+ static MaybeLocal<Value> GetMirror(Local<Context> context,
216
+ v8::Local<v8::Value> obj);
346
217
 
347
218
  /**
348
219
  * Makes V8 process all pending debug messages.
@@ -354,7 +225,7 @@ class EXPORT Debug {
354
225
  *
355
226
  * Generally when message arrives V8 may be in one of 3 states:
356
227
  * 1. V8 is running script; V8 will automatically interrupt and process all
357
- * pending messages (however auto_break flag should be enabled);
228
+ * pending messages;
358
229
  * 2. V8 is suspended on debug breakpoint; in this state V8 is dedicated
359
230
  * to reading and processing debug messages;
360
231
  * 3. V8 is not running at all or has called some long-working C++ function;
@@ -362,10 +233,6 @@ class EXPORT Debug {
362
233
  * until V8 gets control again; however, embedding application may improve
363
234
  * this by manually calling this method.
364
235
  *
365
- * It makes sense to call this method whenever a new debug message arrived and
366
- * V8 is not already running. Method v8::Debug::SetDebugMessageDispatchHandler
367
- * should help with the former condition.
368
- *
369
236
  * Technically this method in many senses is equivalent to executing empty
370
237
  * script:
371
238
  * 1. It does nothing except for processing all pending debug messages.
@@ -379,15 +246,20 @@ class EXPORT Debug {
379
246
  * "Evaluate" debug command behavior currently is not specified in scope
380
247
  * of this method.
381
248
  */
382
- static void ProcessDebugMessages();
249
+ static void ProcessDebugMessages(Isolate* isolate);
250
+ V8_DEPRECATED("Use version with an Isolate",
251
+ static void ProcessDebugMessages());
383
252
 
384
253
  /**
385
254
  * Debugger is running in its own context which is entered while debugger
386
255
  * messages are being dispatched. This is an explicit getter for this
387
256
  * debugger context. Note that the content of the debugger context is subject
388
- * to change.
257
+ * to change. The Context exists only when the debugger is active, i.e. at
258
+ * least one DebugEventListener or MessageHandler is set.
389
259
  */
390
- static Local<Context> GetDebugContext();
260
+ static Local<Context> GetDebugContext(Isolate* isolate);
261
+ V8_DEPRECATED("Use version with an Isolate",
262
+ static Local<Context> GetDebugContext());
391
263
 
392
264
 
393
265
  /**
@@ -395,7 +267,15 @@ class EXPORT Debug {
395
267
  * (default Isolate if not provided). V8 will abort if LiveEdit is
396
268
  * unexpectedly used. LiveEdit is enabled by default.
397
269
  */
398
- static void SetLiveEditEnabled(bool enable, Isolate* isolate = NULL);
270
+ static void SetLiveEditEnabled(Isolate* isolate, bool enable);
271
+
272
+ /**
273
+ * Returns array of internal properties specific to the value type. Result has
274
+ * the following format: [<name>, <value>,...,<name>, <value>]. Result array
275
+ * will be allocated in the current context.
276
+ */
277
+ static MaybeLocal<Array> GetInternalProperties(Isolate* isolate,
278
+ Local<Value> value);
399
279
  };
400
280
 
401
281