2. Create the empty_array object as a singleton in the VM isolate and remove it from the object store
3. Remove eager population of the functions_cache entry in the class. This results in a pretty impressive reduction of the initial isolate heap size:
- on IA32 it goes from 1331k to 1071k
- on X64 it goes from 2431k to 1911k
- snapshot size also is reduced from 859219 bytes to 789147 bytes.
(as a follow up change I will consider completely removing functions cache)
Review URL: https://chromiumcodereview.appspot.com//10827249
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10535 260f80e4-7a28-3924-810f-c04153c831b5
avoid overflow.
For each variable size heap object, compute the maximum number of
elements and use that in the ::New functions to avoid overflow. If a
bad length/size reaches a ::New function, that is a FATAL error -- the
problem should have been caught earlier by the dart api or by the
library code.
Add "border guards" in the dart api and in library calls which cause
new variable size heap objects to be allocated. We check for invalid
length/size and throw explanatory error messages.
Review URL: https://chromiumcodereview.appspot.com//10782016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10130 260f80e4-7a28-3924-810f-c04153c831b5
Issue 3551
This change adds const as a valid keyword to declare fields and
variables. The mandatory initializer has to be a compile time
const expression.
Static final variables still have to be initialized with
compile time constant expressions. I will add non-const static
finals (issue 3558) in another change.
Other small changes:
- allow null in some compile time constant expressions.
- allow only numbers, booleans, strings and null in compile time
constant string interpolation.
Review URL: https://chromiumcodereview.appspot.com//10828053
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9992 260f80e4-7a28-3924-810f-c04153c831b5
On x86:
Original sizes:
Size of isolate snapshot = 925655
New space (0k of 32768k) Old space (1700k of 1792k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 80944
CorelibIsolateStartup(RunTime): 5636
UseDartApi(RunTime): 404620
Dart2JSCompileAll(RunTime): 1379683
FrameLookup(RunTime): 45
Size with the new TokenStream implementation:
Size of isolate snapshot = 851352
New space (0k of 32768k) Old space (1368k of 1536k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 76918
CorelibIsolateStartup(RunTime): 4056
UseDartApi(RunTime): 502111
Dart2JSCompileAll(RunTime): 1251646
FrameLookup(RunTime): 45
(saves about 332k out of the original TokenStream size of 410k)
On x64:
Original sizes:
Size of isolate snapshot = 924865
New space (0k of 32768k) Old space (3234k of 3444k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 109660
CorelibIsolateStartup(RunTime): 3985
UseDartApi(RunTime): 463009
Dart2JSCompileAll(RunTime): 2170309
FrameLookup(RunTime): 35
Size with the new TokenStream implementation:
Size of isolate snapshot = 849675
New space (0k of 32768k) Old space (2436k of 2560k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 98716
CorelibIsolateStartup(RunTime): 2938
UseDartApi(RunTime): 509149
Dart2JSCompileAll(RunTime): 2042273
FrameLookup(RunTime): 39
(saves about 798k out of the original TokenStream size of 810k)
Token stats:
Number of tokens: 101470
Literal tokens: 4550
Ident tokens: 33020
Review URL: https://chromiumcodereview.appspot.com//10697055
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9539 260f80e4-7a28-3924-810f-c04153c831b5
Removed initializations of class_ field done in runtime and generated code on ia32/x64.
Changed forwarding address encoding used by scavenger: kFreeBit is now used to distinguish evacuated objects from not evacuated because scavenger will never encounter real FreeListElement.
Changed FreeListElement layout to match RawObject layout.
R=iposva@google.com
Review URL: https://chromiumcodereview.appspot.com//10521004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8336 260f80e4-7a28-3924-810f-c04153c831b5
It is permitted to specify a start index equal to the array length
when the copy length is 0. This runs afoul of an assertion in
ByteAddr that validates 0 <= index < length. Consistent with other
methods to retrieve a raw element address, we now guard this call with
an implicit check for this boundary condition by ensuring length is
greater than zero.
In addition, some simple unit tests for ByteArray::Copy have been added.
BUG=1891
Review URL: https://chromiumcodereview.appspot.com//9560001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4772 260f80e4-7a28-3924-810f-c04153c831b5
This change adds peer and callback arguments to the external byte array
constructor and moves the peer, callback, and data storage into a VM
peer object. At construction time, a weak persistent handle and VM
callback is associated with the VM peer. The VM callback will delete
the VM peer and invokes the user callback to reclaim the user peer.
This change also activates the callback support for the various classes of
external strings.
Review URL: https://chromiumcodereview.appspot.com//9368049
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4164 260f80e4-7a28-3924-810f-c04153c831b5
The purpose of this change is twofold:
1. Source in the bin directory can now use the same assertions as
source in the vm directory. The ASSERT macro used by the code
in runtime/bin was just defined to use assert from the standard
C library.
2. Moving other implementation parts from runtime/vm to
runtime/platform (e.g. classes Monitor and Mutex) for sharing
between runtime/bin and runtime/vm will be easier as these
implementations rely on these assertion macros.
Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.
All the code for asserts is still in the dart namespace.
Also re-arranged the order of includes to be alphabetically in
the files touched.
R=ager@google.com, iposva@google.com
BUG=
TEST=
Review URL: http://codereview.chromium.org//9189003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
External strings refer to character data in memory located outside of
the managed heap. This memory is considered to be owned by the
embedding application. To help with the management of external
memory, the virtual machine allows the embedding application to
register for a "death notice" when an external string object is
garbage collected. A death notice takes the form of a callback
invoked by the garbage collector with the address of the external
memory. Death notices will be implemented in the garbage collector by
future commit.
Review URL: http://codereview.chromium.org//8383029
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1679 260f80e4-7a28-3924-810f-c04153c831b5
Change the default value of --silent_warnings from true to false, so that
warnings are visible when legacy factory syntax is used.
In order to facilitate transition of libraries and user programs, legacy factory
syntax is still supported by 2 workarounds, but warnings are printed.
The first workaround allows the factory clause to omit the type
parameter list, which otherwise has to match exactly with the list of
type parameters in the factory class declaration.
The second workaround allows a factory method to omit the type
parameter list. In that case, the type parameter list of the enclosing
class is used instead.
Workarounds will be removed to enforce correct factory syntax at a later time.
Review URL: http://codereview.chromium.org//8585004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1595 260f80e4-7a28-3924-810f-c04153c831b5