Commit Graph

10 Commits

Author SHA1 Message Date
koda@google.com 4543995374 Clear the handle returned by HashTable::Release in ~HashTable.
This is a fix to the issue of EnsureCapacity retaining old arrays until the end of the current handle scope.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40817 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 17:05:19 +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
asiva@google.com 1179458f38 Precreate handles for the key object and smi values and use these
handles in the find and insert methods instead of allocating a new
handle each time.

R=koda@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39479 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 23:57:48 +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 1cdcb12b4e Add VM class for Map/LinkedHashMap.
Introduces a new internal class for the most common case, the default Map.

Passes all functionality tests.
Slow: Dart side simply calls into runtime for now.
Hidden behind "--use_internal_hash_map".

Add copies of hash map tests to exercise this implementation.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38588 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-25 20:04:11 +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 b77bd818f7 Attempt to fix Windows compilation error.
TBR=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37718 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-26 01:27:26 +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