Commit Graph

1278 Commits

Author SHA1 Message Date
Alexander Aprelev 97393fd961 Introduce StaticCallNode::kNoRebind and use that in implicit closures.
Change-Id: I6219462fed278dbb90361c2084eed886c9245097

Revert "Revert "Introduce inline cache reload rule attribute to static call AST node and ICData.""

This reverts commit 162283c2f3.

This re-lands the change with original revert in Patch set 1, actual bug fix in next patch set.

Bug:
Change-Id: I6219462fed278dbb90361c2084eed886c9245097
Reviewed-on: https://dart-review.googlesource.com/8760
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-28 03:26:22 +00:00
Régis Crelier db8b20107b Revert "Revert "Dart Core Lib change to support generic functions in class NoSuchMethodError.""
This reverts commit 8cf9ef22c4.

The expectations in Dart2js and Kernel tests have now been updated.

Change-Id: I9d65ff207490cfc783849b1b726db81cf56ecfc2
Reviewed-on: https://dart-review.googlesource.com/9124
Reviewed-by: Régis Crelier <regis@google.com>
2017-09-28 00:27:24 +00:00
Régis Crelier c260823921 [VM strong mode] Introduce a VM flag --strong modifying the semantics of type
checks to strong mode.
Note that the patched core library in runtime/lib is not yet strong mode clean.
Also, the core library requires type inference to work properly in strong mode.

Change-Id: I7b29af708f180eaa9fa95adfb6ec1b0361e2c003
Reviewed-on: https://dart-review.googlesource.com/8382
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-09-27 23:03:23 +00:00
Régis Crelier 8cf9ef22c4 Revert "Dart Core Lib change to support generic functions in class NoSuchMethodError."
This reverts commit db15f5d73b.

Dart2js and Kernel tests are comparing text that has changed because of
the core lib change.

Change-Id: I1d33716a3d6e6a077aa1f1a9ad7cc37825d31fa6
Reviewed-on: https://dart-review.googlesource.com/9082
Reviewed-by: Siva Chandra <sivachandra@google.com>
2017-09-27 21:08:20 +00:00
Régis Crelier db15f5d73b Dart Core Lib change to support generic functions in class NoSuchMethodError.
Change-Id: If7d1a8c07e4bee7ec68fede80a9d17cae0044d31
Reviewed-on: https://dart-review.googlesource.com/5329
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-09-27 17:57:41 +00:00
Ryan Macnak 5efa08b663 Reapply "[reload] Add facility to check for program elements changed in the last reload but not executed."
- Weaken assert for identity reloads to account for lazy finalization.
 - Store actual field end positions instead of computing from a terminating semicolon.
 - Consider unfinalized classes to be unchanged if they have same sequence of tokens.

Change-Id: I3fcd7fed924bfac47dc382702ce63207bb8aa031
Reviewed-on: https://dart-review.googlesource.com/8164
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-09-27 02:50:35 +00:00
Ryan Macnak e464cda0d1 [vm] Allow asserts in initializer lists by default.
Change-Id: Ic3a70274a9ed918d836a4ca1ec71db53bae8f60b
Reviewed-on: https://dart-review.googlesource.com/8732
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-09-27 02:12:59 +00:00
Alexander Aprelev 162283c2f3 Revert "Introduce inline cache reload rule attribute to static call AST node and ICData."
This reverts commit 68a727fa5c.

Revert "Fix ICData::New() invocation. Follow-up to 68a727fa5cf5."

This reverts commit ac06b1c8ea.

Revert "Fix last ICData::New() invocation. Follow-up to 68a727fa5cf5."

This reverts commit da26ffc4de.

Bug:
Change-Id: Ia2d4e6a3c3a3a329982c90aded11e72bf25a9a34
Reviewed-on: https://dart-review.googlesource.com/8402
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2017-09-26 02:08:17 +00:00
Alexander Aprelev 68a727fa5c Introduce inline cache reload rule attribute to static call AST node and ICData.
Reload rule describes how inline cache has to be processed during hot reload, whether it should
be updated, reset or preserved.

Bug: dartbug.com/30639
Change-Id: I40b63ade786456ec48d4fa205a076654c2996bce
Reviewed-on: https://dart-review.googlesource.com/7586
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-25 20:18:58 +00:00
Vyacheslav Egorov 8a179fb953 [VM, Compiler] Move compiler to a separate folder.
New folder structure (nested under vm/):

- compiler/
-   jit/         - JIT specific code
-   aot/         - AOT specific code
-   backend/     - all middle-end and back-end code (IL, flow graph)
-   assembler/   - assemblers and disassemblers
-   frontend/    - front ends (AST -> IL, Kernel -> IL)

compiler/README.md would be the documentation root for the compiler
pipeline

Bug: https://github.com/dart-lang/sdk/issues/30575
Change-Id: I2dfd9688793bff737f7632ddc77fca766875ce36
Reviewed-on: https://dart-review.googlesource.com/2940
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-09-04 15:15:18 +00:00
Régis Crelier df70bd64ae [VM generic functions reification] Support generic async* and sync* functions.
R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/3004033002 .
2017-08-30 09:19:47 -07:00
Régis Crelier b3a7dd6e9d [VM generic function reification] Support generic functions in Invocation class.
Make VM object TypeArguments a Dart instance.
Add a test verifying that noSuchMethod works with generic functions.

R=floitsch@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/3007603002 .
2017-08-28 17:00:39 -07:00
Vyacheslav Egorov 7d5231796e [VM, Precompiler] Support obfuscation of the symbolic information in precompiler
Obfuscation is controlled by obfuscate flag in Dart_IsolateFlags.

Obfuscation of identifiers is performed during script tokenization - when TokenStream is generated from the source. All kIDENT and kINTERPOL_VAR tokens are renamed consistently using a persistent obfuscation map stored in ObjectStore::obfuscation_map.

Some identifiers (pseudo-keywords, arithmetic operators, builtin recognized methods and entry-points) are not renamed to keep name based lookups from breaking. All other identifiers are renamed.

Constant instances of Symbol-s (both created via literal syntax #ident and using constant constructor const Symbol("ident")) are renamed consistently with corresponding identifiers.

Script urls and Library urls and names are also obfuscated.

Obfuscation map can be dumped as a JSON array at the end of precompilation using Dart_GetObfuscationMap API.

BUG=https://github.com/dart-lang/sdk/issues/30524
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/3003583002 .
2017-08-25 09:48:23 +02:00
Ryan Macnak eed3b5e0bb Fix inlining annotations for AOT.
We were only recording metadata positions when mirrors were enabled. Mirrors are not enabled for AOT, so this metadata became unavailable to the inliner. Now we always record metadata position.

The tree-shaker has been updated to know how to remove the metadata.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/3003183003 .
2017-08-24 16:32:23 -07:00
Régis Crelier b8bce019b3 [VM generic functions] Support generic async calls.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/3001213002 .
2017-08-18 15:25:20 -07:00
Jens Johansen 6c2232cb60 [kernel] Insert kernel bodies into VM heap
This CL copies the kernel bodies for all functions and
fields into the VM heap. The function bodies in the VM
heap are then used when compiling the flowgraphs.
This theoretically means that the malloc'd data can be
freed and that snapshotting from kernel could possibly
work, though it hasn't been tested.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2972343002 .
2017-08-10 09:38:17 +02:00
Régis Crelier a18b318fed [VM parser] Insert missing result type check in async functions using arrow
style instead of 'return' keyword (fixes #30339).
Add regression test.

R=asiva@google.com, cbernaschina@google.com

Review-Url: https://codereview.chromium.org/2993223002 .
2017-08-08 09:15:28 -07:00
Zachary Anderson 8d6bc876f0 Reland "Remove fields from Isolate in Product mode"
In my reordering of the fields in Isolate, I omitted the initialization
of a few fields in the constroctor. This CL will reland the change with
the initialization added back.

R=danunez@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/2983403002 .
2017-07-25 13:24:30 -07:00
Zachary Anderson 211604d7a0 Revert "Remove fields from Isolate in Product mode"
This reverts commit 13558442ab.

The above change caused a timeout in a vm test:

FAILED: none-vm-checked release_x64 vm/cc/SafepointTestDart
Expected: Pass
Actual: Timeout
CommandOutput[run_vm_unittest]:
diagnostics: Process list including children: [28397]
    Trying to capture stack trace for pid 28397
    PID 28397 - process
    TID 28397:
    #0  0x00007efedf216404 pthread_cond_wait@@GLIBC_2.3.2
    #1  0x0000000002b9a315 dart::Monitor::WaitMicros(long)
    #2  0x0000000002af3496 dart::MonitorLocker::WaitWithSafepointCheck(dart::Thread*, long)
    #3  0x0000000002a8724d dart::Heap::AllocateOld(long, dart::HeapPage::PageType)
    #4  0x0000000002b07de3 dart::Object::Allocate(long, long, dart::Heap::Space)
    #5  0x0000000002b26eab dart::UnresolvedClass::New(dart::Object const&, dart::String const&, dart::TokenPosition)
    #6  0x0000000002be6358 dart::Parser::ParseType(dart::ClassFinalizer::FinalizationKind, bool, bool, dart::LibraryPrefix*)
    #7  0x0000000002ba9cc4 dart::Parser::ParseNewOperator(dart::Token::Kind)
    #8  0x0000000002bac7dc dart::Parser::ParsePrimary()
    #9  0x0000000002be19c1 dart::Parser::ParsePostfixExpr()
    #10 0x0000000002bdf1c4 dart::Parser::ParseUnaryExpr()
    #11 0x0000000002bb618c dart::Parser::ParseBinaryExpr(int)
    #12 0x0000000002bb869f dart::Parser::ParseConditionalExpr()
    #13 0x0000000002bae224 dart::Parser::ParseExpr(bool, bool)
    #14 0x0000000002bbeb79 dart::Parser::ParseAwaitableExpr(bool, bool, dart::SequenceNode**)
    #15 0x0000000002bd5273 dart::Parser::ParseStatement()
    #16 0x0000000002bbcce0 dart::Parser::ParseStatementSequence()
    #17 0x0000000002ba64e8 dart::Parser::ParseFunc(dart::Function const&, bool)
    #18 0x0000000002ba3e31 dart::Parser::ParseFunction(dart::ParsedFunction*)
    #19 0x00000000029e0725 dart::DartCompilationPipeline::ParseFunction(dart::ParsedFunction*)
    #20 0x00000000029e4898 dart::CompileFunctionHelper(dart::CompilationPipeline*, dart::Function const&, bool, long)
    #21 0x00000000029e5716 dart::Compiler::CompileOptimizedFunction(dart::Thread*, dart::Function const&, long)
    #22 0x0000000002c8d3a4 dart::DRT_StackOverflow(dart::NativeArguments)
    #23 0x00007efedf6ad61b
    TID 28421:
    #0  0x00007efedf2167be pthread_cond_timedwait@@GLIBC_2.3.2
    #1  0x0000000002b9a2ff dart::Monitor::WaitMicros(long)
    #2  0x0000000002cc6f8f dart::ThreadInterrupter::ThreadMain(unsigned long)
    #3  0x0000000002b999d9 dart::ThreadStart(void*)
    #4  0x00007efedf212184 start_thread
    #5  0x00007efede51737d __clone
    TID 28430:
    #0  0x00007efedf216404 pthread_cond_wait@@GLIBC_2.3.2
    #1  0x0000000002b9a315 dart::Monitor::WaitMicros(long)
    #2  0x0000000002af3496 dart::MonitorLocker::WaitWithSafepointCheck(dart::Thread*, long)
    #3  0x0000000002a8789e dart::HeapIterationScope::HeapIterationScope(bool)
    #4  0x0000000002ad4966 dart::Isolate::IterateObjectPointers(dart::ObjectPointerVisitor*, bool)
    #5  0x00000000027ed02a dart::SafepointTestTask::Run()
    #6  0x0000000002cc7cbd dart::ThreadPool::Worker::Loop()
    #7  0x0000000002cc7b6a dart::ThreadPool::Worker::Main(unsigned long)
    #8  0x0000000002b999d9 dart::ThreadStart(void*)
    #9  0x00007efedf212184 start_thread
    #10 0x00007efede51737d __clone
    TID 28431:
    #0  0x00007efedf216404 pthread_cond_wait@@GLIBC_2.3.2
    #1  0x0000000002b9a315 dart::Monitor::WaitMicros(long)
    #2  0x0000000002ad66fa dart::Isolate::ScheduleThread(bool, bool)
    #3  0x0000000002cc53ea dart::Thread::EnterIsolateAsHelper(dart::Isolate*, dart::Thread::TaskKind, bool)
    #4  0x0000000002a86317 dart::SweeperTask::Run()
    #5  0x0000000002cc7cbd dart::ThreadPool::Worker::Loop()
    #6  0x0000000002cc7b6a dart::ThreadPool::Worker::Main(unsigned long)
    #7  0x0000000002b999d9 dart::ThreadStart(void*)
    #8  0x00007efedf212184 start_thread
    #9  0x00007efede51737d __clone
    TID 28444:
    #0  0x00007efedf216404 pthread_cond_wait@@GLIBC_2.3.2
    #1  0x0000000002b9a315 dart::Monitor::WaitMicros(long)
    #2  0x0000000002af3496 dart::MonitorLocker::WaitWithSafepointCheck(dart::Thread*, long)
    #3  0x0000000002a8724d dart::Heap::AllocateOld(long, dart::HeapPage::PageType)
    #4  0x0000000002b07de3 dart::Object::Allocate(long, long, dart::Heap::Space)
    #5  0x0000000002b26eab dart::UnresolvedClass::New(dart::Object const&, dart::String const&, dart::TokenPosition)
    #6  0x0000000002be6358 dart::Parser::ParseType(dart::ClassFinalizer::FinalizationKind, bool, bool, dart::LibraryPrefix*)
    #7  0x0000000002bb19bb dart::Parser::ParseTypeOrFunctionType(bool, dart::ClassFinalizer::FinalizationKind)
    #8  0x0000000002bb204c dart::Parser::ParseFormalParameter(bool, bool, dart::ParamList*)
    #9  0x0000000002bb43b3 dart::Parser::ParseFormalParameters(bool, bool, bool, dart::ParamList*)
    #10 0x0000000002ba368b dart::Parser::ParseFormalParameterList(bool, bool, bool, dart::ParamList*)
    #11 0x0000000002ba5a8f dart::Parser::ParseFunc(dart::Function const&, bool)
    #12 0x0000000002ba3e31 dart::Parser::ParseFunction(dart::ParsedFunction*)
    #13 0x00000000029e0725 dart::DartCompilationPipeline::ParseFunction(dart::ParsedFunction*)
    #14 0x00000000029e4898 dart::CompileFunctionHelper(dart::CompilationPipeline*, dart::Function const&, bool, long)
    #15 0x00000000029e5716 dart::Compiler::CompileOptimizedFunction(dart::Thread*, dart::Function const&, long)
    #16 0x00000000029e7036 dart::BackgroundCompiler::Run()
    #17 0x0000000002cc7cbd dart::ThreadPool::Worker::Loop()
    #18 0x0000000002cc7b6a dart::ThreadPool::Worker::Main(unsigned long)
    #19 0x0000000002b999d9 dart::ThreadStart(void*)
    #20 0x00007efedf212184 start_thread
    #21 0x00007efede51737d __clone
Review-Url: https://codereview.chromium.org/2988703002 .
2017-07-24 14:17:53 -07:00
Zachary Anderson 13558442ab Remove fields from Isolate in Product mode
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2984883002 .
2017-07-24 13:22:44 -07:00
Alexander Markov bda3c9c2b2 Simplify and fix implicit closure check, speed up Closure_equals, v2
This is the re-application of 44e8da3ecd
with fixes:
* Dartanalyzer error is fixed in the new test isolate/message4_test
* The new test is skipped in the status file in dart2j/non-d8 modes,
  issue #30247 is created.
* Minor tweak of Closure_equals: other.IsClosure() is tested earlier.

Original CL review:

https://codereview.chromium.org/2989493002/

Original CL description:

This CL introduces a new Function kind, kImplicitClosureFunction, in
order to simplify check for implicit closures and make it more
efficient.

This CL also fixes Function::IsImplicitStaticClosureFunction(RawFunction*)
to correctly handle implicit closures created from static native
functions.

Closes #30203.

As the result of a faster check for implicit closures and slight
refactoring of Closure_equals, micro-benchmark exercising Closure_equals
speeds up from 9618ms to 6700ms for implicit closures case and
insignificantly for other cases.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2987703002 .
2017-07-24 09:43:52 -07:00
Alexander Markov 45dddb2807 Revert "Simplify and fix implicit closure check, speed up Closure_equals"
This reverts commit 44e8da3ecd.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2984083002 .
2017-07-21 15:39:20 -07:00
Alexander Markov 44e8da3ecd Simplify and fix implicit closure check, speed up Closure_equals
This CL introduces a new Function kind, kImplicitClosureFunction, in
order to simplify check for implicit closures and make it more
efficient.

This CL also fixes Function::IsImplicitStaticClosureFunction(RawFunction*)
to correctly handle implicit closures created from static native
functions.

Closes #30203.

As the result of a faster check for implicit closures and slight
refactoring of Closure_equals, micro-benchmark exercising Closure_equals
speeds up from 9618ms to 6700ms for implicit closures case and
insignificantly for other cases.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2989493002 .
2017-07-21 14:26:56 -07:00
Régis Crelier c98989f0d7 [VM generic function types] Properly set the scope function after parsing a
result type that may contain a generic function type.
Add a regression test demonstrating the fixed problem.
Rename ResolveType to ResolveTypeParameters in the parser to clarify that only
type parameters get resolved.
Rename ResolveSignature to ResolveSignatureTypeParameters for the same reason.
Correctly propagate the finalization mode when finalizing signatures.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2979763002 .
2017-07-19 13:32:24 -07:00
Zachary Anderson 952345ff84 Remove the debugger_ field from Isolate in a PRODUCT build.
This is the first in a series of CL in which I am removing fields from
classes that aren't used in PRODUCT mode. This CL removes the
debugger_ field from Isolate.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2981173002 .
2017-07-18 13:29:40 -07:00
Vyacheslav Egorov c6815e8522 Reapply 0489249d29 with a fix for front_end tests.
Proper sequencing of _asyncStackTraceHelper in Kernel

This helper function was being called before its argument was
initialized so it was passing null.  Instead, it should be called
after its argument is initialized.

Because the initialization happens in Kernel code, it is simplest to
insert the call explicitly in Kernel code as well as part of the async
transformation.  This has the consequence that we now call the helper
function even when the flag causal_async_stacks is false.

Fixes issue #29771.
Fixes issue #30178
Fixes issue #30058

BUG=
R=aam@google.com, asiva@google.com

Review-Url: https://codereview.chromium.org/2936793003 .
Review-Url: https://codereview.chromium.org/2982943002 .
2017-07-17 20:56:28 +02: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
Régis Crelier f78076d595 [VM Parser] Fix parsing of new function type syntax (Fixes #30092).
Add regression test.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2973153002 .
2017-07-06 18:16:59 -07:00
Régis Crelier 164a602a80 [VM parser] Mark class as typedef class before parsing its function type when
using the new function type syntax.
This issue prevents committing of https://codereview.chromium.org/2893893002

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2966583002 .
2017-06-29 14:33:36 -07:00
Régis Crelier d9cc3b0e67 Allocate local variable holding type arguments in generic functions in Kernel.
Capture instantiators when calling generic functions with uninstantiated type
arguments.
Add VM flag to generic functions tests that do not expect reification.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2958833003 .
2017-06-27 15:19:37 -07:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Ben Konyi 143baba8fc Reintroducing parser changes to cause compile-time errors when trying to reinitialize a final field. Updated status files to hopefully address the test failures. Issue 29658.
This reverts commit 12e93cc41e.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/2953843003 .
2017-06-22 13:48:57 -07:00
Aske Simon Christensen cec963f028 The current growth strategy for growable arrays allocates a backing array of size 2 at (empty) creation and doubles the size whenever the capacity is insufficient while adding elements.
I collected statistics for the sizes and capacities of growable arrays which are promoted to old-space or survive an old-space gc when running dart2js and Fasta. For these applications, the vast majority of arrays stay empty. More than half of the total object size of promoted backing arrays is backing for empty growable arrays.

Furthermore, since the overhead for an array is 3 words (header, type parameters and length), and object sizes are rounded up to an even number of words, we waste one word for all even-sized arrays.

This CL changes the growth strategy so that empty growable arrays are created with a shared, zero-sized array as backing, avoiding the allocation of a backing array if no elements are added. When the array needs to grow, it starts out at 3 and grows to double size plus one each time: 7, 15, 31, ...

A few places in the VM code need to handle these shared, zero-sized arrays specially. In particular, the Array::MakeArray function needs to allocate a new, empty array if its result is to be returned to Dart code.

Benchmarks suggest that the change improves memory usage by a few percent overall and does not significantly affect run time.

BUG=
R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2949803002 .
2017-06-22 10:51:54 +02:00
Régis Crelier 1f5f3ed79f Set and keep parent function of signature functions.
Fix function type parameter comparison in type tests.

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2951803005 .
2017-06-21 13:16:23 -07:00
Ryan Macnak 095ff155fd VM: Allow trailing comma in assert statements.
Issue #29959

R=regis@google.com

Review-Url: https://codereview.chromium.org/2946173002 .
2017-06-21 09:08:16 -07:00
Régis Crelier a62107cfaf Check for a passed-in type argument vector in the prolog of generic functions.
Do this in unoptimized code only, when --reify-generic-functions is specified.
This is still work in progress, and support in optimizer, in inliner, in DBC,
in kernel to ir, and other areas, will follow.
Many small fixes and added todos.

R=rmacnak@google.com, vegorov@google.com

Review-Url: https://codereview.chromium.org/2941643002 .
2017-06-21 09:02:16 -07:00
Alan Knight 12e93cc41e Revert "Updated parser to produce error when trying to reinitialize final variables in class constructors. Fixes issue #29658."
This reverts commit 9755a98b00.

BUG=

Review-Url: https://codereview.chromium.org/2949943002 .
2017-06-20 15:25:55 -07:00
Ben Konyi 9755a98b00 Updated parser to produce error when trying to reinitialize final variables in class constructors. Fixes issue #29658.
BUG=
R=zra@google.com

Example:
Foo {
  final int x = 10;
  Foo(this.x); // Error
  Foo.named() : x = 42; // Error
}
Review-Url: https://codereview.chromium.org/2947043002 .
2017-06-20 14:40:36 -07:00
Ben Konyi a4a227e375 Revert "Updated parser to produce error when trying to reinitialize final variables in class constructors. Fixes issue #29658."
This reverts commit b5cff3f68f.

TBR=zra@google.com

Review-Url: https://codereview.chromium.org/2944223002 .
2017-06-19 17:23:01 -07:00
Ben Konyi b5cff3f68f Updated parser to produce error when trying to reinitialize final variables in class constructors. Fixes issue #29658.
BUG=
R=asiva@google.com

Example:
Foo {
  final int x = 10;
  Foo(this.x); // Error
  Foo.named() : x = 42; // Error
}
Review-Url: https://codereview.chromium.org/2939553005 .
2017-06-19 12:07:37 -07:00
Kevin Millikin 8340cfda55 Revert "Proper sequencing of _asyncStackTraceHelper in Kernel"
This reverts commit 0489249d29.  The
change causes failures in the front end tests.

BUG=
R=sivachandra@google.com

Review-Url: https://codereview.chromium.org/2949533003 .
2017-06-19 17:21:22 +02:00
Kevin Millikin 0489249d29 Proper sequencing of _asyncStackTraceHelper in Kernel
This helper function was being called before its argument was
initialized so it was passing null.  Instead, it should be called
after its argument is initialized.

Because the initialization happens in Kernel code, it is simplest to
insert the call explicitly in Kernel code as well as part of the async
transformation.  This has the consequence that we now call the helper
function even when the flag causal_async_stacks is false.

Fixes #29771.

BUG=
R=aam@google.com, asiva@google.com

Review-Url: https://codereview.chromium.org/2936793003 .
2017-06-19 16:52:58 +02:00
Jens Johansen 4bbda48a7c [kernel] Stream everything. Replace .kernel_function with .kernel_offset
- Put pointer to kernel data into Script.
- Replace function.kernel_function pointer to AstNode with
  kernel_offset():
- Replace field.kernel_field pointer to AstNode with kernel_offest().
- Stream the previously unstreamed AstNodes: FunctionDeclaration and
  FunctionExpression.
- Move special handling for _buildin.getMainClosure into the streaming
  flowgraph builder.
- Delete big parts of kernel_to_il.

R=kmillikin@google.com

Committed: https://github.com/dart-lang/sdk/commit/948e2f5d7916032ed6f0bfdc316ba4f577a5ea61
Review-Url: https://codereview.chromium.org/2901533002 .
2017-06-14 10:59:57 +02:00
Jens Johansen de5ebc5a4e Revert "[kernel] Stream everything. Replace .kernel_function with .kernel_offset"
The commit somehow made e.g. vm-linux-release-ia32-be turn red.

This reverts commit 948e2f5d79.

BUG=

Review-Url: https://codereview.chromium.org/2941483003 .
2017-06-14 09:12:38 +02:00
Jens Johansen 948e2f5d79 [kernel] Stream everything. Replace .kernel_function with .kernel_offset
- Put pointer to kernel data into Script.
- Replace function.kernel_function pointer to AstNode with
  kernel_offset():
- Replace field.kernel_field pointer to AstNode with kernel_offest().
- Stream the previously unstreamed AstNodes: FunctionDeclaration and
  FunctionExpression.
- Move special handling for _buildin.getMainClosure into the streaming
  flowgraph builder.
- Delete big parts of kernel_to_il.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2901533002 .
2017-06-14 08:27:21 +02:00
Jens Johansen 76336b225f [kernel] Streaming ScopeBuilder
The old ScopeBuilder is replaced with StreamingScopeBuilder
that does not use the Ast.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2886873008 .
2017-06-13 11:39:31 +02:00
Régis Crelier bd39b941c5 Allow 'void' as a type argument (fixes #28945).
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2907423003 .
2017-06-05 11:11:27 -07:00
Régis Crelier f0faae52bf Fix VM to accept literal function type as type bound (fixes #29481).
Add regression test.
Mark status files for failing dart2js and analyzer (filed new issues).

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2916453003 .
2017-05-30 17:26:35 -07:00
Régis Crelier b7ebbf8c77 Allow a function named 'get' to be generic (fixes #29746).
Add regression test.
Mark status files for failing dartk, dart2js, and analyzer.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2911333002 .
2017-05-30 15:31:04 -07:00
Martin Kustermann ef71b485eb Fix new space allocation in parser which can be triggered on background compiler
This CL introduces also `Parser::allocation_space_` field which is set
to Heap::kNew on mutator thread and Heap::kOld on all other threads.

R=asiva@google.com, vegorov@google.com

Review-Url: https://codereview.chromium.org/2902063003 .
2017-05-29 11:06:51 +02:00