Commit graph

7 commits

Author SHA1 Message Date
Alexander Markov 307bc3ef2c [vm] Faster double.toInt() in AOT mode
double.toInt() micro-benchmark on AOT/x64:
Before: BenchToInt(RunTime): 438.67258771929824 us.
After:  BenchToInt(RunTime): 118.8603434955726 us.

double.floor() micro-benchmark on AOT/x64:
Before: BenchFloor(RunTime): 537.2132688691916 us.
After:  BenchFloor(RunTime): 321.2052352657781 us.

TEST=ci
Issue https://github.com/dart-lang/sdk/issues/46876
Issue https://github.com/dart-lang/sdk/issues/46650

Change-Id: Id37c827bceb7f374ae5b91b36871ccf0d9e92441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211620
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-09-01 16:57:59 +00:00
Ryan Macnak 6fe15f6df9 [vm] Represent tagged pointers as C++ value types instead of C++ pointer types.
This works around bugs in UndefinedBehaviorSanitizer and Clang.

Bug: b/28638298
Change-Id: I6be595f9664516019d28017d24559583a1ae3a21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144354
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-04-25 05:21:27 +00:00
Teagan Strickland 2e197ae4de [vm/compiler] Tweaks and additions to IL serializer/S-expressions.
* Add a new `SExpDouble` atom and change `SExpNumber` to `SExpInteger`.

* Allow for negative integers in deserialization.

* Add support for `LocalVariable`s and related instructions.

* Function objects are now represented by actual S-expressions generated
  with the new `FunctionToSExp` method. Previously, they were only represented
  by a symbol containing their canonical name.

* The top-level tag for a serialized flow graph is now `FlowGraph`, not
  `function`. This avoids confusion between serialized flow graphs and
  serialized function references. Similarly, the old `FunctionToSExp`
  method is now called `FlowGraphToSExp`.

* Made all SExpression* returning functions that take Object (or subclass)
  instances return nullptr if the passed in instance is the null object,
  except for ObjectToSExp, which returns the symbol `null`.

* Factored out creating tags for the different kind of block/function
  entry and also created an `Entries` section to the top-level `FlowGraph`
  form that contains function entry points similar to the `Constants` one
  instead of inlining entries as separate elements in the `FlowGraph` form.

* Additional extra information in verbose mode for some elements.

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: Iede3865ec64f81955a87fd57b10e74d49ee8414c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110917
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-07-31 11:52:44 +00: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
vegorov@google.com a273179ac8 Use locale insensitive method to parse double literals.
Using strtod does not work because Dart grammar does not necessary match grammar used by strtod. Some locales (e.g. Russian and Danish) use comma instead of dot for radix point.

R=iposva@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21074 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-08 14:32:46 +00:00
floitsch@google.com 3c2b298a75 Implement Double.{toString, toStringAsExponential, toStringAsPrecision}
Also switch to -0.0.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4681 260f80e4-7a28-3924-810f-c04153c831b5
2012-02-28 13:19:50 +00:00
floitsch@google.com e231959e13 Implement Double.toStringAsFixed.
Review URL: http://codereview.chromium.org//8728006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@2790 260f80e4-7a28-3924-810f-c04153c831b5
2011-12-22 22:03:35 +00:00