Commit graph

538 commits

Author SHA1 Message Date
asiva
b64f2acfb9 Revert "[VM] Improve code generation for uint32"
Please see issue https://github.com/dart-lang/sdk/issues/33008 for more
details on the regression caused by this commit.

This reverts commit 9741c220f3.

It also effectively reverts

https://dart-review.googlesource.com/c/sdk/+/53006
https://dart-review.googlesource.com/c/sdk/+/53001

which were follow up CLs to the main commit.

Change-Id: Iac399c620a312ab3c3b27a3cba4e681742bcfe33
Reviewed-on: https://dart-review.googlesource.com/53164
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-05-01 00:25:01 +00:00
Erik Corry
a8b0a1a5fa [VM] Except SIMDBC from change for x64 and ARM64
R=vegorov@google.com
TBR=vegoroc@google.com
Change-Id: I1ddb72e0de13400d57dd6ca0a551a7273c4dea24
Reviewed-on: https://dart-review.googlesource.com/53001
Reviewed-by: Erik Corry <erikcorry@google.com>
2018-04-29 18:15:03 +00:00
Erik Corry
9741c220f3 [VM] Improve code generation for uint32
Simplify by no longer using the signed unboxed int32 type on
64 bit platforms.

R=vegorov@google.com

Change-Id: Ic8eab7308f2ce01e5618344f50f72b95ce13a0dc
Reviewed-on: https://dart-review.googlesource.com/52762
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-04-29 12:41:43 +00:00
Ryan Macnak
aee4561882 [vm] Remove dependency of platform/assert.cc on vm/profiler.h
Change-Id: Ieab84b164ed620d5edca06e3c7b63b33bdcd6569
Reviewed-on: https://dart-review.googlesource.com/52943
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-27 23:30:48 +00:00
Ben Konyi
090d9e9231 [ VM / Dart 2 ] Reland: Fixed StackTraceFormat test to expect file URIs in stacks generated by the Dart frontend.
This reverts commit a81f4babcc.

Change-Id: I88f0d004640dd1a994b211ab2a698fd2f87afeca
Reviewed-on: https://dart-review.googlesource.com/49540
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-04-04 21:28:16 +00:00
Ryan Macnak
d9c3190e44 [vm] Remove some bin -> vm includes.
Change-Id: Id304de9618a299a201b946a901a54352772f56fb
Reviewed-on: https://dart-review.googlesource.com/48704
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-28 23:16:09 +00:00
Zach Anderson
0482cf4da1 [fuchsia] Add rules to build gen_snapshot targeting Fuchsia
This change enables building a gen_snapshot that targets Fuchsia during
an SDK build that targets the host (Mac, Linux).

Change-Id: I4cfbcbe4e26e4be7108fc40c96122fe9a2fb4c19
Reviewed-on: https://dart-review.googlesource.com/48683
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-03-28 19:39:49 +00:00
Martin Kustermann
31dd6683f8 [VM] Optimize performance of dart_boostrap in debug-kernel-strong mode.
Since the kernel reading helpers have been extended to not only work
with a kernel blob in C heap, but also work based on a [TypedData]
buffer in the VM heap, access to the [TypedData] buffer is on the hot
path now.

This hot path is slowing things down considerably, in particular due
to NoSafepoingScope's.

This CL removes a critical NoSafepoingScope when accessing the
[TypedData] in read-only mode.  It also allows passing in the [Thread]
directly, to avoid TLS lookups.

Issue https://github.com/dart-lang/sdk/issues/32603

Change-Id: I91955bea5cd4eddbbd21c5d3bc6813504c2cece9
Reviewed-on: https://dart-review.googlesource.com/47222
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-03-21 10:24:29 +00:00
Vyacheslav Egorov
d41794ee11 [vm/compiler] Fix UB in ToIntegerConstant helper
Change-Id: I5ffbebb12bd84eacca33fb81b3df51ba4ca291a8
Reviewed-on: https://dart-review.googlesource.com/46722
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-03-19 14:12:15 +00:00
Ryan Macnak
558a931409 [vm] Move some string utils from runtime/vm to runtime/platform.
Change-Id: I552086445a7e07792f9da85afa5edf23b6c450d5
Reviewed-on: https://dart-review.googlesource.com/44402
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-01 02:07:46 +00:00
Ryan Macnak
b5966dbddc [vm] Don't use popcount intrinsic on both x86s.
Bug: https://github.com/dart-lang/sdk/issues/32314
Change-Id: I5589a22de5777af664c83f221758ba5b35d8678a
Reviewed-on: https://dart-review.googlesource.com/43886
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-02-28 17:48:16 +00:00
asiva
1aaebedd70 Reland https://dart-review.googlesource.com/c/sdk/+/43497
(Strip out platform dill files and the kernel service dill file from a
 product build)
After fixing the issue of using 'is_product' which is not present in the
flutter build environment.

Change-Id: I49dd68e63b1f6d7ac0981b28bf2b08618551ae2e
Reviewed-on: https://dart-review.googlesource.com/44024
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-02-28 01:15:47 +00:00
Vyacheslav Egorov
59c3f0f0c3 Revert "Strip out platform dill files and the kernel service dill file from"
This reverts commit 92b5bf86a1.

Reason for revert: this breaks Flutter engine build because is_product is not defined.

Original change's description:
> Strip out platform dill files and the kernel service dill file from
> a product build.
> They only need to run a self contained '.dill' file as their application.
> 
> Change-Id: I9a2566b9e552a7aef4ebf52c2ecb664088ad030c
> Reviewed-on: https://dart-review.googlesource.com/43497
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Chandra <sivachandra@google.com>

TBR=zra@google.com,sivachandra@google.com,asiva@google.com

Change-Id: Id55a3f749290813aba479cc705c6065b75a0ac9c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/43980
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-02-27 08:45:39 +00:00
asiva
92b5bf86a1 Strip out platform dill files and the kernel service dill file from
a product build.
They only need to run a self contained '.dill' file as their application.

Change-Id: I9a2566b9e552a7aef4ebf52c2ecb664088ad030c
Reviewed-on: https://dart-review.googlesource.com/43497
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Chandra <sivachandra@google.com>
2018-02-26 23:58:07 +00:00
Ryan Macnak
afdbce7b13 [vm, isolate] Send large TypedData as ExternalTypedData in isolate messages.
Be careful to free external data when reading or writing a message is interrupted, or releasing messaging without reading on shutdown.

Bug: https://github.com/dart-lang/sdk/issues/31959
Change-Id: Ia39acb9ca0e27cf9e8b83961741e5949b5930266
Reviewed-on: https://dart-review.googlesource.com/41561
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-21 18:57:14 +00:00
Alexander Markov
1a1c7693d2 [VM/compiler] Fix range analysis for 64-bit fixed-size integers
This CL corrects handling of overflows in range analysis to
account for wrap-around (which happens with new integer semantics).

* If there is an overflow while doing computations in range
  analysis, the resulting range is approximated as full int64 range.

* For symbolic range boundaries 'symbol + offset', offset is checked
  to stay within [kMinInt64 - kSmiMin, kMaxInt64 - kSmiMax] in order
  to guarantee that overflow doesn't occur.

Issue: https://github.com/dart-lang/sdk/issues/31920
Change-Id: I2c16adbe3597e9b718ed2f6ce7210426fcc9e6a6
Reviewed-on: https://dart-review.googlesource.com/39423
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-08 21:49:42 +00:00
Alexander Aprelev
99e8f560af Revert "Revert "Reintroduce incremental compiler wrapper that supports accept protocol.""
This reverts commit 2d4c606e63.

The fix for the debug buildbot breakage now consists of skipping wide to utf8 conversion
altogether, instead move uri to path conversion directly into newly added File::OpenUri method.

Change-Id: Id3d7457d6a6b5045e5f38678548f4d7bed6d2c43
Reviewed-on: https://dart-review.googlesource.com/39801
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-02-07 20:58:51 +00:00
Alexander Aprelev
2d4c606e63 Revert "Reintroduce incremental compiler wrapper that supports accept protocol."
This reverts commit d78a41e0ee.

Revert "Fix length for WideToUTF8 conversion in UriToPath"

This reverts commit 011e1cc1c5.

Change-Id: I36140426a474962f77605e1aed6ddfd158bd064a
Reviewed-on: https://dart-review.googlesource.com/39480
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-02-07 04:02:36 +00:00
Alexander Aprelev
d78a41e0ee Reintroduce incremental compiler wrapper that supports accept protocol.
This reverts 4e677e9606

Change-Id: I32410b3a4ee9cc8a6f3318917ed519e13eea14f6
Reviewed-on: https://dart-review.googlesource.com/37862
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-06 18:38:58 +00:00
Martin Kustermann
0a652c9ca9 Revert "[VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables"
This reverts commit 12759870a4.

Reason for revert: Broke many bots.

Original change's description:
> [VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables
> 
> This fixes an issue when a program got loaded via dill, a function
> with a try-catch got optimized and the exception/stacktrace variables
> got captured.
> 
> Change-Id: Ia6b62f2a0986c78b90afe7fae25025ca4e5b09db
> Reviewed-on: https://dart-review.googlesource.com/35182
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,kustermann@google.com

Change-Id: I2ec7b4bea401e6d5665f6e789eb8e241b99db7b3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/36200
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-01-21 20:46:49 +00:00
Martin Kustermann
12759870a4 [VM] Use IR for code in [CatchEntryInstr]s to populate captured exception/stacktrace variables
This fixes an issue when a program got loaded via dill, a function
with a try-catch got optimized and the exception/stacktrace variables
got captured.

Change-Id: Ia6b62f2a0986c78b90afe7fae25025ca4e5b09db
Reviewed-on: https://dart-review.googlesource.com/35182
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-21 16:12:58 +00:00
Martin Kustermann
cf1de7d46c [VM] Replace hand-written assembly prologues with IR
As part of the prologue changes we get rid of the empty context as well.

Issue https://github.com/dart-lang/sdk/issues/31495

Change-Id: I707e23c631bcfbbad6c91c4963d0c10f7a0be625
Reviewed-on: https://dart-review.googlesource.com/25320
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-13 16:04:34 +00:00
Siva Chandra
702e4aecb8 Keep the line starts delta encoded in the VM heap as well - take 2
This reverts commit adf04d0ac6.

The original change used macros from stdint.h and it failed build on
the linux sdk bot:
https://uberchromegw.corp.google.com/i/client.dart/builders/dart-sdk-linux-be/builds/17348

In the newer version, constants from runtime/platform/globals.h are used
instead of the macros from stdint.h. Constants for int8 have been added as
they were not present already.

Change-Id: Ia4f27613fa5dca2cd6dbfeb37715ea70a85cec95
Reviewed-on: https://dart-review.googlesource.com/25083
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
2017-12-01 05:16:48 +00:00
Samir Jindel
be07555207 Revert "Revert "[kernel] Implementation of fine-grained strong mode argument type-checks, phase 2""
This fixes some incorrect asserts that were breaking the debug bots.
The original revision is available in Patchset 1.

This reverts commit 26735519cb.

Bug:
Change-Id: Ifa599b7bff752dec4c505e10fd6db206e1abd977
Reviewed-on: https://dart-review.googlesource.com/23820
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2017-11-27 18:25:31 +00:00
Vyacheslav Egorov
26735519cb Revert "[kernel] Implementation of fine-grained strong mode argument type-checks, phase 2"
This reverts commit f13f772bb2.

Reason for revert: dartk(p)-strong debug mode is completely broken
because we convert int values non-representable as Smi to Smi, which
triggers that assert. The code that does tagging checks that
Untag(Tag(x)) == x, however for our purposes this identity does not
need to hold because we only care about lower bits and ignore the sign.

Reverting to restore green-ness of DEBUG builds.

TBR=sjindel@google.com

Bug:
Change-Id: Id436cbe000d6dec8db3469070ed531327cc82d89
Reviewed-on: https://dart-review.googlesource.com/23661
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-26 10:21:01 +00:00
Samir Jindel
f13f772bb2 [kernel] Implementation of fine-grained strong mode argument type-checks, phase 2
This revision continues the implementation of:
https://docs.google.com/document/d/1KK8b6kzr0pQev5YNftSZhN3M6I8HcvOJwJ6U-cW4nfw/edit?ts=5a05b3e9#heading=h.7j21arix8p2

* Add argument checking bits for named arguments in the arguments descriptor.
* Add argument checking bits for type arguments.
* Calculate argument checking bits for setters.
* Add dispatch category to PropertySet and DirectPropertySet.

Bug:
Change-Id: Ieb0a4a99c401f53a72de473fda7bab61581f9996
Reviewed-on: https://dart-review.googlesource.com/22700
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-11-24 18:23:57 +00:00
Erik Corry
d300b08e35 [VM] Use X64 disassembler for IA32 and X64 (reland)
R=vegorov@google.com

This removes the IA32 disassembler and uses the X64 disassembler for
both variants.  Instructions that were in the IA32 assembler, but not
supported by the X64 disassembler have been added.  It also adds some
regression tests for a lot of the disassembler output.
Bug:
Change-Id: I243abbb04c3a77810ce96ca74f7f42a5a1aea0cf
Reviewed-on: https://dart-review.googlesource.com/22982
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2017-11-22 12:04:18 +00:00
Erik Corry
80992a5a09 Revert "[VM] Use X64 disassembler for IA32 and X64"
This reverts commit 9e42f006d9.
due to test failures on non-Linux platforms.

R=karlklose@google.com

Bug:
Change-Id: I5dc40da75d8d89fca8fce98a69a39d767493af1b
Reviewed-on: https://dart-review.googlesource.com/22921
Reviewed-by: Karl Klose <karlklose@google.com>
2017-11-22 09:11:12 +00:00
Erik Corry
9e42f006d9 [VM] Use X64 disassembler for IA32 and X64
R=vegorov@google.com

Bug:
Change-Id: I19b1f58e16ea35dc81b941c54e6e57b97cad3d74
Reviewed-on: https://dart-review.googlesource.com/22020
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-22 08:01:07 +00:00
Samir Jindel
a991c17dc9 [kernel] Implementation of fine-grained strong mode argument type-checks, phase 1
The revision begins the implementation of:
https://docs.google.com/document/d/1KK8b6kzr0pQev5YNftSZhN3M6I8HcvOJwJ6U-cW4nfw/edit?ts=5a05b3e9#heading=h.7j21arix8p2

* The ArgumentsDescriptor is updated to hold a bitvector for positional arguments.
* The kernel flowgraph builder is updated to calculate the appropriate bits from
  the interface target and pass them through the ArgumentsDescriptor
  for regular MethodInvocations.

Bug:
Change-Id: I1cd9f43f697df1dd4f36103bbdfc0ba000125c02
Reviewed-on: https://dart-review.googlesource.com/21541
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-11-21 15:35:48 +00:00
Erik Corry
1109ffcb6a [VM] Add ARM64 bitfield instructions
R=rmacnak@google.com

Also some minor cleanup in the way we encode ARM instructions.
I'll be needing these for 32 bit Smis on ARM64.
Bug:
Change-Id: I5f515590375a2c6ad11bc6f1a80a4f8e27cd82b4
Reviewed-on: https://dart-review.googlesource.com/20668
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-11-16 15:34:11 +00:00
Ryan Macnak
374c21ccb4 [vm] Improve packing of StackMaps.
Flutter gallery ARM32:
StackMaps        1248008 ->   898886 (-28.0%)
Total snapshot  11089876 -> 10741228 (-3.1%)

Bug: https://github.com/dart-lang/sdk/issues/31302
Change-Id: I61c6fbf9024648907238d1d835d13d75b17f224a
Reviewed-on: https://dart-review.googlesource.com/20480
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-14 20:04:14 +00:00
Ryan Macnak
f60efb7e40 Reapply "[vm] Popcount via compiler intrinsics."
Add missing rename of CountOneBits in ARM assembler.

Change-Id: I735da06343248573a1b049109ebc2bf0d1634960
Reviewed-on: https://dart-review.googlesource.com/18504
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-03 17:39:16 +00:00
Ryan Macnak
2761c556ca Revert "[vm] Popcount via compiler intrinsics."
This reverts commit c4f4cdbf29.

Reason for revert: ARM compile-time errors

Original change's description:
> [vm] Popcount via compiler intrinsics.
> 
> Change-Id: I8913beea7b984f04cec7f9efc00673aa12095eda
> Reviewed-on: https://dart-review.googlesource.com/18423
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=rmacnak@google.com,zra@google.com

Change-Id: I5efe8100e3c1fa404b1c24f369dca5c137acd2b8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/18640
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-11-03 16:50:47 +00:00
Ryan Macnak
c4f4cdbf29 [vm] Popcount via compiler intrinsics.
Change-Id: I8913beea7b984f04cec7f9efc00673aa12095eda
Reviewed-on: https://dart-review.googlesource.com/18423
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-03 16:34:35 +00:00
Zachary Anderson
9ab8b55663 [gn] Split target arch/os defines from dart_config
This is a baby-step towards building an SDK targeting the host arch
during a cross-build. This will require a similar update to the use
of dart_config in the Flutter engine at //flutter/lib/io/BUILD.gn:19.

Change-Id: I8b871cceb53038cab8407264664c5ce545e6e010
Reviewed-on: https://dart-review.googlesource.com/17523
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-10-31 17:33:13 +00:00
Ryan Macnak
031069d2bd [vm] Avoid using a generated stub to get the current SP, since generated stubs aren't available during early start up.
Change-Id: Ib0d78965ba5ccb1fa2b084d82b2bb79485b7900f
Reviewed-on: https://dart-review.googlesource.com/12780
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-10-10 22:52:25 +00:00
Ryan Macnak
3609522166 printf format checking is a compiler feature, not a platform feature.
Change-Id: Ib3e0beb814b5cae6f2b4be13f055069f682674f5
Reviewed-on: https://dart-review.googlesource.com/11645
Reviewed-by: Zach Anderson <zra@google.com>
2017-10-09 22:26:01 +00:00
Alexander Markov
f6d6766920 [VM] Restore disassembler in flutter/profile (dart/release) mode
This CL restores disassembler in precompiled mode after it was removed
in 8cb752f73b.
Without disassembler observatory is not able to show assembly code
in 'flutter run --profile' mode.

This CL also pulls BufferFormatter out of il_printer.h/.cc as it is also
used in disassembler.

Change-Id: I098ddb8d8f5a2426028c1f467d58e5c2d6a82d21
Reviewed-on: https://dart-review.googlesource.com/7486
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-21 16:07:02 +00:00
Ryan Macnak
3d21a46b72 Limit preserialized JSON for timeline events from Dart code to the arguments.
Avoids string copies in C++ and map copies in Dart.

Also remove some vestiages of removed feature that allowed an embedder to add pre-encoded events to the timeline.

Change-Id: I962a67093ba461c991d9169b0391c44af1d489db
Bug: https://github.com/dart-lang/sdk/issues/30787
Reviewed-on: https://dart-review.googlesource.com/6762
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-19 23:29:55 +00:00
Alexander Markov
ffc85d1e92 [VM] Fix undefined behavior in Utils::Abs
Issue: https://github.com/dart-lang/sdk/issues/30572

Change-Id: If8c743edb140edb7a7f803521b51c776d41db5d6
Reviewed-on: https://dart-review.googlesource.com/5881
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-14 18:15:17 +00:00
Zachary Anderson
3470145529 [Fuchsia] Update to use new tracing API
Change-Id: Ied0bc594fe16f427be10444ad5739a30b7003acc
Reviewed-on: https://dart-review.googlesource.com/4062
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-12 16:42:07 +00:00
Zachary Anderson
734beef062 [infra] Translate _sources.gypi files to _sources.gni files
Also deletes code that becomes dead as a result.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2996903002 .
2017-08-14 21:54:36 -07:00
Alexander Markov
ed74405635 [vm] Revise Dart_IntegerToHexCString to avoid dependency on Bigint, v.2
Reapply 3d4838fc70 with the following
modifications:
* define PRIX64 to fix compilation errors on Windows;
* add and use short form format specifiers PX and PX64 to make it
  uniform with other format specifiers.

Original review: https://codereview.chromium.org/2987183002

Description of the original CL:

Until this change, implementation of Dart_IntegerToHexCString()
always created Bigint objects and used Bigint::ToHexCString() to do
the work.

In --limit-ints-to-64-bits mode (with Dart integers limited to 64
bits) Bigints are banned and should not be used.
This CL revises Dart_IntegerToHexCString implementation to avoid
creating Bigint objects for Smi and Mint arguments, so it would
work in --limit-ints-to-64-bits mode.

Also, this CL adds test case to lock down the behavior of
Dart_IntegerToHexCString.

R=zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2985423002 .
2017-08-01 10:49:51 -07:00
Zachary Anderson
6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Alexander Markov
7a20b6b8d8 Option to truncate integers to 64 bits, part 1 (core VM changes)
This changeset revises --limit-ints-to-64-bits option to
change range of integers from unlimited to int64.
On overflow, integer arithmetic operations silently wrap around and
discard extra bits. No Bigints are allocated in case of overflow.

This changeset is the 1st part in the series of changes, it revises the implementation of integer arithmetic operations. More changes will follow.

R=regis@google.com, zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2974633003 .
2017-07-10 15:16:40 -07:00
Erik Corry
029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Zachary Anderson
ac16656161 Remove MIPS support
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2858623002 .
2017-06-22 08:49:22 -07:00
Ryan Macnak
e1b31c6b4b [arm, arm64] Convince the Android toolchain not to bypass memcpy in Read/StoreUnaligned.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2953653002 .
2017-06-21 14:03:50 -07:00
Ryan Macnak
dddd96cfd2 [arm] Avoid unaligned access fault in Int32x4/Float32x4::value().
R=zra@google.com

Review-Url: https://codereview.chromium.org/2947783002 .
2017-06-21 09:11:04 -07:00
Zachary Anderson
5850122513 Fix simarm build for newer gcc's
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2924473002 .
2017-06-05 09:22:06 -07:00
Erik Corry
aa60a2ea90 More compact string representation on 64 bit.
This moves the hash code into the header word for strings on 64 bit
platforms.  With the old layout, 9 character strings became 48-byte
objects.  With the new layout you have to go to 17 characters before
you are bumped from 4 to 6 words (32 to 48 bytes).

As a side effect, the class ID field is now 16 bits on all platforms
instead of having two different sizes, and the size field is 8 bits
on all platforms.

This also paves the way for moving the hash code for instance objects
into the header, so we won't need the side-lookup in the
hash-table-of-hash-codes on 64 bit platforms.

This is a reapplication of https://codereview.chromium.org/2893553002/
after issues were fixed in https://codereview.chromium.org/2888413002/
and https://codereview.chromium.org/2896583002/

R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2895183002 .
2017-05-22 10:04:59 +02:00
Dmitry Stefantsov
e5f93a068f Revert "More compact string representation on 64 bit."
This reverts commit 5c8e472c82.

TBR=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2889723005 .
2017-05-18 14:23:12 +02:00
Erik Corry
5c8e472c82 More compact string representation on 64 bit.
This moves the hash code into the header word for strings on 64 bit
platforms.  With the old layout, 9 character strings became 48-byte
objects.  With the new layout you have to go to 17 characters before
you are bumped from 4 to 6 words (32 to 48 bytes).

As a side effect, the class ID field is now 16 bits on all platforms
instead of having two different sizes, and the size field is 8 bits
on all platforms.

This also paves the way for moving the hash code for instance objects
into the header, so we won't need the side-lookup in the
hash-table-of-hash-codes on 64 bit platforms.

R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2893553002 .
2017-05-18 11:54:40 +02:00
Erik Corry
aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02:00
Zachary Anderson
8c9c54d833 [dart:io] Don't close stdin with a socket finalizer
If an Isolate touches the 'stdio' getter, a _NativeSocket with
attached finalizer is created for it. Previously, when such an
Isolate exited, the finalizer would close the underlying
file descriptor. This CL changes the finalizer for stdin such
that the native objects will be cleaned up, but the underlying
file descriptor will not be closed. The underlying file
descriptor will now only be closed if the stdin stream
subscription is explicitly canceled.

Accessing the stdin getter after the stream is explicitly
canceled will result in a FileSystemException.

See also: https://github.com/dart-lang/test/issues/583

fixes #29229

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2791423002 .
2017-04-04 13:57:42 -07:00
Ryan Macnak
9f2668c998 Set TARGET_OS_* from GN, falling back to HOST_OS_*.
Use TARGET_OS_* instead of HOST_OS_* to decide on the assembly variant to use. Allows, say, a gen_snapshot compiled for a Mac to target Android when generating AOT as assembly.

R=fschneider@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2757783003 .
2017-03-20 14:48:28 -07:00
Ryan Macnak
877284947b Rename TARGET_OS_* to HOST_OS_*.
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.

Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2750843003 .
2017-03-15 13:11:05 -07:00
Ryan Macnak
781fd36086 Add an option to gen_snapshot for creating a Makefile describing a snapshot's dependencies. This option may be used when generating any snapshot kind, or without generating a snapshot.
- Factor out MallocGrowableArray from vm to platform.
 - Add File::Print.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2715463003 .
2017-02-23 12:40:48 -08:00
Ryan Macnak
9eb216a495 Reapply "Create an app snapshot of the Dart front end."
Skip training on Windows, issue #28532.

R=hausner@google.com

Review-Url: https://codereview.chromium.org/2665753002 .
2017-01-31 09:47:51 -08:00
Ryan Macnak
728f460798 Revert "Create an app snapshot of the Dart front end."
This reverts commit 8c7111c967.
This reverts commit 27c8e59d2e.

Review-Url: https://codereview.chromium.org/2657123002 .
2017-01-26 17:42:25 -08:00
Ryan Macnak
8c7111c967 Create an app snapshot of the Dart front end.
R=asiva@google.com, hausner@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2655173002 .
2017-01-26 16:28:59 -08:00
Martin Kustermann
a9fbe2004d VM: Tell lsan about mmap()ed regions used for our heap
The mmap()ed pages hold pointers to `VirtualMemory` objects. So we tell
lsan that the mmap()ed regions are roots.

R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2646363005 .
2017-01-24 12:47:36 +01:00
Ryan Macnak
4f598c584d GN: Fix cross ARM64 and cross MIPS builds.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2643583002 .
2017-01-20 15:44:24 -08:00
Martin Kustermann
37dfdbdc97 VM: Remove unused (and incomplete) HashMap::Remove() function
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2542103002 .
2016-12-01 13:51:49 +01:00
Martin Kustermann
d822f36f15 VM: Fix memory leak during shutdown
The way runtime/platform/hashmap.h:HashMap was implemented so far did not allow
deleting elements while iterating over the map. If one iterated like this

  HashMap::Entry* cursor = map.Start();
  while (cursor != NULL) {
    if (cond) {
      map.Remove(cursor->key, cursor->hash);
    }
    cursor = map.Next(cursor);
  }

Then the iteration `cursor` will skip elements. This is due to the fact that
`HashMap::Remove()` is left-rotating elements in certain cases and
`HashMap::Next()` will unconditionally advance to the next position in the
backing store.

PROBLEM IS: There was existing code which did remove elements while iterating
over a HashMap.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2533303005 .
2016-11-30 23:52:04 +01:00
Siva Annamalai
501720c644 Retry landing cl for issue with TSAN.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2525103003 .
2016-11-23 15:40:26 -08:00
Siva Annamalai
66cb033ac1 Revert "Fix tsan failure"
This reverts commit 159a5ab366.

This reverts commit aa76de9a8f.

BUG=

Review URL: https://codereview.chromium.org/2510093005 .
2016-11-18 16:44:32 -08:00
Siva Annamalai
159a5ab366 Fix tsan failure
We have a racy read of the object header in the stack frame walker
called from the profiler (in this case the gc marker is running at
the same time).

It is appropriate to avoid this even though we think the access is
safe as the objects are in old space and never forwarded and only
the mark bits are manipulated while marking
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2517473002 .
2016-11-18 14:09:02 -08:00
Vyacheslav Egorov
35c828c2d2 VM: Fix Flutter build.
libdart_vm_nosnapshot should not include dart_maybe_precompiled_runtime_config.

DART_NOSNAPSHOT and DART_PRECOMPILED_RUNTIME are mutually exclusive configurations
add a meaningful check in the globals.h to catch this instead of cryptic compile
time errors.

R=kustermann@google.com
BUG=

Review URL: https://codereview.chromium.org/2515663002 .
2016-11-18 15:48:01 +01:00
Zachary Anderson
a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zachary Anderson
6953586716 Add .clang-format and run clang-format on runtime/platform.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2470663006 .
2016-11-03 14:25:16 -07:00
Zachary Anderson
e29da6037b Small cleanups and linter fixes.
Review URL: https://codereview.chromium.org/2455983002 .
2016-10-27 05:02:20 -07:00
Zachary Anderson
103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Zachary Anderson
8200955ed0 Fuchsia: Add native symbol resolver. Small fixes.
R=asiva@google.com

Review URL: https://codereview.chromium.org/2438843002 .
2016-10-20 13:39:35 -07:00
Ryan Macnak
61bf8abd75 Make fatal out of memory messages uniform.
Add checks in a few more places with large allocations.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2418323002 .
2016-10-19 16:37:59 -07:00
Zach Anderson
71a84cfed6 GN: Fix Debug flags. Fix Windows build.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2425043002 .
2016-10-17 12:58:24 -07:00
Siva Annamalai
42c58c5c2d - fix some cases where we are using uninitialized memory
- use attribute 'no msan' on NativeEntry::ReturnValueIsError function
  as msan doesn't seem to track the return slot being set by a native
  function
- vsnprintf seems to have issues with msan so unpoison the allocated
  memory buffer everytime vsnprintf is used to suppress the error.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2383293003 .
2016-10-05 16:54:18 -07:00
Ryan Macnak
47cc06ae66 Shrink AOT snapshot size and memory usage.
- Conditionally remove fields of Code, Function and ICData that are not used in the AOT runtime.
 - Don't include RawClosureData.context_scope_ in AOT snapshots.
 - Remove parameter names not needed for method resolution.
 - Remove parameter types not needed for function type tests.
 - Deduplicate parameter name and parameter type lists.
 - Shrink and share the initial MegamorphicCache table.

Flutter gallery (IsolateSnapshotReader event)
snapshot size 2731129 -> 2199999 (-19.4%)
initial heap  7899568 -> 5433176 (-31.2%)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2326483005 .
2016-09-15 15:06:42 -07:00
Zach Anderson
a695975d00 Fixes run_vm_tests Windows shutdown problem
related #27250

R=fschneider@google.com

Review URL: https://codereview.chromium.org/2311283002 .
2016-09-06 10:10:40 -07:00
Ryan Macnak
d418dde65b Reduce copying in sending service responses.
Add missing safepoint transitions.

Issue #27092
Likely contributes to Issue #27010

dart2js hello
Peak RSS at first Observatory visit -> Peak RSS after visiting timeline (with endless recorder)
Before 215M -> 321M
After 182M -> 233M

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2254543006 .
2016-08-18 10:34:50 -07:00
Zach Anderson
581939d8b6 Retry: Fixes memory leaks in the eventhandler
Crashes were caused by removing from a std::map while iterating over it.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2231123002 .
2016-08-10 15:20:30 -07:00
Zachary Anderson
bf085120f6 Revert: Fixes leak of duplicate command line environment strings
For bot crashes on Mac

Review URL: https://codereview.chromium.org/2229973002 .
2016-08-09 15:36:57 -07:00
Zachary Anderson
92abe83b26 Fixes memory leaks in the eventhandler
These probably only happen when the VM is going down after an unhandled
exception, but I want to fix them anyway.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2228503007 .
2016-08-09 15:20:50 -07:00
Zachary Anderson
e476e00ca6 Fuchsia: Use low-level prng call, add test, update test runner.
There is now a syscall for getting cryptographically secure random bytes.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2204523002 .
2016-08-02 13:18:37 -07:00
Ryan Macnak
b01541d54d Attempt to print the stack using the profiler upon assertion failure.
Fix mismatched free of native symbol.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2199453002 .
2016-07-29 13:29:25 -07:00
Zachary Anderson
74bbc7f55f Fuchsia: Make some more VM tests pass
R=asiva@google.com

Review URL: https://codereview.chromium.org/2189973003 .
2016-07-29 08:07:25 -07:00
Zachary Anderson
53374c3b99 Fuchsia: Build standalone VM. Make it run "Hello, World!".
This CL adds targets to the GN build that build the standalone Dart VM
without the observatory, and with dart:io enabled but with most of the
functionality stubbed out as UNIMPLEMENTED(). It also adds a simple
eventhandler for Fuchsia for implementing Timers.

R=asiva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2168193002 .
2016-07-22 14:00:31 -07:00
Zachary Anderson
b30da81483 Fuchsia: Hello, Fuchsia!
R=asiva@google.com

Review URL: https://codereview.chromium.org/2158673002 .
2016-07-18 10:35:03 -07:00
Zachary Anderson
e27b49fc80 [fuchsia] GN build support for Fuchsia OS and fuchsia_test target
This adds a GN target for the 'fuchsia_test' executable and teaches
the GN build about is_fuchsia. Key differences:

*) There's not currently a dart:io implementation for Fuchsia
*) Fuchsia's toolchain currently doesn't support (or need) ldl or lpthread
*) Fuchsia's buildconfig doesn't currently set the is_asan variable

Review URL: https://codereview.chromium.org/2149953003 .
2016-07-14 15:01:30 -07:00
Ryan Macnak
d75699e863 Make core snapshots word-size portable again.
Flutter creates a single core snapshot (from x64) that is used by both sky_snapshot (x64) and the engine (arm).

R=asiva@google.com

Review URL: https://codereview.chromium.org/2132833002 .
2016-07-08 14:18:44 -07:00
Zachary Anderson
a503570e3a Fuchsia: Initial check-in.
Instructions to build and run are in README.fuchsia.

R=asiva@google.com

Review URL: https://codereview.chromium.org/2117593002 .
2016-07-01 12:42:05 -07:00
Carlo Bernaschina
21ce02fb70 Use official JSON encoding for stream
Closes https://github.com/dart-lang/sdk/issues/26721

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2081433002 .
2016-06-28 15:40:08 -07:00
Zachary Anderson
fcf4578c03 Remove STL use from platform/assert.cc
R=asiva@google.com

Review URL: https://codereview.chromium.org/2085703002 .
2016-06-21 12:50:43 -07:00
Vyacheslav Egorov
97a8c4caff VM: Fix WeakProperty processing during parallel marking.
Previously if one marker marked the weak property and another marker marked its key then the first marker might stop marking before it sees that the key was marked.

Here is a possible concurrent execution, assuming P is a WeakProperty and K is P.key:

    (Marker A)                        (Marker B)
        |                                  |
[ mark property P     ]                    |
        |                                  |
[ drain marking stack ]                    |
[ no more work to do  ]                    |
        |                       [ mark K               ]
        |                       [ draing marking stack ]
        |                       [ no more work to do   ]
        |                                  |
        |                                  |
       ...                                ...
        |                                  |
    [Finalize]                         [Finalize]
        |
    [Clear P]

In this execution we end up clearing P even though P.key is marked.

To fix this issue without reintroducing central WeakProperty processing
we change the marking phase loop in such a way that markers consider the
marking done only if all of them agree that they have no more weak properties
with marked keys.

Essentially the marking loop now has a separate phase where all markers check
their pending weak properties. The decision to proceed to the next marking phase
(weak handles processing) is done in lock step using barrier - either all threads
advance to the next stage or one of the threads finds a weak property
with marked key and unmarked value and all threads resume marking.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2041413005 .
2016-06-09 18:50:23 +02:00
Ryan Macnak
85cdc0eac2 Don't assume we want the iOS ABI if running simarm on Mac and the EABI otherwise.
Allow controlling the target ABI by defining TARGET_ABI_IOS or TARGET_ABI_EABI.  If neither is defined, default to the previous behavior.

Make Linux, Mac, Android and iOS agree on the value of PreferredCodeAlignment for all architectures.

BUG=http://dartbug.com/26464
R=zra@google.com

Review URL: https://codereview.chromium.org/1982613003 .
2016-05-17 15:03:54 -07:00
John McCutchan
fc117e0b87 Merge branch 'master' into undo_last_change
Undo the previous change
2016-05-17 12:38:04 -07:00
John McCutchan
dfb1e1b0f5 Attempt to get the bots to rebuild the world
BUG=

Review URL: https://codereview.chromium.org/1988843003 .
2016-05-17 12:35:29 -07:00
Zachary Anderson
f82a8c9af2 Disable concurrent marking/sweeping, and background compilation on ARMv5TE
Also adds missing feature detection to the graph intrinsifier.

R=iposva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1974873002 .
2016-05-12 15:09:42 -07:00
John McCutchan
0cfd4f5cd5 GN Build fixes for Flutter + gen_snapshot fix
1. Add "dart_runtime_mode" GN argument. This is an enum with three valid values: "release", "profile", and "develop".
   *) "release" builds product precompiled-runtime.
   *) "profile" builds non-product precompiled-runtime.
   *) "develop" builds non-product non-precompiled-runtime.

2. Remove the redundant "dart_product" GN argument.

3. Kill all *precompiled_runtime static library variants and the related config.

4. Always include the precompiler in gen_snapshot.

5. Support multiple --embedder_entry_points_manifest arguments to gen_snapshot.

6. Update our test harness to use gen_snapshot and pass the same kinds of command line arguments the Flutter folks are using.

7. ASSERT that both DART_PRECOMPILED_RUNTIME and DART_PRECOMPILER are not set at the same time.

R=fschneider@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1903583002 .
2016-04-22 07:00:03 -07:00
Vyacheslav Egorov
ee0f608ce4 Dart Byte Code interpreter.
This version is Clang/GCC only and does not support Windows because it uses computed goto's.

Only unoptimized mode is supported.

Architecture is described in constants_dbc.h and stack_frame_dbc.h.

R=fschneider@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1858283002 .
2016-04-18 23:02:01 +02:00
Srdjan Mitrovic
cef337f8c7 Add instruction tags to saved ICData (debug mode only).
When restoring ICData in optimizing compiler, we can verify that the ICData/deopt-id matches an instruction. This should help catch non-deterministic graph generation.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1864143002 .
2016-04-06 11:01:46 -07:00
Zach Anderson
08450dc432 Begin work on ios secure sockets
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1839123003 .
2016-03-31 12:55:31 -07:00
John McCutchan
9bc7398eb8 Ensure embedder timeline callbacks are called for service protocol requests
BUG=
R=chinmaygarde@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1799933002 .
2016-03-15 07:59:04 -07:00
Ivan Posva
c822c34af6 - Add DEBUG_ONLY and NOT_IN_PRODUCT macros.
- Remove user_name_ field from RawClass using macros.
- Consolidate "#ifndef PRODUCT" and "#ifdef DEBUG" code using macros.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1715123003 .
2016-02-19 17:48:08 -08:00
Ivan Posva
4f392df85e Fix some more shorten-64-to-32 warnings:
- Remove duplicate check for javascript integer overflow.
- Make sure the BitField class knows the type it is
  encoding into.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1644223006 .
2016-02-02 13:58:06 -08:00
Zachary Anderson
963946af00 Disable TLS destructors on Windows before calling abort() for an ASSERT.
This fixes some flaky failures and timeouts on Windows in tests where
an ASSERT fails.

This change requires Using OS::Abort in platform/assert.cc so that the
flag disabling tls destructors can be set.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1572913002 .
2016-01-11 10:35:00 -08:00
Ivan Posva
6249c2bcf3 - Remove the legacy debug protocol.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1497033003 .
2015-12-03 17:46:02 -08:00
John McCutchan
aaf37ad035 Landing patch set 7 from https://codereview.chromium.org/1450113003/
Review URL: https://codereview.chromium.org/1466523002 .
2015-11-19 14:18:52 -08:00
John McCutchan
28e416b1f4 Revert "Avoid strerror_r portability issues"
This reverts commit ca81c1732b.
2015-11-17 16:34:25 -08:00
John McCutchan
ca81c1732b Avoid strerror_r portability issues
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1450113003 .
2015-11-17 15:23:47 -08:00
Zachary Anderson
3563dc0fb0 Use ExitProcess on Windows.
Even after joining threads, it is still possible for the exit code to be
polluted. NaCL uses ExitProcess to avoid this problem:

https://code.google.com/p/chromium/codesearch#chromium/src/native_client/src/shared/platform/win/nacl_exit.c

This change also cleans up thread local storage for the last Thread.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1410293006 .
2015-10-29 23:35:46 -07:00
Chinmay Garde
87ce99fd00 Enable generation of instruction buffer on precompilation
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1411383004 .
2015-10-22 12:26:41 -07:00
William Hesse
e6b85bb28c Use #if TARGET_OS_IOS instead of #ifdef TARGET_OS_IOS.
New versions of the OS X SDK always define TARGET_OS_IOS, as 0 or 1.

BUG=https://github.com/dart-lang/sdk/issues/24501
BUG=https://github.com/dart-lang/sdk/issues/24453
R=iposva@google.com

Review URL: https://codereview.chromium.org/1388973002 .
2015-10-12 12:38:10 +02:00
Todd Turnidge
cc981c8246 Don't use %p when generating disassembly in vm service.
Evidentally it is platform dependent -- it seems to include the 0x
prefix on mac but not on windows.  I've switched to using %" Px "
instead.

This will fix bug 24038.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1282993002 .
2015-08-11 11:22:55 -07:00
Todd Turnidge
81d5c8c508 Add STDOUT_FILENO, etc., for windows build.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1234953003 .
2015-07-14 14:28:06 -07:00
Ryan Macnak
b8bad6725c Expand the class id to 32 bits and size field to 16 bits on 64-bit platforms.
Remove misleading suffix from disassembly of some ia32 immediate ops.

R=asiva@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//1174173007.
2015-06-12 16:42:40 -07:00
Ryan Macnak
a16abcdf5a Shrink some fields and add some bounds checks.
R=asiva@google.com

Review URL: https://codereview.chromium.org//1149943009.
2015-06-09 10:47:25 -07:00
Srdjan Mitrovic
c0824e7725 Fix 23563: double unary- operator unstable for NANs
BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1160453003
2015-06-03 11:00:28 -07:00
Ivan Posva
8f1506e817 - Determine whether the simulator is being used in globals.h
- Make sure to switch on HOST_ARCH_ and on USING_SIMULATOR
  where appropriate.
- Avoid allocating in new generation when running in the VM isolate.

BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1156053006
2015-05-29 14:35:29 -07:00
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
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
johnmccutchan@google.com
e23be8563a Fixes to enable building dart:io implementation cleanly in mojo tree
+ make Observatory respect script line offsets (which Sky uses).

R=iposva@google.com

Review URL: https://codereview.chromium.org//1101083003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45427 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-27 14:46:32 +00:00
turnidge@google.com
e10de2de1a Fix the build.
BUG=

Review URL: https://codereview.chromium.org//1038973002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44719 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-26 19:23:14 +00:00
turnidge@google.com
140a071acb Allow Observatory debugger to switch isolates.
- Add the "isolate" command which allows the user to switch isolate by name or number.  Supports completion.

- Add the "isolate name" command which allows the user to rename an isolate.  Add the "setName" method to the service protocol to support this.  Isolates now have a debugger_name() in the vm.

- The new IsolateUpdate event notifies the client when an isolate name changes.

- When an isolate is updated, update the page's isolate too, so the navbar is accurate.

- Update isolate summary to display isolate number.

- Rework how the isolate's name is computed because we were getting garbagey names in the IsolateStart event (SpawnState was not yet set).

- Make sure that the debugger doesn't subscribe to events multiple times.

- "info isolates" is now "isolate list".

- Rework reporting of vm and isolate startTime in the service protocol and in Observatory.

- Fix bug in command completion when subcommands and other completions share common prefixes.

- Rework isolate accounting in the VM object in Observatory.  We now create Isolates in getFromMap rather than from IsolateStart events, per se.  Rewrite the isolate updating code.

- IsolateStart and IsolateExit events are now owned by the Isolate itself, rather than the vm.

- Return the actual result in pause/resume/etc.

- Add assertion in JSONStream::PrintProperty64 that the result fits in a javascript double.  Sigh.

- Stop sending GC events for the service isolate.  Add assertions to guard against this happening in the future.

- Misc improvements in error reporting.

Review URL: https://codereview.chromium.org//1007863003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44718 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-26 19:06:18 +00:00
fschneider@google.com
aefdc04fa8 VM: Fix issue with local variable values reported by the debugger.
I added a function to test if a variable is visible or not to the
debugger tests.

BUG=dartbug.com/22353
TEST=standalone/debugger/local_variables_test
R=hausner@google.com

Review URL: https://codereview.chromium.org//933253003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43850 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-18 18:48:00 +00:00
koda@google.com
4cac1a531a Increase verbosity of assertion failures in SizeFromClass.
Print the tag word for which the assertion fails.
This is specifically to help tracking down issue 22087.

TBR=iposva@google.com
BUG=dart:22087

Review URL: https://codereview.chromium.org//919063002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43732 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 18:08:55 +00:00
koda@google.com
bf07d168c4 MallocGrowableArray
To be used where neither Dart nor zone allocation is suitable, such as ClassTable.

Also add ASSERT_NOTNULL convenience macro for use in initializer lists.

R=asiva@google.com

Review URL: https://codereview.chromium.org//850473002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42819 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 16:40:09 +00:00
koda@google.com
08edbbd6b4 MemorySanitizer support.
Enables building (including generating snapshot) and running simple scripts under MemorySanitizer.
Not all tests pass yet.

R=asiva@google.com

Review URL: https://codereview.chromium.org//816123002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42561 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-23 01:07:58 +00:00
vegorov@google.com
29f021439a Infer range for BIT_XOR.
When selecting representations unbox integer phis that have Int32 range and have only constants or boxing operations flowing into them.

BUG=http://dartbug.com/13869
R=fschneider@google.com

Review URL: https://codereview.chromium.org//712993005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41667 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 14:51:10 +00:00
vegorov@google.com
ddbe93418d Work around GCC bug that results in incorrect simd128_value_t copying.
Under certain conditions GCC on x86 decides to copy simd128_value_t through FPU stack.

For example Int32x4::value getter would contain the following code:

   212d5: d9 46 07              fld    DWORD PTR [esi+0x7]
   212d8: d9 46 0b              fld    DWORD PTR [esi+0xb]
   212db: 8b 46 03              mov    eax,DWORD PTR [esi+0x3]
   212de: d9 46 0f              fld    DWORD PTR [esi+0xf]
   212e1: d9 ca                 fxch   st(2)
   212e3: d9 5b 04              fstp   DWORD PTR [ebx+0x4]
   212e6: d9 5b 08              fstp   DWORD PTR [ebx+0x8]
   212e9: 89 03                 mov    DWORD PTR [ebx],eax
   212eb: d9 5b 0c              fstp   DWORD PTR [ebx+0xc]

This code is incorrect. For example an attempt to copy an int32_t value that
looks like sNaN will result in it turning into a qNaN which changes
the value being copied.

GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58416

This was causing flakiness when people were running WebSocket related tests
locally on Dart VM binaries built with GCC as our WebSocket implementation uses
Int32x4 values to speed up payload masking/unmasking.

Bots were not affected because they are building with clang.

BUG=http://dartbug.com/21220
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//692703003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41581 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-06 20:16:34 +00:00
iposva@google.com
cc13627fc8 - Remove Isolate::CurrentAddress().
- Remove use of INFINITY and -INFINITY.

R=rmacnak@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//609593002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40700 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 23:39:30 +00:00
asiva@google.com
35ef779824 Fix dartium windows build (broke after reecnt chrome 38 roll)
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//591213003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40566 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 20:30:27 +00:00
ricow@google.com
37e8c382dc Remove files from gypi file that have been removed from the repo
The files where removed in r39172

R=iposva@google.com

Review URL: https://codereview.chromium.org//553233005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40234 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 08:07:30 +00:00
rmacnak@google.com
128148aafc Preserve the contents of Dart strings with unmatched surrogate halfs by avoiding a UTF16 -> UTF8 -> UTF16 conversion.
Clean up some confusion between code points and code units.

BUG=http://dartbug.com/20583
BUG=http://dartbug.com/20874
R=turnidge@google.com

Review URL: https://codereview.chromium.org//558853004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40174 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 18:42:04 +00:00
koda@google.com
c7c45f8ba3 Fix Windows build (BitScanReverse returns position, not count).
Review URL: https://codereview.chromium.org//557993002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40074 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-10 00:40:20 +00:00
koda@google.com
d70cfe1f52 Fix ancient Windows freelist bug.
Since r9836 (July 2012), we have been searching the freelists in the wrong order on Windows. The recently added bit_set_test.cc uncovered this bug.

Also add dedicated unit test case for Utils::Count*Zeros.

R=asiva@google.com

Review URL: https://codereview.chromium.org//558753003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40067 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 22:59:04 +00:00
koda@google.com
06fb635a93 Speed up freelist by using intrinsics to find last set bit.
Also add unit test for BitSet.

R=iposva@google.com

Review URL: https://codereview.chromium.org//538213003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40057 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 21:17:07 +00:00
zra@google.com
c686b2c624 Finishes removing intptr_t from raw object fields.
Also removes {Read,Write}IntptrValue from the snapshot reader and writer.

R=asiva@google.com

Review URL: https://codereview.chromium.org//343803002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40048 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 19:51:22 +00:00
koda@google.com
cdafe57cac During promotion, use bump allocation whenever there are no small blocks available.
R=iposva@google.com

Review URL: https://codereview.chromium.org//534653002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39893 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 01:07:57 +00:00
johnmccutchan@google.com
342e5c8e35 Inline Int32x4 constructor
(avoids a runtime call for every websocket message in dart:io)

R=srdjan@google.com, zra@google.com

Review URL: https://codereview.chromium.org//475563002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39255 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-14 17:27:49 +00:00
zra@google.com
88ca926b7e Adds pthread.h include to fix Android build.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//471653002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39212 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 18:18:47 +00:00
iposva@google.com
62ea934642 - Make sure ASSERT is defined in signal_blocker.h.
Review URL: https://codereview.chromium.org//468683002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39178 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 23:49:09 +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
iposva@google.com
b70da362b9 - Make sure to be able to deal with unaligned snapshot buffers
for length and kind.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//417093005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38759 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-30 22:52:08 +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
regis@google.com
f58908bfdd Tweaks for speed in integer arithmetic runtime.
Unrelated:
Removed annoying svn property on utils.cc (indicated by MM):
  svn propdel svn:eol-style runtime/platform/utils.cc

R=srdjan@google.com

Review URL: https://codereview.chromium.org//381543002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38090 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-09 17:16:10 +00:00
zra@google.com
9e6655f810 Fixes Android build by using C++ math header instead of C one.
This change also requires prefacing the math calls with
std::, i.e. isinf -> std::isinf.

R=asiva@google.com, koda@google.com

Review URL: https://codereview.chromium.org//353403004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37839 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 22:15:26 +00:00
johnmccutchan@google.com
3eb3bc3fa9 Extend Range analysis to 64-bit range and mint operations
- Convert many private static functions into public static methods on Range or RangeBoundary classes.
- Simplify ConstraintInstr::InferRange to just use RangeBoundary::Min and RangeBoundary::Max calls.
- Extend RangeBoundary to 64-bits.
- Include mints in RangeAnalysis.
- Introduce generic Range::BinaryOp.
- Require ranges passed to Range::BinaryOp are finite.
- Clamp ranges attached to BinarySmiOpInstr and BinaryMintOpInstr.
- InferRange for BinaryMintOp and UnboxInteger instructions.
- Correctly set mint constant ranges.
- Add many tests.

R=fschneider@google.com, vegorov@google.com

Review URL: https://codereview.chromium.org//328503003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37521 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-19 21:13:26 +00:00
ajohnsen@google.com
d21ca48526 Flush stderr when printing ASSERT message.
This ensures that the message is received by the other end, e.g. test.dart, on Windows.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//323703002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37160 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-10 06:52:12 +00:00
zra@google.com
9c73009ff9 Prepares for arm64 cross-build.
With this change, the cross-build succeeds with the Linaro arm64 toolchain.

R=regis@google.com

Review URL: https://codereview.chromium.org//303443010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36698 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-27 18:05:20 +00:00
fschneider@google.com
01255e0843 Change COMPILE_ASSERT to take only one argument and use it in more places.
This way it can be used in the same way as ASSERT.

R=iposva@google.com

Review URL: https://codereview.chromium.org//298963006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36625 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-26 09:45:04 +00:00
zra@google.com
0676e14a22 Adds more SIMD instructions to arm64.
R=regis@google.com

Review URL: https://codereview.chromium.org//295243005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36585 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-23 20:34:29 +00:00
ajohnsen@google.com
02332b5539 Fix thread-interrupter shutdown on Windows.
This reworks the ThreadId on Windows to be the tid, and not an open HANDLE.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//294193003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36502 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-22 15:12:09 +00:00
srdjan@google.com
a9ecc2118c Use xorps xmm1, xmm1 to creat a 0.0 cconstant. Add to utils a bitwise double test.
R=zra@google.com

Review URL: https://codereview.chromium.org//267793005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35718 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-02 23:50:22 +00:00
ajohnsen@google.com
df14081452 Make opendir test for EINTR again and make NO_RETRY_EXPECTED check in release mode.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//253413002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35352 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-24 06:38:16 +00:00
zra@google.com
37baacb116 Small fixes for Android.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//254383003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35342 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 23:20:24 +00:00
iposva@google.com
fd8565b071 - Add a minimal implementation of Capability.
- Make RawReceivePort and SendPort VM internal objects.
- Rationalize the creation of ports and their handling within the VM.

R=asiva@google.com

Review URL: https://codereview.chromium.org//243973002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35325 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-23 19:44:03 +00:00
zra@google.com
2fe51715e5 Begins work on ARM64, first assembler test.
Most new code is in constants_arm64.h and
{assembler,disassembler,simulator}_arm64.{h,cc}

The rest of the CL just #def's out tests, modifies status files,
and adds UNIMPLEMENTED functions, etc.

R=regis@google.com

Review URL: https://codereview.chromium.org//221133002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34654 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-02 17:39:32 +00:00
ajohnsen@google.com
4f613457d6 Speed up GetRandomBytes by only entering signal-blocking scope once.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//209333014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34356 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-25 13:06:37 +00:00
ajohnsen@google.com
0c157cd31e Move signal_blocker to platform and use it by default in TEMP_FAILURE_RETRY.
BUG=http://code.google.com/p/dart/issues/detail?id=16927
R=johnmccutchan@google.com, sgjesse@google.com

Review URL: https://codereview.chromium.org//165723007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33745 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 13:51:11 +00:00
johnmccutchan@google.com
6ea46abd34 Create a shadow table to track CodeRegions of reused code address space.
R=asiva@google.com, turnidge@google.com

Review URL: https://codereview.chromium.org//197803004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33665 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 21:00:44 +00:00
koda@google.com
d3b65af6d3 Replace RoundMicrosecondsTo* with non-rounding MicrosecondsTo*.
(The existing function didn't actually round, it just incorrectly added 0.5.)

BUG=dart:17348
R=iposva@google.com

Review URL: https://codereview.chromium.org//191743002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33527 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-11 14:11:25 +00:00
iposva@google.com
f2a6f1b4b6 Another round of cleanups for http://www.dartbug.com/15922
- Address warnings about 64-bit to 32-bit conversions.

R=ajohnsen@google.com, asiva@google.com

Review URL: https://codereview.chromium.org//169893003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32831 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 23:35:55 +00:00
johnmccutchan@google.com
2820a12766 Allow for embedder provided service request handlers
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org//170943003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32769 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-18 22:38:11 +00:00
johnmccutchan@google.com
9d80608b9c Add Float64x2, Float64x2List, etc... with runtime and dart2js implementations
R=sra@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org//148043003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32196 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-31 15:28:05 +00:00
ajohnsen@google.com
89957d4117 Mark simd128_value_t as able to containing both float and int32_t.
This fixes a bug when compiled with MSVC, where some values (I suspect NANs) can be changed when passed to functions.

BUG=
R=kasperl@google.com

Review URL: https://codereview.chromium.org//138203003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32121 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-29 14:21:45 +00:00
iposva@google.com
781f737c6a First round of http://dartbug.com/15922:
- Address warnings about 64-bit to 32-bit conversions.
- Remove heap profiler.

R=asiva@google.com

Review URL: https://codereview.chromium.org//139043003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31867 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 05:05:35 +00:00
johnmccutchan@google.com
919dc2d6eb * Introduce ThreadInterrupter which calls a TLS set callback when thread is interrupted.
* Threads can only register and unregister themselves with ThreadInterrupter.
* Profiler is no longer involved in interrupting threads. It's just a callback and the buffer.
* Profiler operates lock free using an atomic operation to reserve sample in sample buffer.
* Linux, Mac, and Windows done.

R=asiva@google.com

Review URL: https://codereview.chromium.org//109803002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31170 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-16 18:52:15 +00:00
aprelev@gmail.com
5d77e6ae7a Fix VS2013 compilation issue with c99 support header.
BUG=dartbug.com/12874
R=iposva@google.com

Review URL: https://codereview.chromium.org//84613002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30764 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-28 16:13:09 +00:00
johnmccutchan@google.com
72afb81a8c - Fix MonitorData ASSERT failure in thread_win:
E:\b\build\slave\vm-win32-debug-russian-be\build\dart\runtime\platform/thread_win.h:66: error: expected: next_ == NULL.
- Reduce sample buffer size by an order of magnitude (this should fix .
- Disable profiler on simulators.
- Only sample when scheduled thread id matches current thread id.

Review URL: https://codereview.chromium.org//85333006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30647 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-25 22:06:33 +00:00
johnmccutchan@google.com
eb99334209 Attempt at enabling profiler
BUG=

Review URL: https://codereview.chromium.org//78713003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30478 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-20 17:57:56 +00:00
johnmccutchan@google.com
19e47f3535 Kill dead code
TBR

Review URL: https://codereview.chromium.org//76533003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30421 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 19:21:36 +00:00
johnmccutchan@google.com
97ac18aee9 Sampling profiler
BUG=4350
R=asiva@google.com

Review URL: https://codereview.chromium.org//25909002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30419 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 18:26:10 +00:00
ajohnsen@google.com
8f99537455 Fix large-file support for mac os x.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//61633003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30404 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 12:17:57 +00:00
ajohnsen@google.com
7fef1ff77a Add support for working with large files on unix systems, in dart:io.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//63363010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30399 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 11:38:20 +00:00
iposva@google.com
8b51ded2fb - Convert heap sizes to words from bytes.
R=asiva@google.com

Review URL: https://codereview.chromium.org//70993002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30325 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-16 00:17:52 +00:00
hausner@google.com
e5cd233fd9 Fix json message in debugger wire protocol
Removed faulty comma in message. This hopefully solves issue 13792.

R=devoncarew@google.com

Review URL: https://codereview.chromium.org//59883019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30311 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-15 19:14:47 +00:00
iposva@google.com
25b81b3e8b - Fix string conversion warnings.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//70613002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30204 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-12 19:43:44 +00:00
johnmccutchan@google.com
29c01044bc This is the final breaking change in dart:typed_data needed for Dart 1.0. We need this change because the ECMAScript SIMD specification only includes Int32x4 and Int32x4List and our types must match.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//56023004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29849 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 21:56:59 +00:00
sgjesse@google.com
36a67fa046 Implement fromEnvironment on bool, int and String
This implements const constructor fromEnvironment on bool, int and
String.

The VM have the added -Dname=value option to define the value for the
properties. All values are provided by using the -D - nothing is read
from the environment.

If the resulting value is null or - in the case of int.fromEnvironment
- not a number an ArgumentError is thrown.

This CL does not have any implementation for dart2js.

This is a continuation of the change
https://chromiumcodereview.appspot.com/24975002 by iposva@
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//50983002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29642 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 05:46:57 +00:00
cbracken@google.com
0fdb309321 Prefix compile-time typedef checks with __attribute__((unused))
Prevents build failure under gcc 4.8.

Bug report: http://dartbug.com/13645

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//24944003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28411 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-09 19:43:41 +00:00
sgjesse@google.com
b8912cff07 Replace the memcpy macro with a lint check.
This fixes the build under libc++.  It also allows us to check the
Windows and Android code.  While at it, replace all uncaught instances
of memcpy with memmove.

R=sgjesse@google.com

Review URL: https://codereview.chromium.org//23578046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27700 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 12:25:08 +00:00
fschneider@google.com
e174a4c18e Fix a compiler bug caused by Utils::IsPowerOfTwo treating zero as a power of two.
The IsPowerOfTwo function is used together with ShiftForPowerOfTwo.  Both function
do not work with zero. This caused the optimizing compiler to generate invalid code
for the expression

x ? 0 : 0

where it assumed that if one of the constants is a power-of-two, it can
be computed by (1 << n). We check for 0 in a number of places, but instead
I decided to fix Utils::IsPowerOfTwo itself and remove unnecessary checks
for the zero case.

TEST=tests/language/vm/if_conversion_vm_test.dart, runtime/vm/utils_test.cc
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//23604024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27033 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 09:28:34 +00:00
hausner@google.com
a105ba48fc JSON string decoding for VM debugger
The VM must properly decode JSON strings it receives.

R=regis@google.com

Review URL: https://codereview.chromium.org//23439002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26668 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 20:59:16 +00:00
whesse@google.com
2b804f7d4d Add Windows error code reporting printing format fix in runtime.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//22927012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26310 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-19 09:27:42 +00:00
sgjesse@google.com
05a1eab78f Add error code to fatal termination messages on Windows
R=ager@google.com
BUG=

Review URL: https://codereview.chromium.org//22844004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26262 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-16 09:07:27 +00:00
dgrove@google.com
b1e0333103 Fix warnings.
R=iposva@google.com

Review URL: https://codereview.chromium.org//22377005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25954 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 23:03:17 +00:00
cbracken@google.com
a6ace331f3 Replaced strerror() calls with threadsafe strerror_r().
Mac/Android use the XSI-compliant definition of strerror_r() which stores the message in the passed-in buffer.

Linux uses the GNU-specific definition of strerror_r() which takes a buffer and returns the message in a char* (which may or may not be the passed-in buffer).

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//22634003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25943 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 20:24:05 +00:00
zra@google.com
f219f81b14 Begins implementation of ARM neon instructions.
Just adds the vadd instruction, but also changes the
arm assembler to expose the Q registers rather than the
D registers. Q0 = D1:D0 = S3:S2:S1:S0. This is similar
to how ia32 and x64 use only the xmm registers for
floating point.

R=regis@google.com

Review URL: https://codereview.chromium.org//18684008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24982 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-12 23:22:50 +00:00
asiva@google.com
703bad2d2a Revert change 23636 as it is causing issues on dartium. Will resubmit after investigating the dartium failure.
Review URL: https://codereview.chromium.org//16378004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23641 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 17:28:01 +00:00
asiva@google.com
bd14296eb7 Fix for issue 1755.
Use 'new' in all the snapshot reallocation functions instead of realloc.
This would result in program termination when allocation fails and will
ensure that a NULL will not be returned.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//16271010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23636 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 16:21:04 +00:00
sgjesse@google.com
2e857ff194 Put HashMap class in dart namespace.
R=sgjesse@google.com
Signed-off-by: Thiago Farina <tfarina@chromium.org>

Review URL: https://codereview.chromium.org//14572004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22175 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 11:48:48 +00:00
sgjesse@google.com
05e5da6dca Remove include which was not needed
R=whesse@google.com
BUG=

Review URL: https://codereview.chromium.org//14629002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22171 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 10:18:34 +00:00
regis@google.com
52a0f3c983 Enable api tests on ARM.
Disable generation of optimized code on ARM and MIPS.

Review URL: https://codereview.chromium.org//14476009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21972 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 18:55:52 +00:00
srdjan@google.com
cc94080d4d Fix performance of parsing Mints.
Review URL: https://codereview.chromium.org//13852044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21767 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 20:22:26 +00:00
zra@google.com
dae5068650 Enables cross-compilation of the VM for ARM.
Uses the "toolset" feature of gyp to build the dart VM
for ARM, but restricts building of snapshot generation
to the host machine.

For generated source files, it also changes to using
LIB_DIR instead of SHARED_INTERMEDIATE_DIR to avoid
generation of duplicate Makefile rules (gyp doesn't
know that generated source files from toolchains it
thinks are different will be the same.)

Review URL: https://codereview.chromium.org//12726011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21757 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 18:05:44 +00:00
asiva@google.com
fc88f85589 Add utilities for converting from Host endianity to big endian and little endian formats for the various OSs.
Review URL: https://codereview.chromium.org//14299008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21593 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-16 23:29:26 +00:00
iposva@google.com
0d8ff3ef16 - Add OS::StrNDup instead of redefining it when needed.
Review URL: https://codereview.chromium.org//13994008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21368 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 16:19:10 +00:00
iposva@google.com
a09fe36709 - Reverting the 'static' change of strndup.
Review URL: https://codereview.chromium.org//13971004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21323 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 23:46:14 +00:00
iposva@google.com
42413781d3 - Make the definition of strndup static to avoid conflicting in case it is available.
Review URL: https://codereview.chromium.org//14198007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21322 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 23:34:20 +00:00
iposva@google.com
c74dd9c9ca - Add strndup for Mac OS X version < 10.7.
Review URL: https://codereview.chromium.org//13817010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21321 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-11 23:26:15 +00:00
tball@google.com
95dfaf1718 Updated VM stacktrace support (20898) with platform-
independent version of strndup.
Review URL: https://codereview.chromium.org//13587008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20936 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-04 18:48:24 +00:00
sgjesse@google.com
3f6400812b Only lookup and delete the monitor wait data if it was allocated.
R=ager@google.com

BUG=https://code.google.com/p/dart/issues/detail?id=9403

Review URL: https://codereview.chromium.org//13470006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20772 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-02 12:28:56 +00:00
tball@google.com
7199ab26b1 Added string appending to TextBuffer, removed STL use in vm_stats_impl.
Review URL: https://codereview.chromium.org//13006007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20566 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-27 17:30:14 +00:00
johnmccutchan@google.com
3d4778e2c2 SIMD plumbing
Review URL: https://codereview.chromium.org//12871015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20287 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-20 20:29:00 +00:00
fschneider@google.com
86da5111ad Replace scalarlist optimizations and split external array loads into two IL instructions.
This CL removes optimized access for scalarlist, and only the new TypedData classes
are optimized. I changed the runtime libraries core and math to use typedData
instead of scalarlist (Uint16List is used in StringBuffer, Uint32List by Math.random).

Instead of using LoadIndexed for internal and external arrays,
split external loads into a load of the backing store and a load
of the element.

v3 <- LoadIndexed(v1, index)

becomes

v2 <- LoadUntagged(v1, ExternalTypedData::data_offset)
v3 <- LoadIndexed(v2, index);

For this I introduce two new representations in the IL:

 kUntagged (for values that hold a untagged pointer) and
 
 kNoRepresentation (for instructions accept any input
 representation)

Deoptimization does not need to know about kUntagged
since these values can never occur in the environment.

Also with this change:
* fix COMPILE_ASSERT and use it in one place.
* Cleanup IL printer output of deopt ids.
Review URL: https://codereview.chromium.org//12871010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20198 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 12:06:23 +00:00
ager@google.com
26c4b3a58d Fix file descriptor leak in event handler implementation. When shutting down an isolate, we did not destruct the eventhandler so we leaked the file descriptors for it.
Also fix leak of monitor wait data objects on Windows.

R=sgjesse@google.com
BUG=dartbug.com/9021

Review URL: https://codereview.chromium.org//12646007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19921 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-13 11:11:38 +00:00
johnmccutchan@google.com
6c4afdd546 Force WriteByte to be inlined
Review URL: https://codereview.chromium.org//12340086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19143 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 15:21:12 +00:00
iposva@google.com
9046a44a37 Prepare for removal of source_filter.gypi:
- Guard OS-dependent source files with #if TARGET_OS_* in a similar
  fashion to the architecture dependent sources.
Review URL: https://codereview.chromium.org//12282051

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18786 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-20 21:17:38 +00:00
iposva@google.com
826acfc074 - Avoid warnings when the result of TEMP_FAILURE_RETRY is unused.
Review URL: https://codereview.chromium.org//12178025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18732 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-19 22:43:22 +00:00
johnmccutchan@google.com
9fb0984c9d SSE Assembler + Linux build fixes
Review URL: https://codereview.chromium.org//12223115

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18493 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 23:05:17 +00:00
johnmccutchan@google.com
dd140c2958 Revert SSE assembler changes
Review URL: https://codereview.chromium.org//12212151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18410 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 23:14:12 +00:00
johnmccutchan@google.com
06eb49d537 SSE Assembler and Disassembler support
Review URL: https://codereview.chromium.org//12207117

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18406 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 22:43:48 +00:00
hausner@google.com
0b9e169dad Verify integrity of JSOM messages sent to debugger client
Make sure JSOM messages are grammatically correct and string values are properly encoded.
Review URL: https://codereview.chromium.org//12035086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17617 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 23:35:34 +00:00
regis@google.com
350fa57800 Add mips and simmips build targets.
Review URL: https://codereview.chromium.org//11859034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17319 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 21:34:53 +00:00
iposva@google.com
3e367a12d8 - Consolidate verbose-gc output to be a single line which can be imported easily into spreadsheets.
Review URL: https://codereview.chromium.org//11734028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16624 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-04 02:15:36 +00:00
ager@google.com
1fe5a6d631 Complete the transition to unicode APIs on Windows.
Define _UNICODE and UNICODE so that we do not add accidental
dependencies on non-unicode APIs.

Reapply the change without the completely broken code in
socket_win.cc. Instead use 'A' versions explicitly.

R=sgjesse@google.com,antonm@google.com

Review URL: https://codereview.chromium.org//11564017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16122 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-13 15:51:48 +00:00
ager@google.com
0952f0a37f Revert last unicode change. Causes Pub issues.
R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//11570006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16105 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-13 12:56:02 +00:00
ager@google.com
2a3c575b79 Complete the transition to unicode APIs on Windows.
Define _UNICODE and UNICODE so that we do not add accidental
dependencies on non-unicode APIs.

Anton, this could have an influence on Dartium builds as well?

R=sgjesse@google.com,antonm@google.com
BUG=

Review URL: https://codereview.chromium.org//11567010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16104 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-13 12:43:01 +00:00
ager@google.com
8d523fead9 Use unicode versions of process APIs on Windows. Additionally,
retrieve the arguments to dart as unicode strings.

R=sgjesse@google.com
BUG=

Review URL: https://codereview.chromium.org//11565008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16093 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-13 09:24:05 +00:00
aprelev@gmail.com
b09632ab95 Fix floating point issues on Windows.
BUG=dartbug.com/5407
TEST=

Review URL: https://chromiumcodereview.appspot.com//11411188

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15546 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 22:40:12 +00:00
iposva@google.com
48aed26029 Fix bug 6586:
- Attempt to run the Monitor thread_test multiple times before failing
  due to its potential to failure due to timing.
- Use named constants when converting millis to seconds and nanos.
Review URL: https://codereview.chromium.org//11361157

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14695 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 18:07:54 +00:00
cshapiro@google.com
661488717d Avoid integer overflow when computing the size of new space in bytes.
Review URL: https://codereview.chromium.org//11276022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14118 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-26 01:26:56 +00:00
johnmccutchan@google.com
d90ad834d5 Inline load and store index on Float32Arrays.
Review URL: https://codereview.chromium.org//11198072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13893 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 17:04:50 +00:00
srdjan@google.com
743c4a4475 Dart's stack size should be the same number of words on ia32 and x64, i.e. it should be twice as large on x64 as on ia32.
Review URL: https://codereview.chromium.org//11183071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13800 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-18 21:29:01 +00:00
zerny@google.com
792a5cbcee Added slow_assert macro and flag for slow development assertions in the VM.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//11014013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13069 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-01 14:27:45 +00:00
kmillikin@google.com
c70bcfcfa3 Support constant folding of instructions with constant smi values.
In sparse conditional constant propagation, replace instructions with
constant smi values with their constant value.  Extend the analysis to
understant shift and bitwise binary operations.

R=fschneider@google.com
BUG=

Review URL: https://codereview.chromium.org//10968058

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12778 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 13:14:54 +00:00
jackpal@google.com
3e510176c2 Fix Android build breaks
Prevent Android's STLPort from undefining global functions from
math.h when cmath is included after math.h.

The Android STLPort does not provide std::assert or std::atexit. Use
the C versions of these functions on Android.

BUG=

Review URL: https://codereview.chromium.org//10968027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12741 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 22:04:37 +00:00
cshapiro@google.com
87bd2a2721 Move inttypes.h compatibility definitions for Win32 out of globals.h.
Review URL: https://chromiumcodereview.appspot.com//10909103

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12000 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 00:05:47 +00:00
cshapiro@google.com
cd6d1044c2 A third attempt to implement 64-bit conversion specifiers on Win32.
Review URL: https://chromiumcodereview.appspot.com//10912111

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11914 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 01:19:17 +00:00
cshapiro@google.com
26b843c7ee Fix build break on Win32 and MacOS related to printf format string checks.
Implement remaining inttypes.h format specifiers on Win32

Resolve some conversion specifier discrepancies on MacOS.

Review URL: https://chromiumcodereview.appspot.com//10928013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11913 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 01:14:09 +00:00
cshapiro@google.com
da14bf70a7 Add attributions so printf like functions can have their arguments checked.
This change also corrects some misuses of format strings and format
arguments that discovered by the compiler checks.

Review URL: https://chromiumcodereview.appspot.com//10869063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11912 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 00:58:25 +00:00
vegorov@google.com
264c4f6d1a Add support for XMM registers in SSA code generation pipeline.
Split BinaryDoubleOp into several instructions that manipulate unboxed doubles.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10875030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11313 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 14:45:42 +00:00
cshapiro@google.com
28c9533a21 Use output-only string streams instead of input-output string streams.
The assertion code only writes to its string streams and never reads data
back.  As such, there is no reason to use a stream type supporting input.

Review URL: https://chromiumcodereview.appspot.com//10828317

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10693 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 23:55:37 +00:00
jackpal@google.com
e060b66a3e Add _android files for building DartVM on Android
Split directory_posix -> directory_(android|linux|macos)
  This allows us to cleanly make Android-specific changes to
  directory_android.cc

Copy all _linux files to _android files and edit as needed to account
for the differences between Linux and Android:

 + getcwd(0, NULL) doesn't work on Android, have to emulate
 + Android doesn't have a '/tmp' directory, have to emulate
 + Android doesn't provide mkdtemp(), have to emulate.
 + Small differences in the available system include files.
 + Use pthread_cond_timedwait_monotonic instead of
   pthread_condattr_setclock

Review URL: https://chromiumcodereview.appspot.com//10826233

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10613 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 23:06:52 +00:00
turnidge@google.com
2d70c7a5eb Improve the stack trace output to be more readable.
BEFORE

Unhandled exception:
MyException
 0. Function: '::baz' url: 'file:///Users/turnidge/dart/bug.dart' line:2 col:3
 1. Function: '_OtherClass@11f7ef14._OtherClass@11f7ef14._named@11f7ef14' url: 'file:///Users/turnidge/dart/bug.dart' line:7 col:8
 2. Function: '::set:globalVar' url: 'file:///Users/turnidge/dart/bug.dart' line:12 col:3
 3. Function: '::_bar@11f7ef14' url: 'file:///Users/turnidge/dart/bug.dart' line:16 col:3
 4. Function: 'MyClass.get:field' url: 'file:///Users/turnidge/dart/bug.dart' line:25 col:9
 5. Function: 'MyClass.fooHelper' url: 'file:///Users/turnidge/dart/bug.dart' line:30 col:7
 6. Function: 'MyClass.foo' url: 'file:///Users/turnidge/dart/bug.dart' line:32 col:14
 7. Function: 'MyClass.function' url: 'file:///Users/turnidge/dart/bug.dart' line:21 col:15
 8. Function: 'MyClass.MyClass.' url: 'file:///Users/turnidge/dart/bug.dart' line:21 col:18
 9. Function: '::function' url: 'file:///Users/turnidge/dart/bug.dart' line:38 col:10
 10. Function: '::main' url: 'file:///Users/turnidge/dart/bug.dart' line:38 col:24

AFTER

Unhandled exception:
MyException
#0      baz (file:///Users/turnidge/dart/bug.dart:2:3)
#1      _OtherClass._OtherClass._named (file:///Users/turnidge/dart/bug.dart:7:8)
#2      globalVar= (file:///Users/turnidge/dart/bug.dart:12:3)
#3      _bar (file:///Users/turnidge/dart/bug.dart:16:3)
#4      MyClass.field (file:///Users/turnidge/dart/bug.dart:25:9)
#5      MyClass.foo.fooHelper (file:///Users/turnidge/dart/bug.dart:30:7)
#6      MyClass.foo (file:///Users/turnidge/dart/bug.dart:32:14)
#7      MyClass.MyClass.<anonymous closure> (file:///Users/turnidge/dart/bug.dart:21:15)
#8      MyClass.MyClass (file:///Users/turnidge/dart/bug.dart:21:18)
#9      main.<anonymous closure> (file:///Users/turnidge/dart/bug.dart:38:10)
#10     main (file:///Users/turnidge/dart/bug.dart:38:24)
Review URL: https://chromiumcodereview.appspot.com//10826191

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10408 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 17:22:26 +00:00
kmillikin@google.com
70bd677417 Reapply "Use platform-independent format specifiers when disassembling code objects."
This reapplies svn revision 10163 with a (tested) fix for Windows.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10834155

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10282 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 10:50:38 +00:00
asiva@google.com
9d123e5366 Move hashmap.h and hashmap.cc from the 'bin' directory to 'platform' directory so that it can be used from VM code too.
Review URL: https://chromiumcodereview.appspot.com//10853009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10261 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 22:11:30 +00:00
kmillikin@google.com
effc29cd25 Revert "Use platform-independent format specifiers when disassembling code objects."
This is still broken on Windows.

TBR=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10826116

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10175 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 15:52:05 +00:00
kmillikin@google.com
b73d4d2af2 Reapply "Use platform-independent format specifiers when disassembling code objects."
This reapplies svn revision 10163 with a fix for Windows.

R=ager@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10824148

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10174 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 15:45:00 +00:00
kmillikin@google.com
20083dfd85 Revert "Use platform-independent format specifiers when disassembling code objects."
Revert svn revision 10163 while working on a Windows fix.

R=ager@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10850017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10169 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 13:51:23 +00:00
kmillikin@google.com
515f92ea3f Use platform-independent format specifiers when disassembling code objects.
R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10824144

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10163 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 13:19:28 +00:00
turnidge@google.com
40b0d11c1f Add missing files from last commit!
Review URL: https://chromiumcodereview.appspot.com//10829127

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10133 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-01 18:29:55 +00:00
cshapiro@google.com
2f9f822c76 Fix the build breakage on Windows caused by CountTrailingZeros.
Review URL: https://chromiumcodereview.appspot.com//10818020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9838 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 03:12:57 +00:00
cshapiro@google.com
d7ffa1a784 Fix the build breakage on MacOS and Windows caused by CountTrailingZeros.
Review URL: https://chromiumcodereview.appspot.com//10805080

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9837 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 03:03:43 +00:00
cshapiro@google.com
547383694b Improve the performance of bit set searches with a compiler intrinsic.
Review URL: https://chromiumcodereview.appspot.com//10806078

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9836 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 02:45:31 +00:00
hausner@google.com
057772b937 Fix Dart_GetClassInfo
issue 4142.

Also address review comments from previous change list.
Review URL: https://chromiumcodereview.appspot.com//10800024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9764 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-19 16:29:46 +00:00
hausner@google.com
373d313af3 Add multibyte string support to debugger
Issue 4110.

Had to extend the JSON protocol to support code points > 0xffff. The debugger client (editor) needs to support this new escape sequence'
format as well.
Review URL: https://chromiumcodereview.appspot.com//10801002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9751 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 23:27:59 +00:00
hausner@google.com
86b00700aa Add a platform-independent max uword value.
Review URL: https://chromiumcodereview.appspot.com//10695009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9181 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-27 17:24:41 +00:00
asiva@google.com
4027727562 For now set the stack buffer size to 16k (we need to compute this during thread start and store it in the worker object instead of the current scheme of setting this up in HandleMessage).
Adjust stack size to 512KB as all tests seem to run with that limit.
Review URL: https://chromiumcodereview.appspot.com//10558013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8754 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-15 23:32:47 +00:00
asiva@google.com
5869878eb3 Set max stack size to 1 MB (this is excessive but we seem to have some dart code that has deep recursion).
Review URL: https://chromiumcodereview.appspot.com//10541191

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8704 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-15 01:50:30 +00:00
asiva@google.com
d7aafffcd8 Have the stack overflow code use the correct stack size set by the platform/thread.h
Review URL: https://chromiumcodereview.appspot.com//10544170

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8703 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-15 01:28:53 +00:00
cshapiro@google.com
a40ffbae76 Fix includes to unbreak the Windows build.
Review URL: https://chromiumcodereview.appspot.com//10539151

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8638 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-14 01:02:08 +00:00
asiva@google.com
437d743208 Set thread stack size to 128k on macos debug builds as the parser runs into a stack overflow error as it recursively parses an expression in file_test.dart (issue 3537).
Review URL: https://chromiumcodereview.appspot.com//10546112

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8520 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-11 23:38:15 +00:00
asiva@google.com
c078663643 1. Remove recursion during snapshot writing and reading
2. set thread stack size to 128k
3. Fix the native message handler to ensure that it works with the new model of not recursively inlining objects.
Review URL: https://chromiumcodereview.appspot.com//10535066

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8517 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-11 21:39:05 +00:00
hausner@google.com
c39f48340d Add string encoding to wire protocol
Also, add command to retrieve the source text of a given script.
Review URL: https://chromiumcodereview.appspot.com//10496006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8220 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-02 00:07:12 +00:00
turnidge@google.com
ec36e02c28 Remove the partially completed code for remote IsolateMirrors and
replace it with the beginnings of a local (same isolate) IsolateMirror
implementation.

Removed old mirror tests and added two new mirror tests.

Even though mirrors.cc is part of the vm, I chose to implement most of
it using the dart embedding interface instead of our internal
interfaces because the embedding interface was more convenient.
mirrors.cc is basically all new in this CL -- don't pay any attention
to diffs for that file.

Added dart embedding functions required for the functionality in this
CL: Dart_DebugName, Dart_GetNativeInstanceFieldCount,
Dart_RootLibrary, Dart_RegisteredLibraryUrls, and Dart_LibraryName.

Extended or modified some existing dart api functions, primarily to
make them propagate error handles properly.

Added tests for new dart embedding api functionality.

Added the ability to determine if a port is local to the current isolate.

Extended NotImplementedException to accept an optional string
argument.  I wanted to give more descriptive error messages.
Review URL: https://chromiumcodereview.appspot.com//10416050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8117 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-30 17:07:19 +00:00
ager@google.com
333b817631 Increase thread stack size on Mac in debug mode.
After changing dart:io to use Futures the debug Mac build hit the stack
limit during snapshot reading. Landing this to unbreak the build.

R=sgjesse@google.com,asiva@google.com,iposva@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10389090

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7532 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-11 07:01:24 +00:00
hausner@google.com
dbd9fa4048 Eliminate need for va_copy in json.cc
The hacked version of va_copy did not work on Linux.
Review URL: https://chromiumcodereview.appspot.com//10383122

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7525 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 23:28:14 +00:00
hausner@google.com
dec5e465f9 Attempt 2 to fix build
Review URL: https://chromiumcodereview.appspot.com//10310109

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7522 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 22:32:39 +00:00
hausner@google.com
c8aee10ea3 Attempt 1 to fix build
Review URL: https://chromiumcodereview.appspot.com//10384110

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7521 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 22:11:42 +00:00
hausner@google.com
e5d8d80479 Support more debugger commands in the wire protocol
Also add a very simple debugger shell which at this point
is meant to be a debugging help for the debugger code rather
than a user-friendly tool.
Review URL: https://chromiumcodereview.appspot.com//10392017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7518 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-10 22:04:50 +00:00
hausner@google.com
95be46105a Beginnings of a debugger wire protocol
The debugger wire handler is implemented similarly to the io event handler.
A dedicated thread monitors the debugger port for incoming connection
requests. When a debugger is connected, the VM sends events messages
over the wire and handles debugger requests.

To start the VM with a debugger connection, use the option
--debug:<portnumber>. The VM pauses at the beginning of main()
and waits for a debugger to connect.

Subsequent changes will implement debugger commands one by one.
With this change, the VM only understands "resume" commands. 
Review URL: https://chromiumcodereview.appspot.com//10357003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7330 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-04 15:25:49 +00:00
asiva@google.com
d4e2aa22eb Changes to allow for -O2 compiles on macos in debug builds.
Review URL: https://chromiumcodereview.appspot.com//10180013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7052 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-27 01:10:10 +00:00
hausner@google.com
d55f4fb816 If at first you don't succeed...
...give up.
Review URL: https://chromiumcodereview.appspot.com//9699055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5499 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:25:14 +00:00
hausner@google.com
78f6ca09cd Try fixing the linux and windows builds.
Review URL: https://chromiumcodereview.appspot.com//9706041

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5497 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-14 23:20:49 +00:00
asiva@google.com
738f458956 Changes to get rid of dependency on openssl in the dart VM.
(This will enable dartium to be built on the windows platform).
Review URL: https://chromiumcodereview.appspot.com//9481019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4717 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 18:36:39 +00:00
ager@google.com
e92d0eab5a Reimplement Windows Monitors.
Now using an event object per thread which is linked into a list
of waiters for the monitor.

Notify takes the first element of the list and notifies (FIFO order).

Notify all extracts the entire list and notifies each of them. This
avoids the issues with fairness and correctness of the previous version.

The MonitorWaitData object holding the event and a pointer to the
next waiter is stored in thread local storage and lazily initialized.

R=sgjesse@google.com,asiva@google.com
BUG=1614
TEST=

Review URL: https://chromiumcodereview.appspot.com//9424050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4537 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-23 15:24:18 +00:00
ager@google.com
bbaf8a3665 Implement condition variables on Windows on top of Event/SetEvent/ResetEvent.
ConditionVariable is only available since Vista so to support XP
we need to implement this ourselves.

R=asiva@google.com,sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9361036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4126 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-10 10:50:25 +00:00
sgjesse@google.com
2c57dd40bf Add integer min/max constants to globals.h
R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9363018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4024 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-08 09:22:46 +00:00
sgjesse@google.com
af200a2ef7 Fix Windows and Mac OS builds
TBR=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9353007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3983 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-07 09:31:51 +00:00
sgjesse@google.com
252323441b Move the thread local functions to the Thread class in runtime/platform
This gets rid of all the platform specific isolate_*.h and isolate_*.cc files.

R=asiva@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9328042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3982 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-07 09:18:22 +00:00
sgjesse@google.com
3f035ecad0 Add support for lists and backward references when decoding a message to a Dart_CObject object
The C message reader can now read lists created like this:

  new List()
  new List<int>()
  new List<String>()
  new List<double>()
  new List<bool>()

The backward references are now resolved and already allocated
Dart_CObject objects are reused when there is a backward reference.

The reuse of the Dart_CObject objects poses the issue of which objects
where allocated with the supplied allocator and which where not.

Currently this will work best with a zone allocator. This will be added
to the tests in a subsequent change.

R=asiva@google.com, turnidge@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9303031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3831 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 09:55:18 +00:00
sgjesse@google.com
42b70dcddb Change the thread interface in runtime/platform and use it starting all threads
The platform thread interface (dart::thread) is now refactored to an
all static interface as suggested by iposva@ and asiva@. Use this
interface for running all threads in the VM.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9141005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3830 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-02 08:59:26 +00:00
ajohnsen@google.com
143de9eb80 Use ByteArray's native for Socket and File.
Review URL: https://chromiumcodereview.appspot.com//9235067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3812 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-01 21:48:27 +00:00
sgjesse@google.com
c1d041500f Use hash map for event handler file descriptor map
Instead of using an array indexed using the file descriptor for
looking up data associated with a socket (SocketData objects) this is
now stored in a hash map using the file descriptor as key.

Added hash map implementation like the one used in the V8 project.

R=ager@google.com, whesse@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9186035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3483 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-23 09:10:51 +00:00
sgjesse@google.com
3a02bcfc04 Add additional include guard in platform specific .h files
R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9264006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3433 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-19 13:37:26 +00:00
regis@google.com
9993072ff2 Simplify integer arithmetic code.
Optimize Mint multiplication in 32-bit mode.
Review URL: https://chromiumcodereview.appspot.com//9112050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3417 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 22:00:40 +00:00
asiva@google.com
7d991245cb Temporary fix to get x64 builds working again on build bot.
TBR=regis
Review URL: https://chromiumcodereview.appspot.com//9253005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3384 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 03:05:15 +00:00
sgjesse@google.com
68d10e1568 Move Mutex and Monitor from vm/ to platform/
The tests are still in runtime/vm/thread_test.cc.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9196002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3349 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 10:29:24 +00:00
sgjesse@google.com
fecaf3deb0 Remove dependency from platform/globals.h to platform/assert.h
R=ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//9241008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3347 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-17 10:10:05 +00:00
sgjesse@google.com
65896148c9 Move utils.h and utils.cc from runtime/vm to runtime/platform
Moved additional parts of globals.h from vm/ to platform/ to support
types and constants used by utils.*.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9209001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3337 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 13:23:40 +00:00
sgjesse@google.com
bf67f24098 Move assert.h/assert.cc from runtime/vm to runtime/platform
The purpose of this change is twofold:

1. Source in the bin directory can now use the same assertions as
   source in the vm directory. The ASSERT macro used by the code
   in runtime/bin was just defined to use assert from the standard
   C library.
2. Moving other implementation parts from runtime/vm to
   runtime/platform (e.g. classes Monitor and Mutex) for sharing
   between runtime/bin and runtime/vm will be easier as these
   implementations rely on these assertion macros.

Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.

All the code for asserts is still in the dart namespace.

Also re-arranged the order of includes to be alphabetically in
the files touched.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9189003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 12:28:10 +00:00
sgjesse@google.com
729c54ceef Fix Windows build
TBR=whesse@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9190006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3187 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-11 15:22:43 +00:00
sgjesse@google.com
0122a33a76 Handle EINTR on all IO operations
There have been spurious FileIOExceptions seen on some Mac OS machines.

R=ager@google.com,whesse@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9139011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3185 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-11 15:12:27 +00:00
ager@google.com
607eea1402 Cleanup gypi mess.
My change that introduced a platform directory shared between vm and bin runtime components did not correctly update gypi files.

BUG=
TEST=

Review URL: http://codereview.chromium.org//9124030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3155 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-10 16:50:14 +00:00
ager@google.com
c4c92c4f7b Introduce runtime/platform directory for code shared between vm
and bin.

Cleaned up globals.h. Common parts now in platform/globals.h.
vm specific parts are in vm/globals.h and bin/globals.h is gone.

R=sgjesse@google.com,iposva@google.com
BUG=
TEST=

Review URL: http://codereview.chromium.org//9114008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3030 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-06 11:28:21 +00:00