| 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 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 UNREACHABLE(); | 1487 UNREACHABLE(); |
| 1488 return Error::null(); | 1488 return Error::null(); |
| 1489 } | 1489 } |
| 1490 | 1490 |
| 1491 | 1491 |
| 1492 void Compiler::ComputeLocalVarDescriptors(const Code& code) { | 1492 void Compiler::ComputeLocalVarDescriptors(const Code& code) { |
| 1493 ASSERT(!code.is_optimized()); | 1493 ASSERT(!code.is_optimized()); |
| 1494 const Function& function = Function::Handle(code.function()); | 1494 const Function& function = Function::Handle(code.function()); |
| 1495 ParsedFunction* parsed_function = new ParsedFunction( | 1495 ParsedFunction* parsed_function = new ParsedFunction( |
| 1496 Thread::Current(), Function::ZoneHandle(function.raw())); | 1496 Thread::Current(), Function::ZoneHandle(function.raw())); |
| 1497 LocalVarDescriptors& var_descs = | 1497 ASSERT(code.var_descriptors() == Object::null()); |
| 1498 LocalVarDescriptors::Handle(code.var_descriptors()); | |
| 1499 ASSERT(var_descs.IsNull()); | |
| 1500 // IsIrregexpFunction have eager var descriptors generation. | 1498 // IsIrregexpFunction have eager var descriptors generation. |
| 1501 ASSERT(!function.IsIrregexpFunction()); | 1499 ASSERT(!function.IsIrregexpFunction()); |
| 1502 // In background compilation, parser can produce 'errors": bailouts | 1500 // In background compilation, parser can produce 'errors": bailouts |
| 1503 // if state changed while compiling in background. | 1501 // if state changed while compiling in background. |
| 1504 LongJumpScope jump; | 1502 LongJumpScope jump; |
| 1505 if (setjmp(*jump.Set()) == 0) { | 1503 if (setjmp(*jump.Set()) == 0) { |
| 1506 Parser::ParseFunction(parsed_function); | 1504 Parser::ParseFunction(parsed_function); |
| 1507 parsed_function->AllocateVariables(); | 1505 parsed_function->AllocateVariables(); |
| 1508 var_descs = parsed_function->node_sequence()->scope()-> | 1506 const LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle( |
| 1509 GetVarDescriptors(function); | 1507 parsed_function->node_sequence()->scope()->GetVarDescriptors(function)); |
| 1510 ASSERT(!var_descs.IsNull()); | 1508 ASSERT(!var_descs.IsNull()); |
| 1511 code.set_var_descriptors(var_descs); | 1509 code.set_var_descriptors(var_descs); |
| 1512 } else { | 1510 } else { |
| 1513 // Only possible with background compilation. | 1511 // Only possible with background compilation. |
| 1514 ASSERT(Compiler::IsBackgroundCompilation()); | 1512 ASSERT(Compiler::IsBackgroundCompilation()); |
| 1515 } | 1513 } |
| 1516 } | 1514 } |
| 1517 | 1515 |
| 1518 | 1516 |
| 1519 RawError* Compiler::CompileAllFunctions(const Class& cls) { | 1517 RawError* Compiler::CompileAllFunctions(const Class& cls) { |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2105 } | 2103 } |
| 2106 | 2104 |
| 2107 | 2105 |
| 2108 void BackgroundCompiler::EnsureInit(Thread* thread) { | 2106 void BackgroundCompiler::EnsureInit(Thread* thread) { |
| 2109 UNREACHABLE(); | 2107 UNREACHABLE(); |
| 2110 } | 2108 } |
| 2111 | 2109 |
| 2112 #endif // DART_PRECOMPILED_RUNTIME | 2110 #endif // DART_PRECOMPILED_RUNTIME |
| 2113 | 2111 |
| 2114 } // namespace dart | 2112 } // namespace dart |
| OLD | NEW |