John McCutchan
51d8bae199
Revert "Hide Isolate pointer from embedder"
...
This reverts commit 014e694ba7 .
Revert "Fix fall out from hide isolate pointer change"
This reverts commit 966aafbc81 .
Revert "Fix build"
This reverts commit d7b03ba7b0 .
BUG=
Review URL: https://codereview.chromium.org//1140263005
2015-05-19 11:41:42 -07:00
Siva Annamalai
b9b5a05265
Fix for bug 23484 (obscure error when a compilation error happens during Object::Init())
...
BUG=23484
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//1135173008
2015-05-19 11:19:21 -07:00
John McCutchan
014e694ba7
Hide Isolate pointer from embedder
...
BUG=
R=iposva@google.com
Review URL: https://codereview.chromium.org//1130753006
2015-05-18 14:06:10 -07:00
koda@google.com
1e3b00d72e
Automatic thread cleanup on non-Windows platforms.
...
Issue 23474 is tracking Windows support (use Chromium's method).
BUG=23474
R=iposva@google.com
Review URL: https://codereview.chromium.org//1134003005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45817 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 17:30:33 +00:00
asiva@google.com
05d7eb5dfa
Move symbol table from per isolate snapshot to vm isolate snapshot, this reduces the per isolate initial heap size
...
from New space (0k of 1024k) Old space (1274k of 1536k)
to New space (0k of 1024k) Old space (756k of 1280k)
R=hausner@google.com
Review URL: https://codereview.chromium.org//1123813002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45795 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 20:14:37 +00:00
asiva@google.com
579fc0fd2e
Some more cleanup of the finger print checking code.
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//1136163002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45742 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 18:14:18 +00:00
rmacnak@google.com
a6e42c48b5
Deal with deferred loading in the VM mirrors.
...
- Invalidate MirrorSystem.libraries when a load completes.
- Recheck if a deferred import's target has been loaded before failing.
- Allow loading libraries from a LibraryDepedencyMirror.
- Propogate compile-time error when attempting to reflect a deferred type.
BUG=http://dartbug.com/22592
R=asiva@google.com , gbracha@google.com
Review URL: https://codereview.chromium.org//1095903002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45444 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-28 23:47:45 +00:00
rmacnak@google.com
9f56280609
Add asserts that isolates have a root library set up before they become runnable.
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//1073983010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45224 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 00:44:47 +00:00
rmacnak@google.com
5797153584
Add Dart_NewIntegerFromUint64. Fix Dart_IntegerToUint64 for negative Smis.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//1086713002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45143 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-14 17:52:06 +00:00
johnmccutchan@google.com
5c7d4bd9d3
Fix crash when posting a message to a send port with port id 0.
...
BUG=
R=zra@google.com
Review URL: https://codereview.chromium.org//1056223002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44906 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-05 19:06:29 +00:00
koda@google.com
909b3f5cb5
Fix Dartium build: Add missing Dart_ExitIsolate before call to Dart_CreateIsolate.
...
The API specifies that there must be no current isolate when creating a new one.
Add the corresponding check.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1052053003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44848 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-01 22:32:22 +00:00
koda@google.com
f4419287aa
Prepares for multiple threads by further decoupling Thread from Isolate.
...
- Replace Isolate::SetCurrent with more explicit Thread::Enter/ExitIsolate.
- Lazily initialize Thread instances when entering an isolate, to avoid new API calls for embedders.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1041523002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44835 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-01 17:48:11 +00:00
asiva@google.com
87c8a6ee76
First step towards splitting a full snapshot into a vm isolate snapshot and a
...
regular isolate snapsot.
- change gen_snapshot to split a full snapshot into a vm isolate snapshot
and an isolate snapshot
- change the build process and scripts to account for splitting the full
snapshot
R=hausner@google.com
Review URL: https://codereview.chromium.org//1023753006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44814 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-31 18:46:19 +00:00
koda@google.com
e3a345a84b
Rename NoGCScope -> NoSafepointScope.
...
The old name makes less sense in the context of concurrent GC (and multiple threads in general).
Document the intended semantics of this (DEBUG-only) guard scope.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1016503005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44616 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 22:08:25 +00:00
koda@google.com
92a8c39d3c
Keep zone cached in SnapshotReader to allow removing ZoneHandle(Isolate*) interface.
...
Add a StackZone around API snapshot reading call.
Also remove CheckedHandle(Isolate*) interface by migrating its users to Zone*.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1012333002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44580 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-19 17:42:40 +00:00
turnidge@google.com
f9f2d9c017
Major rework of vm service events
...
--------
VM
Add a new ServiceEvent class in the vm. Rework the event type names.
Add BreakpointAdded, BreakpointResolved, and BreakpointRemoved
service events.
Record the top frame for kIsolateInterrupted and kExceptionThrown
debugger events.
Send a top frame in more Pause* events.
Send breakpoint list with the Isolate response. Remove the
getBreakpoints method from the vm service.
Move Resume events into debugger.cc.
Rework MessageHandler a bit so that we can send PauseStart and
PauseExit notifications.
--------
Observatory
Move some event handler from Application to Isolate.
Rewrite breakpoint tracking code to use the new breakpoint events.
Change run state tracking in Isolate.
Change getFromMap so that it applies updates if the map isn't a ref.
Use getFromMap instead of new ServiceObject in invokeRpc. This
fixes some duplicate ServiceObject problems.
Review URL: https://codereview.chromium.org//979823003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44268 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-05 19:02:42 +00:00
koda@google.com
6b936e5be0
Verify acquired typed data: allow detection of use-after-free.
...
With --verify_acquired_data, copy to a buffer on the side (which is zapped on release). Allows AddressSanitizer to catch bugs.
Extend unit tests to exercise new code.
R=asiva@google.com
Review URL: https://codereview.chromium.org//957483002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44102 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-27 19:24:17 +00:00
johnmccutchan@google.com
1761e8eb5f
Refactor service code and service method parameters
...
- Move service isolate code into service_isolate.cc
- Reorganize service isolate code
- Unify isolate and root message handlers
- Add MethodParameter classes
- Add parameter list to service method table
- Use parameter list for getCpuProfile RPC
- Update service_test.cc to work with required isolateId parameter.
R=turnidge@google.com
Review URL: https://codereview.chromium.org//920813003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43735 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 19:10:55 +00:00
rmacnak@google.com
4de5f89b99
Rename IsConstructor to IsGenerativeConstructor.
...
This matches the terminology in the spec, and it avoids confusion with the function kind kConstructor, which indicates either a generative constructor or a factory constructor.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//910313002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43673 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-11 00:59:19 +00:00
turnidge@google.com
e1f31e1513
Add a working command line debugger to Observatory.
...
Try it!
Review URL: https://codereview.chromium.org//866663003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43618 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-09 22:03:31 +00:00
koda@google.com
f3387ccc3f
In this first version, we just track the set of objects and verify that calls to release match. The next step is to copy the data to a side buffer, which is then unmapped on release to catch use-after-release bugs.
...
Explicitly disallow nested acquires, since the visibility of writes would depend on whether data is acquired in-place.
Also explicitly disallow other access to the data (e.g., trough list accessors) for the same reason.
R=asiva@google.com
Review URL: https://codereview.chromium.org//905823002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43575 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 22:31:46 +00:00
iposva@google.com
6898a10c93
- Make sure to fail early if an non-stacktrace is passed into the VM
...
where we expect one.
Review URL: https://codereview.chromium.org//908433002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43546 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-06 09:23:57 +00:00
zra@google.com
1299ad1485
Allows turning on checked mode on a per-isolate basis
...
using the embedding API.
R=regis@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//883263004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43481 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-04 18:32:48 +00:00
johnmccutchan@google.com
4ebfc3a73f
Make Dart_Invoke work for private static functions
...
Our API documentation states that Dart_Invoke will invoke private functions.
R=turnidge@google.com
Review URL: https://codereview.chromium.org//891053004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43375 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-03 00:37:08 +00:00
johnmccutchan@google.com
172baa03ff
Service isolate rework take 2
...
Review URL: https://codereview.chromium.org//889443002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43306 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 18:31:27 +00:00
johnmccutchan@google.com
db271b0477
Revert r43217, r43215, r43208, r43207, and r43202.
...
Reverting because of some isolate spawn issues (on Windows, and pub bots).
Review URL: https://codereview.chromium.org//867113003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43219 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 22:56:18 +00:00
johnmccutchan@google.com
66aa470fc6
* Create vm-service isolate at Dart_Initialize time.
...
* Remove Service create callback.
* Simplify creation of service isolate.
* Creation is done on thread pool.
* Use vm-service isolate for loading in standalone embedder.
* Remove import of dart:io from builtin library.
performance changes:
no service isolate:
$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | - 0]
$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:27 | 100% | +12363 | - 0]
always start service isolate (as a thread pool task):
$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:45 | 100% | +12363 | - 0]
$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:44 | 100% | +12363 | - 0]
service does I/O (calls to Dart_LoadScript block until service is running):
$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | - 0]
$ ./tools/test.py -m release
Test configuration: none_vm_release_ia32
[01:55 | 100% | +12363 | - 0]
R=asiva@google.com
Review URL: https://codereview.chromium.org//584023004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43202 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 19:45:48 +00:00
koda@google.com
0aeee6156e
Add include.
...
Not sure whether this is related to the Debug win32 build failure.
TBR=ricow@google.com
Review URL: https://codereview.chromium.org//837103003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42898 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 06:15:22 +00:00
koda@google.com
c7e9e048ed
Rename Thread -> OSThread.
...
It's a collection of static utility methods for primitive operations on OS threads.
Make room in the namespace for upcoming class that will represent all the complex state of a VM thread.
Review URL: https://codereview.chromium.org//796063006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42895 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 02:30:07 +00:00
asiva@google.com
ca1c3241c4
Fix for issue 21398.
...
Accept only 'literal-like' objects when sending messages to isolates
spawned using spawnURI. Allow all objects for isolates spawned using
spawnFunction.
R=iposva@google.com
Review URL: https://codereview.chromium.org//834233003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42793 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-12 23:14:30 +00:00
hausner@google.com
fb8004e485
Too much const kills the build
...
Review URL: https://codereview.chromium.org//829993003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42578 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-31 00:26:27 +00:00
hausner@google.com
74694f5a90
Interrupt isolates immediately
...
After requesting the interrupt, send a null message to the isolate
to ensure the isolate runs and detects the interrupt request immediately.
Fixes issue 21047.
R=iposva@google.com
Review URL: https://codereview.chromium.org//789243003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42577 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-31 00:20:39 +00:00
hausner@google.com
f96ae9969e
Support breakpoints in deferred libraries
...
This CL introduces latent breakpoints, which are bp in urls that are
not yet loaded. When the VM loads additional scripts through deferred
libraries, latent breakpoints get set.
R=iposva@google.com
Review URL: https://codereview.chromium.org//808643004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42510 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-19 16:35:37 +00:00
fschneider@google.com
876193b31a
Make CTX allocatable by the register allocator.
...
This change makes CTX available by not caching the current
context while in Dart code. Instead the current context
is held in a local variable (:saved_current_context_var) and
is passed as argument in CTX at calls.
This also simplifies a lot of code in the debugger: As a result,
Isolate::top_context is not needed anymore since the current context
can always be extracted from a Dart frame.
R=vegorov@google.com
Review URL: https://codereview.chromium.org//678763004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41422 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 15:42:38 +00:00
turnidge@google.com
c658fa60f9
Fix deadlock that can occur while handling service messages at a breakpoint.
...
Deadlock looks like:
Regular Isolate
-> paused at breakpoint in debug message loop
-> holds debug message queue lock to get message notifications
-> handles an service message
-> waits for portmap lock to send response
Service Isolate
-> receives request for paused isolate
-> holds portmap lock to send message
-> runs custom message notifier to wake debug message loop
-> waits for debug message queue lock
I've solved this by releasing the debug message queue lock while
handling service messages. This requires me to poll for new service
messages after reacquiring the debug message queue lock to make sure I
haven't dropped any notifications.
It's a little weird that the embedder (runtime/bin) needs to be aware
of the locking in the core vm (runtime/vm), but this seemed like the
simplest fix for now.
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//629533002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41326 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-27 16:57:21 +00:00
hausner@google.com
2f49f29c38
Await always waits
...
The expression ‘await e’ always suspends the enclosing function. If e does not
evaluate to a an object o of type Future, a new Future is created using Future.value(o).
A small change in the backend allows a return instruction to be followed by
other instructions. In async functions, a return can suspend the function and the
continuation point is in the same code block after the return.
Other small changes:
- More user-friendly error message if async/await is not enabled.
- Programs no longer need to import dart:async when using async/await.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//634603002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41105 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-14 19:58:06 +00:00
rmacnak@google.com
046a81b6b1
Add Dart_IsFuture. To be used in Dartium implementation of Promises.
...
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org//585643004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40577 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 23:05:58 +00:00
rmacnak@google.com
cefb21b6a3
Narrow String::CharAt from int32_t to uint16_t.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//560113002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40178 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 20:55:36 +00:00
regis@google.com
0220e41d72
New bigint implementation in the vm.
...
R=srdjan@google.com
Review URL: https://codereview.chromium.org//509153003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40061 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 21:47:44 +00:00
iposva@google.com
adbe016fbc
- Support loading from https.
...
- Remove over-eager assertion.
R=asiva@google.com
Review URL: https://codereview.chromium.org//550003004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40005 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 00:10:06 +00:00
iposva@google.com
92f2698abe
- Refactor the way X.fromEnvironment is implemented.
...
- Predefine 'dart.isVM' to be 'true'.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//546053002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39986 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 18:23:05 +00:00
ajohnsen@google.com
8c633a390e
Cleanup resource loading of the VM.
...
There is not only one path for loading resources, and it's async.
BUG=
Review URL: https://codereview.chromium.org//529203004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39847 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 06:42:01 +00:00
johnmccutchan@google.com
7c7bcbdd29
Make Dart API Dart_IsTypedData work for typed data views
...
BUG=http://dartbug.com/20765
R=asiva@google.com
Review URL: https://codereview.chromium.org//529053002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39752 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 16:35:58 +00:00
asiva@google.com
fb5d976edc
Landing change from Zach for adding snapshot version numbers.
...
(Add a version number for full and script snapshots.
Currently the VM version string is used for versioning. This can
potentially be improved to use a version string that tracks the format
of the internal VM structures.)
Review URL: https://codereview.chromium.org//506753003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39612 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 18:27:51 +00:00
iposva@google.com
14ecdbd66a
- Separate the thread implementation used in bin/ and vm/
...
to allow us to make VM specific changes.
R=asiva@google.com
Review URL: https://codereview.chromium.org//463993002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39172 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 23:19:53 +00:00
rmacnak@google.com
e803f27641
Make Dart_LoadLibrary and Dart_LoadSource take line and column offsets like Dart_LoadScript.
...
BUG=http://dartbug.com/13460
R=hausner@google.com
Review URL: https://codereview.chromium.org//429013002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38801 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 21:25:23 +00:00
hausner@google.com
4258c115b4
Handle load errors in deferred code
...
IO errors on the URL of a deferred library are forwarded to the Future
that handles the deferred load. Syntax errors and finalization errors
are lethal, killing the isolate.
Review URL: https://codereview.chromium.org//419103003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38800 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 21:09:33 +00:00
iposva@google.com
28c8553cb6
- Fix a lot of warnings generated by -Wshorten-64-to-32
...
when compiling for ia32 on Mac.
R=vegorov@google.com
Review URL: https://codereview.chromium.org//415513002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38499 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-23 14:10:13 +00:00
asiva@google.com
97b903c665
Fix for issue 19817
...
- do not try to finalize classes on every Dart API call which could
potentially result in calls to dart code
- Invoke Dart_FinalizeLoading after all loads are done to ensure that
classes are finalized
R=hausner@google.com
Review URL: https://codereview.chromium.org//411633002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38471 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-22 20:08:15 +00:00
asiva@google.com
a8195aeb5c
Change the Dart API call Dart_FInalizeLoading to accept an additional argument
...
which makes completion of deferred library futures optional.
R=hausner@google.com
Review URL: https://codereview.chromium.org//407143004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38463 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-22 16:56:14 +00:00