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 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 func.SetNumOptionalParameters(0, true); | 1394 func.SetNumOptionalParameters(0, true); |
1395 // Manually generated AST, do not recompile. | 1395 // Manually generated AST, do not recompile. |
1396 func.SetIsOptimizable(false); | 1396 func.SetIsOptimizable(false); |
1397 func.set_is_debuggable(false); | 1397 func.set_is_debuggable(false); |
1398 | 1398 |
1399 // We compile the function here, even though InvokeFunction() below | 1399 // We compile the function here, even though InvokeFunction() below |
1400 // would compile func automatically. We are checking fewer invariants | 1400 // would compile func automatically. We are checking fewer invariants |
1401 // here. | 1401 // here. |
1402 ParsedFunction* parsed_function = new ParsedFunction(thread, func); | 1402 ParsedFunction* parsed_function = new ParsedFunction(thread, func); |
1403 parsed_function->SetNodeSequence(fragment); | 1403 parsed_function->SetNodeSequence(fragment); |
1404 parsed_function->set_default_parameter_values(Object::null_array()); | |
1405 fragment->scope()->AddVariable(parsed_function->EnsureExpressionTemp()); | 1404 fragment->scope()->AddVariable(parsed_function->EnsureExpressionTemp()); |
1406 fragment->scope()->AddVariable( | 1405 fragment->scope()->AddVariable( |
1407 parsed_function->current_context_var()); | 1406 parsed_function->current_context_var()); |
1408 parsed_function->AllocateVariables(); | 1407 parsed_function->AllocateVariables(); |
1409 | 1408 |
1410 // Non-optimized code generator. | 1409 // Non-optimized code generator. |
1411 DartCompilationPipeline pipeline; | 1410 DartCompilationPipeline pipeline; |
1412 CompileParsedFunctionHelper(&pipeline, | 1411 CompileParsedFunctionHelper(&pipeline, |
1413 parsed_function, | 1412 parsed_function, |
1414 false, | 1413 false, |
(...skipping 10 matching lines...) Expand all Loading... |
1425 const Object& result = | 1424 const Object& result = |
1426 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1425 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
1427 isolate->object_store()->clear_sticky_error(); | 1426 isolate->object_store()->clear_sticky_error(); |
1428 return result.raw(); | 1427 return result.raw(); |
1429 } | 1428 } |
1430 UNREACHABLE(); | 1429 UNREACHABLE(); |
1431 return Object::null(); | 1430 return Object::null(); |
1432 } | 1431 } |
1433 | 1432 |
1434 } // namespace dart | 1433 } // namespace dart |
OLD | NEW |