libv8 3.16.14.19.1-x86-linux → 4.5.95.5-x86-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/ext/libv8/arch.rb +9 -33
- data/ext/libv8/location.rb +15 -9
- data/ext/libv8/paths.rb +3 -3
- data/lib/libv8/version.rb +1 -1
- data/vendor/v8/include/libplatform/libplatform.h +38 -0
- data/vendor/v8/include/v8-debug.h +48 -176
- data/vendor/v8/include/v8-platform.h +82 -0
- data/vendor/v8/include/v8-profiler.h +245 -178
- data/vendor/v8/include/v8-testing.h +3 -60
- data/vendor/v8/include/v8-util.h +640 -0
- data/vendor/v8/include/v8-version.h +20 -0
- data/vendor/v8/include/v8.h +6009 -2587
- data/vendor/v8/include/v8config.h +424 -0
- data/vendor/v8/out/ia32.release/libv8_base.a +0 -0
- data/vendor/v8/out/ia32.release/libv8_libbase.a +0 -0
- data/vendor/v8/out/ia32.release/libv8_libplatform.a +0 -0
- data/vendor/v8/out/ia32.release/libv8_nosnapshot.a +0 -0
- data/vendor/v8/out/ia32.release/libv8_snapshot.a +0 -0
- data/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_base.a +0 -0
- data/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_libbase.a +0 -0
- data/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_libplatform.a +0 -0
- data/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_nosnapshot.a +0 -0
- data/vendor/v8/out/ia32.release/obj.target/tools/gyp/libv8_snapshot.a +0 -0
- metadata +32 -53
- data/vendor/v8/include/v8-preparser.h +0 -118
- data/vendor/v8/include/v8stdint.h +0 -54
- data/vendor/v8/out/ia32.release/obj.target/tools/gyp/libpreparser_lib.a +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7456e92db801e64ddd082ab20ef584a2c0670cd9
|
4
|
+
data.tar.gz: ea0217f282b4d1d2926a295b9fd1d159e5a29d5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92a36255901acdafbc52be92157f02c2a86c395d1e4013e41fe2165eb4eb67853c638a70debd9d8e7e5d7531bcf7d2d02499b3291fc84a68f69c3a790f9e2302
|
7
|
+
data.tar.gz: 8a7e28a1689d1814644e0978cfe0f8c5a4c8b29bb56995e3e5dc81fb090b64722333397c9b055976026403b318343192b0c5476809b8801a828aee6170829a33
|
data/ext/libv8/arch.rb
CHANGED
@@ -1,42 +1,18 @@
|
|
1
|
-
require '
|
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
|
-
|
38
|
-
|
39
|
-
|
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$/ then 'x64'
|
13
|
+
else
|
14
|
+
warn "Unsupported target: #{Gem::Platform.local.cpu}"
|
15
|
+
Gem::Platform.local.cpu
|
40
16
|
end
|
41
17
|
end
|
42
18
|
end
|
data/ext/libv8/location.rb
CHANGED
@@ -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.
|
16
|
+
YAML.load f
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -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,21 +52,23 @@ 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
|
|
54
59
|
class NotFoundError < StandardError
|
55
60
|
def initialize(*args)
|
56
61
|
super(<<-EOS)
|
57
|
-
|
58
|
-
|
59
|
-
|
62
|
+
You have chosen to use the version of V8 found on your system
|
63
|
+
and *not* the one that is bundle with the libv8 rubygem. However,
|
64
|
+
it could not be located. please make sure you have a version of
|
65
|
+
v8 that is compatible with #{Libv8::VERSION} installed. You may
|
66
|
+
need to special --with-v8-dir options if it is in a non-standard
|
67
|
+
location
|
60
68
|
|
61
|
-
|
69
|
+
thanks,
|
70
|
+
The Mgmt
|
62
71
|
|
63
|
-
Please make sure your system version of v8 that is compatible
|
64
|
-
with #{Libv8::VERSION} installed. You may need to use the
|
65
|
-
--with-v8-dir option if it is installed in a non-standard location
|
66
72
|
EOS
|
67
73
|
end
|
68
74
|
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(
|
10
|
+
[Shellwords.escape(vendored_source_path)]
|
11
11
|
end
|
12
12
|
|
13
13
|
def object_paths
|
14
|
-
[
|
15
|
-
Shellwords.escape
|
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
@@ -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,69 +1,12 @@
|
|
1
1
|
// Copyright 2008 the V8 project authors. All rights reserved.
|
2
|
-
//
|
3
|
-
//
|
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
8
|
#include "v8.h"
|
32
9
|
|
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
|
-
|
66
|
-
|
67
10
|
/**
|
68
11
|
* Debugger support for the V8 JavaScript engine.
|
69
12
|
*/
|
@@ -76,12 +19,13 @@ enum DebugEvent {
|
|
76
19
|
NewFunction = 3,
|
77
20
|
BeforeCompile = 4,
|
78
21
|
AfterCompile = 5,
|
79
|
-
|
80
|
-
|
22
|
+
CompileError = 6,
|
23
|
+
PromiseEvent = 7,
|
24
|
+
AsyncTaskEvent = 8,
|
81
25
|
};
|
82
26
|
|
83
27
|
|
84
|
-
class
|
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
|
@@ -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
|
|
@@ -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,43 @@ 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 (*
|
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
|
-
*
|
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
147
|
*
|
230
|
-
*
|
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 (*
|
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
158
|
static bool SetDebugEventListener(EventCallback that,
|
249
159
|
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>());
|
256
160
|
|
257
161
|
// Schedule a debugger break to happen when JavaScript code is run
|
258
|
-
// in the given isolate.
|
259
|
-
|
260
|
-
static void DebugBreak(Isolate* isolate = NULL);
|
162
|
+
// in the given isolate.
|
163
|
+
static void DebugBreak(Isolate* isolate);
|
261
164
|
|
262
165
|
// Remove scheduled debugger break in given isolate if it has not
|
263
|
-
// happened yet.
|
264
|
-
|
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);
|
166
|
+
// happened yet.
|
167
|
+
static void CancelDebugBreak(Isolate* isolate);
|
290
168
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
* calling handler
|
301
|
-
*/
|
302
|
-
static void SetDebugMessageDispatchHandler(
|
303
|
-
DebugMessageDispatchHandler handler, bool provide_locker = false);
|
169
|
+
// Check if a debugger break is scheduled in the given isolate.
|
170
|
+
static bool CheckDebugBreak(Isolate* isolate);
|
171
|
+
|
172
|
+
// Message based interface. The message protocol is JSON.
|
173
|
+
static void SetMessageHandler(MessageHandler handler);
|
174
|
+
|
175
|
+
static void SendCommand(Isolate* isolate,
|
176
|
+
const uint16_t* command, int length,
|
177
|
+
ClientData* client_data = NULL);
|
304
178
|
|
305
179
|
/**
|
306
180
|
* Run a JavaScript function in the debugger.
|
@@ -320,29 +194,22 @@ class EXPORT Debug {
|
|
320
194
|
* }
|
321
195
|
* \endcode
|
322
196
|
*/
|
323
|
-
static
|
324
|
-
|
197
|
+
static V8_DEPRECATE_SOON(
|
198
|
+
"Use maybe version",
|
199
|
+
Local<Value> Call(v8::Handle<v8::Function> fun,
|
200
|
+
Handle<Value> data = Handle<Value>()));
|
201
|
+
// TODO(dcarney): data arg should be a MaybeLocal
|
202
|
+
static MaybeLocal<Value> Call(Local<Context> context,
|
203
|
+
v8::Handle<v8::Function> fun,
|
204
|
+
Handle<Value> data = Handle<Value>());
|
325
205
|
|
326
206
|
/**
|
327
207
|
* Returns a mirror object for the given object.
|
328
208
|
*/
|
329
|
-
static
|
330
|
-
|
331
|
-
|
332
|
-
|
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();
|
209
|
+
static V8_DEPRECATE_SOON("Use maybe version",
|
210
|
+
Local<Value> GetMirror(v8::Handle<v8::Value> obj));
|
211
|
+
static MaybeLocal<Value> GetMirror(Local<Context> context,
|
212
|
+
v8::Handle<v8::Value> obj);
|
346
213
|
|
347
214
|
/**
|
348
215
|
* Makes V8 process all pending debug messages.
|
@@ -354,7 +221,7 @@ class EXPORT Debug {
|
|
354
221
|
*
|
355
222
|
* Generally when message arrives V8 may be in one of 3 states:
|
356
223
|
* 1. V8 is running script; V8 will automatically interrupt and process all
|
357
|
-
* pending messages
|
224
|
+
* pending messages;
|
358
225
|
* 2. V8 is suspended on debug breakpoint; in this state V8 is dedicated
|
359
226
|
* to reading and processing debug messages;
|
360
227
|
* 3. V8 is not running at all or has called some long-working C++ function;
|
@@ -362,10 +229,6 @@ class EXPORT Debug {
|
|
362
229
|
* until V8 gets control again; however, embedding application may improve
|
363
230
|
* this by manually calling this method.
|
364
231
|
*
|
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
232
|
* Technically this method in many senses is equivalent to executing empty
|
370
233
|
* script:
|
371
234
|
* 1. It does nothing except for processing all pending debug messages.
|
@@ -385,7 +248,8 @@ class EXPORT Debug {
|
|
385
248
|
* Debugger is running in its own context which is entered while debugger
|
386
249
|
* messages are being dispatched. This is an explicit getter for this
|
387
250
|
* debugger context. Note that the content of the debugger context is subject
|
388
|
-
* to change.
|
251
|
+
* to change. The Context exists only when the debugger is active, i.e. at
|
252
|
+
* least one DebugEventListener or MessageHandler is set.
|
389
253
|
*/
|
390
254
|
static Local<Context> GetDebugContext();
|
391
255
|
|
@@ -395,7 +259,15 @@ class EXPORT Debug {
|
|
395
259
|
* (default Isolate if not provided). V8 will abort if LiveEdit is
|
396
260
|
* unexpectedly used. LiveEdit is enabled by default.
|
397
261
|
*/
|
398
|
-
static void SetLiveEditEnabled(
|
262
|
+
static void SetLiveEditEnabled(Isolate* isolate, bool enable);
|
263
|
+
|
264
|
+
/**
|
265
|
+
* Returns array of internal properties specific to the value type. Result has
|
266
|
+
* the following format: [<name>, <value>,...,<name>, <value>]. Result array
|
267
|
+
* will be allocated in the current context.
|
268
|
+
*/
|
269
|
+
static MaybeLocal<Array> GetInternalProperties(Isolate* isolate,
|
270
|
+
Local<Value> value);
|
399
271
|
};
|
400
272
|
|
401
273
|
|
@@ -0,0 +1,82 @@
|
|
1
|
+
// Copyright 2013 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_V8_PLATFORM_H_
|
6
|
+
#define V8_V8_PLATFORM_H_
|
7
|
+
|
8
|
+
namespace v8 {
|
9
|
+
|
10
|
+
class Isolate;
|
11
|
+
|
12
|
+
/**
|
13
|
+
* A Task represents a unit of work.
|
14
|
+
*/
|
15
|
+
class Task {
|
16
|
+
public:
|
17
|
+
virtual ~Task() {}
|
18
|
+
|
19
|
+
virtual void Run() = 0;
|
20
|
+
};
|
21
|
+
|
22
|
+
/**
|
23
|
+
* V8 Platform abstraction layer.
|
24
|
+
*
|
25
|
+
* The embedder has to provide an implementation of this interface before
|
26
|
+
* initializing the rest of V8.
|
27
|
+
*/
|
28
|
+
class Platform {
|
29
|
+
public:
|
30
|
+
/**
|
31
|
+
* This enum is used to indicate whether a task is potentially long running,
|
32
|
+
* or causes a long wait. The embedder might want to use this hint to decide
|
33
|
+
* whether to execute the task on a dedicated thread.
|
34
|
+
*/
|
35
|
+
enum ExpectedRuntime {
|
36
|
+
kShortRunningTask,
|
37
|
+
kLongRunningTask
|
38
|
+
};
|
39
|
+
|
40
|
+
virtual ~Platform() {}
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Schedules a task to be invoked on a background thread. |expected_runtime|
|
44
|
+
* indicates that the task will run a long time. The Platform implementation
|
45
|
+
* takes ownership of |task|. There is no guarantee about order of execution
|
46
|
+
* of tasks wrt order of scheduling, nor is there a guarantee about the
|
47
|
+
* thread the task will be run on.
|
48
|
+
*/
|
49
|
+
virtual void CallOnBackgroundThread(Task* task,
|
50
|
+
ExpectedRuntime expected_runtime) = 0;
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Schedules a task to be invoked on a foreground thread wrt a specific
|
54
|
+
* |isolate|. Tasks posted for the same isolate should be execute in order of
|
55
|
+
* scheduling. The definition of "foreground" is opaque to V8.
|
56
|
+
*/
|
57
|
+
virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0;
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Schedules a task to be invoked on a foreground thread wrt a specific
|
61
|
+
* |isolate| after the given number of seconds |delay_in_seconds|.
|
62
|
+
* Tasks posted for the same isolate should be execute in order of
|
63
|
+
* scheduling. The definition of "foreground" is opaque to V8.
|
64
|
+
*/
|
65
|
+
virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task,
|
66
|
+
double delay_in_seconds) {
|
67
|
+
// TODO(ulan): Make this function abstract after V8 roll in Chromium.
|
68
|
+
}
|
69
|
+
|
70
|
+
/**
|
71
|
+
* Monotonically increasing time in seconds from an arbitrary fixed point in
|
72
|
+
* the past. This function is expected to return at least
|
73
|
+
* millisecond-precision values. For this reason,
|
74
|
+
* it is recommended that the fixed point be no further in the past than
|
75
|
+
* the epoch.
|
76
|
+
**/
|
77
|
+
virtual double MonotonicallyIncreasingTime() = 0;
|
78
|
+
};
|
79
|
+
|
80
|
+
} // namespace v8
|
81
|
+
|
82
|
+
#endif // V8_V8_PLATFORM_H_
|