libv8 3.16.14.19.1-armv7l-linux → 5.3.332.38.5-armv7l-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +5 -5
  2. data/ext/libv8/arch.rb +10 -33
  3. data/ext/libv8/location.rb +16 -8
  4. data/ext/libv8/paths.rb +3 -3
  5. data/lib/libv8/version.rb +1 -1
  6. data/vendor/v8/include/libplatform/libplatform.h +38 -0
  7. data/vendor/v8/include/v8-debug.h +84 -191
  8. data/vendor/v8/include/v8-experimental.h +54 -0
  9. data/vendor/v8/include/v8-platform.h +171 -0
  10. data/vendor/v8/include/v8-profiler.h +395 -188
  11. data/vendor/v8/include/v8-testing.h +5 -62
  12. data/vendor/v8/include/v8-util.h +654 -0
  13. data/vendor/v8/include/v8-version.h +20 -0
  14. data/vendor/v8/include/v8.h +6925 -2960
  15. data/vendor/v8/include/v8config.h +432 -0
  16. data/vendor/v8/out/arm.release/libv8_base.a +0 -0
  17. data/vendor/v8/out/arm.release/libv8_libbase.a +0 -0
  18. data/vendor/v8/out/arm.release/libv8_libplatform.a +0 -0
  19. data/vendor/v8/out/arm.release/libv8_libsampler.a +0 -0
  20. data/vendor/v8/out/arm.release/libv8_nosnapshot.a +0 -0
  21. data/vendor/v8/out/arm.release/libv8_snapshot.a +0 -0
  22. data/vendor/v8/out/arm.release/obj.target/src/libv8_base.a +0 -0
  23. data/vendor/v8/out/arm.release/obj.target/src/libv8_libbase.a +0 -0
  24. data/vendor/v8/out/arm.release/obj.target/src/libv8_libplatform.a +0 -0
  25. data/vendor/v8/out/arm.release/obj.target/src/libv8_libsampler.a +0 -0
  26. data/vendor/v8/out/arm.release/obj.target/src/libv8_nosnapshot.a +0 -0
  27. data/vendor/v8/out/arm.release/obj.target/src/libv8_snapshot.a +0 -0
  28. metadata +23 -25
  29. data/vendor/v8/include/v8-preparser.h +0 -118
  30. data/vendor/v8/include/v8stdint.h +0 -54
  31. data/vendor/v8/out/arm.release/obj.target/tools/gyp/libpreparser_lib.a +0 -0
  32. data/vendor/v8/out/arm.release/obj.target/tools/gyp/libv8_base.a +0 -0
  33. data/vendor/v8/out/arm.release/obj.target/tools/gyp/libv8_nosnapshot.a +0 -0
  34. data/vendor/v8/out/arm.release/obj.target/tools/gyp/libv8_snapshot.a +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 7e0251fdff0ec2cd25daa294eb0e63c7b5e9e7a6f4ea837848822578b80e7bf7
4
- data.tar.gz: daa72ef4060bea8555294470284dec2ef2f6ff5669348b05535d0a8c7fdd4c57
2
+ SHA1:
3
+ metadata.gz: 1e197707a85ae3614eb5e07d1011a4ed400f0af9
4
+ data.tar.gz: d5a1e1dc396c6f41f05d3c4e69552619ec01610d
5
5
  SHA512:
6
- metadata.gz: 1c7af35391f167908786546f40ab2003d1bb8294a7b830d195bc0ca3b549ee20d40f634411b10f6f116fe2ee58420864dc94bf72aee067546e040be17d8e2632
7
- data.tar.gz: a8867e321fe6b0c4f414cc6ecf8264ff7fe418ba10048c3cefec8c28887648767ff78c8b732b772092df39eadd676d9f01c5171bc391c4f92476178d3f20ee30
6
+ metadata.gz: 424d7cef08f7354b968f28f570eaeb8ef1e97b98d6892ae4023c12c448c2074e58c9692dcb45f074f6bac2651670bff5c0ef5946a65b0211f6daa76f1533d1d0
7
+ data.tar.gz: 07e90f7836ab1aa588f0df6a56a2759ecbf8a0c38eff7e3d687f05f0f8589a0429a90dbecb9c77eefb65487fbfb8df8e5561068773904e99b966d8bd0923e11a
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(v7.*)*$/ 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
@@ -13,7 +13,7 @@ module Libv8
13
13
 
14
14
  def self.load!
15
15
  File.open(Pathname(__FILE__).dirname.join('.location.yml')) do |f|
16
- YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(f) : YAML.load(f) # rubocop:disable Security/YAMLLoad
16
+ YAML.load f
17
17
  end
18
18
  end
19
19
 
@@ -26,17 +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!
36
+ include_paths = Libv8::Paths.include_paths
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}"
39
+ end
35
40
  Libv8::Paths.object_paths.each do |p|
36
41
  fail ArchiveNotFound, p unless File.exist? p
37
42
  end
38
43
  end
39
44
 
45
+ class HeaderNotFound < StandardError; end
46
+
40
47
  class ArchiveNotFound < StandardError
41
48
  def initialize(filename)
42
49
  super "libv8 did not install properly, expected binary v8 archive '#{filename}'to exist, but it was not found"
@@ -48,20 +55,21 @@ module Libv8
48
55
  def configure(context = MkmfContext.new)
49
56
  context.send(:dir_config, 'v8')
50
57
  context.send(:find_header, 'v8.h') or fail NotFoundError
58
+ context.send(:find_header, 'libplatform/libplatform.h') or fail NotFoundError
51
59
  context.send(:have_library, 'v8') or fail NotFoundError
52
60
  end
53
61
 
54
62
  class NotFoundError < StandardError
55
63
  def initialize(*args)
56
64
  super(<<-EOS)
57
- By using --with-system-v8, you have chosen to use the version
58
- of V8 found on your system and *not* the one that is bundled with
59
- 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.
60
68
 
61
- However, your system version of v8 could not be located.
69
+ However, your system version of v8 could not be located.
62
70
 
63
- Please make sure your system version of v8 that is compatible
64
- 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
65
73
  --with-v8-dir option if it is installed in a non-standard location
66
74
  EOS
67
75
  end
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(File.join(vendored_source_path, 'include'))]
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, :libsampler, :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.1"
2
+ VERSION = "5.3.332.38.5"
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 "v8-platform.h" // NOLINT(build/include)
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.
@@ -75,13 +18,12 @@ enum DebugEvent {
75
18
  Exception = 2,
76
19
  NewFunction = 3,
77
20
  BeforeCompile = 4,
78
- AfterCompile = 5,
79
- ScriptCollected = 6,
80
- BreakForCommand = 7
21
+ AfterCompile = 5,
22
+ CompileError = 6,
23
+ AsyncTaskEvent = 7,
81
24
  };
82
25
 
83
-
84
- class EXPORT Debug {
26
+ class V8_EXPORT Debug {
85
27
  public:
86
28
  /**
87
29
  * A client object passed to the v8 debugger whose ownership will be taken by
@@ -116,20 +58,20 @@ class EXPORT Debug {
116
58
  * callbacks as their content becomes invalid. These objects are from the
117
59
  * debugger event that started the debug message loop.
118
60
  */
119
- virtual Handle<Object> GetExecutionState() const = 0;
120
- virtual Handle<Object> GetEventData() const = 0;
61
+ virtual Local<Object> GetExecutionState() const = 0;
62
+ virtual Local<Object> GetEventData() const = 0;
121
63
 
122
64
  /**
123
65
  * Get the debugger protocol JSON.
124
66
  */
125
- virtual Handle<String> GetJSON() const = 0;
67
+ virtual Local<String> GetJSON() const = 0;
126
68
 
127
69
  /**
128
70
  * Get the context active when the debug event happened. Note this is not
129
71
  * the current active context as the JavaScript part of the debugger is
130
72
  * running in its own context which is entered at this point.
131
73
  */
132
- virtual Handle<Context> GetEventContext() const = 0;
74
+ virtual Local<Context> GetEventContext() const = 0;
133
75
 
134
76
  /**
135
77
  * Client data passed with the corresponding request if any. This is the
@@ -140,6 +82,8 @@ class EXPORT Debug {
140
82
  */
141
83
  virtual ClientData* GetClientData() const = 0;
142
84
 
85
+ virtual Isolate* GetIsolate() const = 0;
86
+
143
87
  virtual ~Message() {}
144
88
  };
145
89
 
@@ -158,21 +102,21 @@ class EXPORT Debug {
158
102
  * Access to execution state and event data of the debug event. Don't store
159
103
  * these cross callbacks as their content becomes invalid.
160
104
  */
161
- virtual Handle<Object> GetExecutionState() const = 0;
162
- virtual Handle<Object> GetEventData() const = 0;
105
+ virtual Local<Object> GetExecutionState() const = 0;
106
+ virtual Local<Object> GetEventData() const = 0;
163
107
 
164
108
  /**
165
109
  * Get the context active when the debug event happened. Note this is not
166
110
  * the current active context as the JavaScript part of the debugger is
167
111
  * running in its own context which is entered at this point.
168
112
  */
169
- virtual Handle<Context> GetEventContext() const = 0;
113
+ virtual Local<Context> GetEventContext() const = 0;
170
114
 
171
115
  /**
172
116
  * Client data passed with the corresponding callback when it was
173
117
  * registered.
174
118
  */
175
- virtual Handle<Value> GetCallbackData() const = 0;
119
+ virtual Local<Value> GetCallbackData() const = 0;
176
120
 
177
121
  /**
178
122
  * Client data passed to DebugBreakForCommand function. The
@@ -181,24 +125,11 @@ class EXPORT Debug {
181
125
  */
182
126
  virtual ClientData* GetClientData() const = 0;
183
127
 
128
+ virtual Isolate* GetIsolate() const = 0;
129
+
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);
141
+ typedef void (*EventCallback)(const EventDetails& event_details);
211
142
 
212
143
  /**
213
144
  * Debug message callback function.
214
145
  *
215
146
  * \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
147
  *
222
- * This message handler is deprecated. Use MessageHandler2 instead.
223
- */
224
- typedef void (*MessageHandler)(const uint16_t* message, int length,
225
- ClientData* client_data);
226
-
227
- /**
228
- * Debug message callback function.
229
- *
230
- * \param message the debug message handler message object
231
- *
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,23 +246,49 @@ 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
 
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);
392
269
 
393
270
  /**
394
271
  * Enable/disable LiveEdit functionality for the given Isolate
395
272
  * (default Isolate if not provided). V8 will abort if LiveEdit is
396
273
  * unexpectedly used. LiveEdit is enabled by default.
397
274
  */
398
- static void SetLiveEditEnabled(bool enable, Isolate* isolate = NULL);
275
+ static void SetLiveEditEnabled(Isolate* isolate, bool enable);
276
+
277
+ /**
278
+ * Returns array of internal properties specific to the value type. Result has
279
+ * the following format: [<name>, <value>,...,<name>, <value>]. Result array
280
+ * will be allocated in the current context.
281
+ */
282
+ static MaybeLocal<Array> GetInternalProperties(Isolate* isolate,
283
+ Local<Value> value);
284
+
285
+ /**
286
+ * Defines if the ES2015 tail call elimination feature is enabled or not.
287
+ * The change of this flag triggers deoptimization of all functions that
288
+ * contain calls at tail position.
289
+ */
290
+ static bool IsTailCallEliminationEnabled(Isolate* isolate);
291
+ static void SetTailCallEliminationEnabled(Isolate* isolate, bool enabled);
399
292
  };
400
293
 
401
294
 
@@ -0,0 +1,54 @@
1
+ // Copyright 2015 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
+ /**
6
+ * This header contains a set of experimental V8 APIs. We hope these will
7
+ * become a part of standard V8, but they may also be removed if we deem the
8
+ * experiment to not be successul.
9
+ */
10
+ #ifndef V8_INCLUDE_V8_EXPERIMENTAL_H_
11
+ #define V8_INCLUDE_V8_EXPERIMENTAL_H_
12
+
13
+ #include "v8.h" // NOLINT(build/include)
14
+
15
+ namespace v8 {
16
+ namespace experimental {
17
+
18
+ // Allow the embedder to construct accessors that V8 can compile and use
19
+ // directly, without jumping into the runtime.
20
+ class V8_EXPORT FastAccessorBuilder {
21
+ public:
22
+ struct ValueId {
23
+ size_t value_id;
24
+ };
25
+ struct LabelId {
26
+ size_t label_id;
27
+ };
28
+
29
+ static FastAccessorBuilder* New(Isolate* isolate);
30
+
31
+ ValueId IntegerConstant(int int_constant);
32
+ ValueId GetReceiver();
33
+ ValueId LoadInternalField(ValueId value_id, int field_no);
34
+ ValueId LoadValue(ValueId value_id, int offset);
35
+ ValueId LoadObject(ValueId value_id, int offset);
36
+ void ReturnValue(ValueId value_id);
37
+ void CheckFlagSetOrReturnNull(ValueId value_id, int mask);
38
+ void CheckNotZeroOrReturnNull(ValueId value_id);
39
+ LabelId MakeLabel();
40
+ void SetLabel(LabelId label_id);
41
+ void CheckNotZeroOrJump(ValueId value_id, LabelId label_id);
42
+ ValueId Call(v8::FunctionCallback callback, ValueId value_id);
43
+
44
+ private:
45
+ FastAccessorBuilder() = delete;
46
+ FastAccessorBuilder(const FastAccessorBuilder&) = delete;
47
+ ~FastAccessorBuilder() = delete;
48
+ void operator=(const FastAccessorBuilder&) = delete;
49
+ };
50
+
51
+ } // namespace experimental
52
+ } // namespace v8
53
+
54
+ #endif // V8_INCLUDE_V8_EXPERIMENTAL_H_