OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/compiler.h" | 5 #include "vm/compiler.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 | 8 |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/block_scheduler.h" | 10 #include "vm/block_scheduler.h" |
(...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1588 const Function& function = Function::Handle(code.function()); | 1588 const Function& function = Function::Handle(code.function()); |
1589 ParsedFunction* parsed_function = new ParsedFunction( | 1589 ParsedFunction* parsed_function = new ParsedFunction( |
1590 Thread::Current(), Function::ZoneHandle(function.raw())); | 1590 Thread::Current(), Function::ZoneHandle(function.raw())); |
1591 ASSERT(code.var_descriptors() == Object::null()); | 1591 ASSERT(code.var_descriptors() == Object::null()); |
1592 // IsIrregexpFunction have eager var descriptors generation. | 1592 // IsIrregexpFunction have eager var descriptors generation. |
1593 ASSERT(!function.IsIrregexpFunction()); | 1593 ASSERT(!function.IsIrregexpFunction()); |
1594 // In background compilation, parser can produce 'errors": bailouts | 1594 // In background compilation, parser can produce 'errors": bailouts |
1595 // if state changed while compiling in background. | 1595 // if state changed while compiling in background. |
1596 LongJumpScope jump; | 1596 LongJumpScope jump; |
1597 if (setjmp(*jump.Set()) == 0) { | 1597 if (setjmp(*jump.Set()) == 0) { |
1598 Parser::ParseFunction(parsed_function); | 1598 if (function.kernel_function() == NULL) { |
1599 parsed_function->AllocateVariables(); | 1599 Parser::ParseFunction(parsed_function); |
| 1600 parsed_function->AllocateVariables(); |
| 1601 } else { |
| 1602 parsed_function->EnsureKernelScopes(); |
| 1603 } |
1600 const LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle( | 1604 const LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle( |
1601 parsed_function->node_sequence()->scope()->GetVarDescriptors(function)); | 1605 parsed_function->node_sequence()->scope()->GetVarDescriptors(function)); |
1602 ASSERT(!var_descs.IsNull()); | 1606 ASSERT(!var_descs.IsNull()); |
1603 code.set_var_descriptors(var_descs); | 1607 code.set_var_descriptors(var_descs); |
1604 } else { | 1608 } else { |
1605 // Only possible with background compilation. | 1609 // Only possible with background compilation. |
1606 ASSERT(Compiler::IsBackgroundCompilation()); | 1610 ASSERT(Compiler::IsBackgroundCompilation()); |
1607 } | 1611 } |
1608 } | 1612 } |
1609 | 1613 |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2316 | 2320 |
2317 | 2321 |
2318 bool BackgroundCompiler::IsDisabled() { | 2322 bool BackgroundCompiler::IsDisabled() { |
2319 UNREACHABLE(); | 2323 UNREACHABLE(); |
2320 return true; | 2324 return true; |
2321 } | 2325 } |
2322 | 2326 |
2323 #endif // DART_PRECOMPILED_RUNTIME | 2327 #endif // DART_PRECOMPILED_RUNTIME |
2324 | 2328 |
2325 } // namespace dart | 2329 } // namespace dart |
OLD | NEW |