Commit Graph

105 Commits

Author SHA1 Message Date
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