| 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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1332 Parser::ParseStaticFieldInitializer(field); | 1332 Parser::ParseStaticFieldInitializer(field); |
| 1333 | 1333 |
| 1334 parsed_function->AllocateVariables(); | 1334 parsed_function->AllocateVariables(); |
| 1335 // Non-optimized code generator. | 1335 // Non-optimized code generator. |
| 1336 DartCompilationPipeline pipeline; | 1336 DartCompilationPipeline pipeline; |
| 1337 CompileParsedFunctionHelper(&pipeline, | 1337 CompileParsedFunctionHelper(&pipeline, |
| 1338 parsed_function, | 1338 parsed_function, |
| 1339 false, // optimized | 1339 false, // optimized |
| 1340 Isolate::kNoDeoptId); | 1340 Isolate::kNoDeoptId); |
| 1341 initializer = parsed_function->function().raw(); | 1341 initializer = parsed_function->function().raw(); |
| 1342 Code::Handle(initializer.unoptimized_code()).set_var_descriptors( |
| 1343 Object::empty_var_descriptors()); |
| 1342 } else { | 1344 } else { |
| 1343 initializer ^= field.PrecompiledInitializer(); | 1345 initializer ^= field.PrecompiledInitializer(); |
| 1344 } | 1346 } |
| 1345 // Invoke the function to evaluate the expression. | 1347 // Invoke the function to evaluate the expression. |
| 1346 return DartEntry::InvokeFunction(initializer, Object::empty_array()); | 1348 return DartEntry::InvokeFunction(initializer, Object::empty_array()); |
| 1347 } else { | 1349 } else { |
| 1348 Thread* const thread = Thread::Current(); | 1350 Thread* const thread = Thread::Current(); |
| 1349 Isolate* const isolate = thread->isolate(); | 1351 Isolate* const isolate = thread->isolate(); |
| 1350 StackZone zone(thread); | 1352 StackZone zone(thread); |
| 1351 const Error& error = | 1353 const Error& error = |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1399 fragment->scope()->AddVariable( | 1401 fragment->scope()->AddVariable( |
| 1400 parsed_function->current_context_var()); | 1402 parsed_function->current_context_var()); |
| 1401 parsed_function->AllocateVariables(); | 1403 parsed_function->AllocateVariables(); |
| 1402 | 1404 |
| 1403 // Non-optimized code generator. | 1405 // Non-optimized code generator. |
| 1404 DartCompilationPipeline pipeline; | 1406 DartCompilationPipeline pipeline; |
| 1405 CompileParsedFunctionHelper(&pipeline, | 1407 CompileParsedFunctionHelper(&pipeline, |
| 1406 parsed_function, | 1408 parsed_function, |
| 1407 false, | 1409 false, |
| 1408 Isolate::kNoDeoptId); | 1410 Isolate::kNoDeoptId); |
| 1411 Code::Handle(func.unoptimized_code()).set_var_descriptors( |
| 1412 Object::empty_var_descriptors()); |
| 1409 | 1413 |
| 1410 const Object& result = PassiveObject::Handle( | 1414 const Object& result = PassiveObject::Handle( |
| 1411 DartEntry::InvokeFunction(func, Object::empty_array())); | 1415 DartEntry::InvokeFunction(func, Object::empty_array())); |
| 1412 return result.raw(); | 1416 return result.raw(); |
| 1413 } else { | 1417 } else { |
| 1414 Thread* const thread = Thread::Current(); | 1418 Thread* const thread = Thread::Current(); |
| 1415 Isolate* const isolate = thread->isolate(); | 1419 Isolate* const isolate = thread->isolate(); |
| 1416 const Object& result = | 1420 const Object& result = |
| 1417 PassiveObject::Handle(isolate->object_store()->sticky_error()); | 1421 PassiveObject::Handle(isolate->object_store()->sticky_error()); |
| 1418 isolate->object_store()->clear_sticky_error(); | 1422 isolate->object_store()->clear_sticky_error(); |
| 1419 return result.raw(); | 1423 return result.raw(); |
| 1420 } | 1424 } |
| 1421 UNREACHABLE(); | 1425 UNREACHABLE(); |
| 1422 return Object::null(); | 1426 return Object::null(); |
| 1423 } | 1427 } |
| 1424 | 1428 |
| 1425 } // namespace dart | 1429 } // namespace dart |
| OLD | NEW |