Chosen because of its wartiness. A pair of new computations are introduced
to allow the IL to express duplication of temporaries and storing to
temporaries. These will be translated away by the optimizing compiler, but
allow the instruction stream to represent exactly the deoptimization state
we are intereseted in (with at most one deopt point per instruction).
Translation of:
test(a, i) {
return a[i]++;
}
is
0: [target]
t0 <-#0
t1 <-LoadLocal(a)
t2 <-LoadLocal(i)
t3 <-CopyTemp(-1)
t4 <-CopyTemp(-1)
t3 <-InstanceCall([], t3, t4)
SetTemp(-3)
t4 <-#1
t3 <-InstanceCall(+, t3, t4)
InstanceCall([]=, t1, t2, t3)
return t0
R=srdjan@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9601011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5012 260f80e4-7a28-3924-810f-c04153c831b5
This change re-introduces concatenation of adjacent
string literals, i.e. the compiler concatenates "abc" "123"
into the literal "abc123" at compile time. If the literals
contain interpolations, the concatenation happens at
runtime.
The change also re-introduces interpolated compile-time
string literal constants, but the feature is disabled because
several tests need to be changed.
Review URL: https://chromiumcodereview.appspot.com//9582040
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4991 260f80e4-7a28-3924-810f-c04153c831b5
Weak reference sets are similar to "populations" or "weak pairs".
Like these structures, objects in a key set preserve members of an
associated value set. Unlike these structures, a weak reference set
is not a general associative container. Weak reference sets exist
for the duration of a garbage collection.
Weak reference sets are proceesed iteratively allowing values of one
weak reference to be keys of a other weak reference sets. The garbage
collector will process weak reference sets iteratively, revisiting all
unmarked weak reference sets if any one weak reference set is marked.
This process repeates until a fixed-point is reached.
Review URL: https://chromiumcodereview.appspot.com//9531001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4917 260f80e4-7a28-3924-810f-c04153c831b5
- Do not populate the FunctionsCache array as it causes the function cache
to become inconsistent if we execute some dart code before capturing a
snapshot.
- Allow preallocation of objects even when generating snapshot and remove the
flag preallocate_objects_called_ (use a null test instead).
Review URL: https://chromiumcodereview.appspot.com//9580036
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4915 260f80e4-7a28-3924-810f-c04153c831b5
Splitting breakpoints into SourceBreakpoint that represent
a user-defined source location of a breakpoint, and
CodeBreakpoint, which represents a code location. There can
be more than one CodeBreakpoint per SourceBreakpoint, e.g.
for functions that are also called as closures (and are thus
compiled twice.)
Functions are no longer compiled as a side effect of setting
a breakpoint. When they eventually get compiled, the previously
recorded SourceBreakpoint is found and a CodeBreakpoint is set.
Review URL: https://chromiumcodereview.appspot.com//9581013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4891 260f80e4-7a28-3924-810f-c04153c831b5
These can be supported as instance calls. In the case of instance
setters and indexed stores, there is a new computation type because of
the semantics of preserving the value. For the example program:
void test(e) {
print(e.forty_two);
print(e.forty_two = 41);
}
we generate the graph:
0: [target]
t0 <-LoadLocal(e)
t0 <-InstanceCall(get:forty_two, t0)
StaticCall(print, t0)
t0 <-#0
t1 <-LoadLocal(e)
t2 <-#41
t0 <-InstanceSetter(t0, t1, t2)
StaticCall(print, t0)
return #null
and emit the correct code.
R=srdjan@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9570015
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4861 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
On standalone dartium which has about 50000 tokens in the libraries (core, coreimpl, builtin, io etc.) this reduces the heap size by about 180kb. The size of the standalone snapshot buffer reduces by about 72kb.
Also moved the keyword symbol table to the object store so that it does not have to repopulated on every script compilation. Should benefit regular user script load times.
Review URL: https://chromiumcodereview.appspot.com//9462003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4734 260f80e4-7a28-3924-810f-c04153c831b5
Continue to bailout on optional parameters and context-allocated local
variables.
Implement compilation of Bind and Do instructions, LoadLocal and StoreLocal
computations, and temporary values. Temporary allocation assumes they obey
a stack-discipline and have a single use---so any use is always the last
use. Temporaries can then be allocated via push and used via pop. This
dart function:
hukairs(a) {
var b, c;
c = b = a;
return c;
}
compiles to this annotated generated code snippet:
;; StoreLocal(b, #null)
66: mov $0x7f99303c0021,%rax
70: mov %rax,-0x8(%rbp)
;; StoreLocal(c, #null)
74: mov $0x7f99303c0021,%rax
7e: mov %rax,-0x10(%rbp)
;; t0 <-LoadLocal(a)
82: mov 0x10(%rbp),%ax
86: push %rax
;; t0 <-StoreLocal(b, t0)
87: pop %rax
88: mov %rax,-0x8(%rbp)
8c: push %rax
;; StoreLocal(c, t0)
8d: pop %rax
8e: mov %rax,-0x10(%rbp)
;; t0 <-LoadLocal(c)
92: mov -0x10(%rbp),%ax
96: push %rax
;; return t0
97: pop %rax
;; ...
bf: mov %rbp,%rsp
c2: pop %rbp
c3: retq
R=srdjan@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//9447102
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4666 260f80e4-7a28-3924-810f-c04153c831b5
big global change, so let me explain in more detail. This refactoring CL does
the following:
- moves all the dart code for isolates in a common library (lib/isolate)
- changes frog to understand 'dart:isolate' imoprts by loading the code from the
location above.
- changes the vm to undernstand 'dart:isolate' imports by creating a separate
library that is part of the bootstrap. This follows the same code-structure
that Todd suggested in his CL introducing the mirror library
- changes dartc to use the shared isolate library as the source of truth for
type checking. I left around some of the internal js code in dartc so that the
backend continues to work for apps that don't use isolates.
- changes all tests that use isolates to import the library explicitly (this is a large bulk of the files in this CL)
- changes test status for tests we can't fix in this repo (e.g. co19)
- splits the isolate library code to make it possible to preserve some tests
without exposing internal types (e.g. tests about
serialization/deserialization)
- changes the create_sdk script to copy the isolate library to the sdk
- includes the isolate library in dartdoc
I'll wait for at least one lgtm from each area (dartc, vm, frog, sdk)
There is one important pending thing this CL doesn't do:
- update test_runner.dart: This should be updated next time we upload the new
binaries to tool/testing/bin
- dartium specific changes: Vijay, is there anything I need to do for dartium?
Review URL: https://chromiumcodereview.appspot.com//9422019
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4647 260f80e4-7a28-3924-810f-c04153c831b5
Implement a simple compilation visitor for the intermediate language. Copy
code from the x64 code generator to support compilation of functions with no
arguments, no locals, and that return a literal.
Compiled code is not used, but it can be disassembled and visually checked
against the code from the old code generator.
R=srdjan@google.com
BUG=
TEST=expected to pass all tests on x64
Review URL: https://chromiumcodereview.appspot.com//9464009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4601 260f80e4-7a28-3924-810f-c04153c831b5