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
iposva@google.com
d369b7a0c9
- Ensure that the token stream from generated source matches the
...
original token stream in the presence of combinations of
multiline string and string interpolation. If not this will
cause mismatches when accessing code snippets, e.g when
reporting parser errors or assertions.
- Ensure that ScanAll and ScanTo are in sync when adding or
counting tokens.
- Added unit test for multiline strings and interpolation.
- Expanded GenerateSource unit test to iterate through all
loaded libraries.
- Do not report columns for compilation errors in snapshotted
code.
- Do not report columns from exceptions and errors when dealing
with snapshotted code.
- Remove length field from TokenDescriptor. It was unused.
- Remove TokenStream::ComputeTokenPosition. It was unused.
R=fschneider@google.com , hausner@google.com
Review URL: https://codereview.chromium.org//36323003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29110 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 19:08:36 +00:00
srdjan@google.com
b6b3e1f400
Factor out throwing of argument error.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//25566002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28109 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 18:48:37 +00:00
sra@google.com
ce4b15c0e9
Esoteric bit operations.
...
- bit length
- truncate to signed fixed width integer
- truncate to unsigned fixed width integer
This change is motivated by a program that spends 20-30% of its time here:
// TODO(5828): Replace this with a bit-length method on int when available.
int n_bitLength = this.n.toRadixString(2).length;
See Also
https://code.google.com/p/dart/issues/detail?id=5828#c3
https://code.google.com/p/dart/issues/detail?id=6486#c2
https://code.google.com/p/dart/issues/detail?id=5798#c5
https://code.google.com/p/dart/issues/detail?id=12008
R=lrn@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//23645003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27269 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-06 22:22:26 +00:00
floitsch@google.com
8adad2eeb0
Don't throw when there is an "onError" for int.parse.
...
Even though the error is caught immediately we don't want "break on exception" developer tools stop at the parseInt case if there is a handler.
BUG= http://dartbug.com/12776
R=lrn@google.com
Review URL: https://codereview.chromium.org//23685004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27005 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-02 09:36:29 +00:00
kmillikin@google.com
4f80ef09df
Change Bool::Get to return a handle instead of a pointer to a raw object.
...
Replace occurrences of 'expr ? Bool::True() : Bool::False()' with simply
'Bool::Get(expr)' and analogously for its negation. The pointer to the raw
object can still be extracted with 'Bool::Get(expr).raw()'.
R=iposva@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//23480005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26770 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 08:38:56 +00:00
srdjan@google.com
1f31dcc424
Fix for running with --throw_on_javascript_int_overflow: recognize pattern (a << b) & mask and test for overflow only after the mask.
...
R=fschneider@google.com
Review URL: https://codereview.chromium.org//22640019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26122 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 15:12:39 +00:00
asiva@google.com
dcb6850f87
Fix for issue 11680
...
- implicitly store a full stack trace in Error objects when they are thrown.
- the shlFromInt on Mints and Bigints was trying to allocate a new OutOfMemory
exception objects instead of using the pre-allocated exception object.
Made the implementation of these methods native so that they can use the
pre-allocated object.
- Ensure that it is not possible to allocate new OutOfMemory or StackOverflow
exception objects.
R=ahe@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//19106008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25492 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-25 19:28:53 +00:00
zra@google.com
40f0800c10
Ensures that Bigints returned to Dart are all checked by Integer::AsValidInteger.
...
Rather than by ad-hoc checks at the point of return.
R=iposva@google.com
Review URL: https://codereview.chromium.org//15741019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23151 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 15:45:17 +00:00
srdjan@google.com
dd6ca671d7
Cleanups: addressed your comments from https://codereview.chromium.org/14962008/
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//14845021
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22881 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 23:45:08 +00:00
srdjan@google.com
fc40a8c721
Allow leading + when parsing integers in fast case (it is allowed per library implementation, only Dart syntax disallows it).
...
Review URL: https://codereview.chromium.org//14064019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21779 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 23:19:15 +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
srdjan@google.com
33435b7e73
Improve perfromance of integer parsing for Smi-s.
...
Review URL: https://codereview.chromium.org//12328068
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18990 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 18:32:46 +00:00
asiva@google.com
f4fe42c280
Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION
...
which have different implementations of 'operator=' and 'operator^='.
In the case of FINAL_OBJECT_IMPLEMENTATION we do not do the vtable setting
in these methods (Note the |= operator functionality is now subsumed into
the new implementation of "operator^=")
Review URL: https://codereview.chromium.org//12052033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17491 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 20:01:31 +00:00
srdjan@google.com
7159a6f103
Some more ^= to |=
...
Review URL: https://codereview.chromium.org//12017020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17310 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 20:43:33 +00:00
asiva@google.com
7022b39e35
Convert all symbol accessors to return read only handles so that it is not necessary to create a new handle in the code that uses it.
...
Added a few more strings to the symbols list.
Review URL: https://codereview.chromium.org//11667012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16584 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 19:31:59 +00:00
asiva@google.com
8af296c9c8
Cleanup the exceptions create code to use Arrays instead GrowableArrays so
...
that it is consistent with the DartEntry invoke code that it calls finally.
Review URL: https://codereview.chromium.org//11639007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16295 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 23:47:35 +00:00
regis@google.com
dd6a0ec349
Rename GET_NATIVE_ARGUMENT macro to GET_NON_NULL_NATIVE_ARGUMENT.
...
Introduce new GET_NATIVE_ARGUMENT macro accepting null.
Add test.
Review URL: https://codereview.chromium.org//11468016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15919 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 17:59:40 +00:00
srdjan@google.com
21f624d006
Cleanups and added more checks for valid Integer allocation (must be Smi, Mint or Bigint for their corresponding range).
...
Integer boxing in compielr seems to check correctly fro smi/mint. Can you think of any other places where we could create incorrect Mints or Bigints?
Review URL: https://codereview.chromium.org//11421064
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15310 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-26 16:09:50 +00:00
iposva@google.com
7ae807a19c
- Move MathNatives from dart:core to dart:math.
...
- Split out double and integer parsing from MathNatives.
Review URL: https://codereview.chromium.org//11316031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15032 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-16 19:42:02 +00:00
hausner@google.com
7eb3efc2ba
Fix native argument handling
...
Native functions need to fetch arguments differently if they are
called through a closure.
fixes issue 6696.
Review URL: https://codereview.chromium.org//11293290
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14937 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 01:14:01 +00:00
lrn@google.com
a1faa6f135
Change IllegalArgumentException to ArgumentError.
...
Review URL: https://codereview.chromium.org//10989013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12841 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 12:27:52 +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
kmillikin@google.com
67021511ca
Make some static helpers into member functions.
...
Four helper functions that moved from lib/integers.cc to vm/object.cc so
they could be used during constant folding are more properly member
functions than static functions.
R=srdjan@google.com
BUG=
Review URL: https://codereview.chromium.org//10937030
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12620 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 08:38:33 +00:00
kmillikin@google.com
be0492a8a8
Reapply "Initial implementation of sparse conditional constant propagation."
...
With a fix for compilation on Mac. GrowableArray is DISALLOW_COPY_AND_ASSIGN,
so we can't create a temporary one to be ignored and have to pass one in to be
ignored.
R=fschneider@google.com ,zerny@google.com
BUG=
Review URL: https://codereview.chromium.org//10949020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12561 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 14:10:14 +00:00
kmillikin@google.com
5e449aea52
Revert "Initial implementation of sparse conditional constant propagation."
...
Revert due to compilation failures on Mac.
TBR=fschneider@google.com
BUG=
Review URL: https://codereview.chromium.org//10946027
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12552 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 11:04:36 +00:00
kmillikin@google.com
ae9efbfab0
Initial implementation of sparse conditional constant propagation.
...
Use the results of SCC to eliminate unreachable code.
BUG=
Review URL: https://codereview.chromium.org//10943007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12549 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 10:34:14 +00:00
turnidge@google.com
14f614da12
Use the return value of vm native methods to set the return value,
...
based on Siva's earlier suggestion (he actually suggested putting it
in the generated stub, which I haven't done).
Added SetReturnUnsafe and use it exactly one place so far.
Review URL: https://chromiumcodereview.appspot.com//10874072
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11633 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:41:19 +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
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
iposva@google.com
d72471512e
- More cleanup after the kSAR -> kSHR rename.
...
Review URL: http://codereview.chromium.org//9212016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3313 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 22:46:32 +00:00
regis@google.com
2d1f63af47
Port a couple more stubs to x64.
...
Fix integer implementation issues.
Enable all tests on x64.
Review URL: http://codereview.chromium.org//9114054
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3307 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 20:07:54 +00:00
iposva@google.com
731616c7d3
- Remove support for ">>>" operator.
...
Review URL: http://codereview.chromium.org//9203004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3279 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-13 09:10:48 +00:00
regis@google.com
a577991ad5
Port code generator to x64.
...
Review URL: http://codereview.chromium.org//8984003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2557 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-17 00:56:02 +00:00
srdjan@google.com
88878148ac
Fix crashes when going to natives. Throw an exception instead.
...
Review URL: http://codereview.chromium.org//8678025
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1817 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 22:03:51 +00:00
srdjan@google.com
59b79d8171
Fix more co19 crashes. Introduce GET_NATIVE_ARGUMENT that throws an illegal argument exception if the native argument is of incorrect type.
...
Review URL: http://codereview.chromium.org//8476002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1205 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-04 16:30:29 +00:00
dgrove@google.com
4c0f559d23
Initial checkin.
...
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00