Commit graph

15 commits

Author SHA1 Message Date
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
Ryan Macnak
14db718ed5 [vm] Add missing safepoint transitions.
Mostly tests; 1 non-test bug in propagating an error through Dart_SetReturnValue.

This is progress towards asserting thread->excution_state() == kThreadInVM in Object::Allocate.

Change-Id: I6a59549868ab317b3c0d32aa42f3661289cbf456
Reviewed-on: https://dart-review.googlesource.com/71720
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-08-28 16:40:17 +00: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
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
e933f28a18 Remove some uses of STL map.
This CL removes the use of STL map from freelist.cc by adding
MallocDirectChainedHashMap in hash_map.h and adding an iterator for
BaseDirectChainedHashMap there.

It also removes a use of STL map from hash_table.h that was dead code.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2083103002 .
2016-06-22 08:32:37 -07:00
Siva Annamalai
65c4aaee17 - Add a new constructor to the hash table classes that allow handles to be passed in instead of creating new ones for every lookup/insertion
- Use reusable handles in Symbols::New and Symbols::Lookup with the new constructor defined above

R=hausner@google.com

Review URL: https://codereview.chromium.org/1934263003 .
2016-05-02 17:07:31 -07:00
Siva Annamalai
fc3156db11 Add usage and collision details to the hash table data structure in order to determine effectiveness of the hash function.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1882763002 .
2016-04-13 09:08:52 -07:00
Siva Annamalai
5828e3eb6f Provide a mechanism for naming a hash table so that it can be used in DumpStats to identify the table.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1873283003 .
2016-04-12 13:38:08 -07:00
koda@google.com
e3a345a84b Rename NoGCScope -> NoSafepointScope.
The old name makes less sense in the context of concurrent GC (and multiple threads in general).

Document the intended semantics of this (DEBUG-only) guard scope.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44616 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 22:08:25 +00:00
koda@google.com
32078e2ebb Add 'Clear' method to HashMap/HashSet templates.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40415 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 23:44:51 +00:00
koda@google.com
50bb605a6a Handle-like interface for HashTable.
A combination of two independent interface changes:
1. Constructor takes a RawArray* and allocates its own Array handle.
2. Release provides access to the entire handle, rather than just the raw.

This results in a very clean usage pattern, like:
  FooTable table(get_foo_table());
  table.Insert(obj);
  ...
  set_foo_table(table.Release());

Having the isolate inside HashTable also allows faster allocation of temporary handles.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38794 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-31 19:50:23 +00:00
koda@google.com
3ddcda9ab8 Reimplement Symbols using hash table template.
In the process, add hash table support for materializing an Object key from a lookup key on demand.

Also use this to simplify CompressedTokenStream.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38710 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-29 22:47:56 +00:00
koda@google.com
7dfd991f9f Resubmit r37716: Hash tables templates, wrapping Array.
(Patch Set 1 is identical to r37716; Patch Set 2 renames some typedefs to avoid confusing MSVC)

Highly customizable to support various internal uses as well as the basis for user-level classes.

Use in Library's resolved names cache.

Next step is to add new instance classes for the user-level maps/sets (akin to GrowableObjectArray).

TBR=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37800 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-27 22:34:00 +00:00
koda@google.com
486a4527a5 Revert r37716 due to Windows compilation errors.
TBR=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37719 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-26 01:45:48 +00:00
koda@google.com
5ef8d94639 Hash tables templates, wrapping Array.
Highly customizable to support various internal uses as well as the basis for user-level classes.

Use in Library's resolved names cache.

Next step is to add new instance classes for the user-level maps/sets (akin to GrowableObjectArray).

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37716 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-26 00:51:02 +00:00