| 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/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 isolate->object_store()->clear_sticky_error(); | 543 isolate->object_store()->clear_sticky_error(); |
| 544 isolate->set_long_jump_base(base); | 544 isolate->set_long_jump_base(base); |
| 545 return error.raw(); | 545 return error.raw(); |
| 546 } | 546 } |
| 547 UNREACHABLE(); | 547 UNREACHABLE(); |
| 548 return Error::null(); | 548 return Error::null(); |
| 549 } | 549 } |
| 550 | 550 |
| 551 | 551 |
| 552 RawError* Compiler::CompileAllFunctions(const Class& cls) { | 552 RawError* Compiler::CompileAllFunctions(const Class& cls) { |
| 553 Isolate* isolate = Isolate::Current(); |
| 553 Error& error = Error::Handle(); | 554 Error& error = Error::Handle(); |
| 554 Array& functions = Array::Handle(cls.functions()); | 555 Array& functions = Array::Handle(cls.functions()); |
| 555 Function& func = Function::Handle(); | 556 Function& func = Function::Handle(); |
| 556 // Class dynamic lives in the vm isolate. Its array fields cannot be set to | 557 // Class dynamic lives in the vm isolate. Its array fields cannot be set to |
| 557 // an empty array. | 558 // an empty array. |
| 558 if (functions.IsNull()) { | 559 if (functions.IsNull()) { |
| 559 ASSERT(cls.IsDynamicClass()); | 560 ASSERT(cls.IsDynamicClass()); |
| 560 return error.raw(); | 561 return error.raw(); |
| 561 } | 562 } |
| 562 for (int i = 0; i < functions.Length(); i++) { | 563 for (int i = 0; i < functions.Length(); i++) { |
| 563 func ^= functions.At(i); | 564 func ^= functions.At(i); |
| 564 ASSERT(!func.IsNull()); | 565 ASSERT(!func.IsNull()); |
| 565 if (!func.HasCode() && | 566 if (!func.HasCode() && |
| 566 !func.is_abstract() && | 567 !func.is_abstract() && |
| 567 !func.IsRedirectingFactory()) { | 568 !func.IsRedirectingFactory()) { |
| 569 StackZone zone(isolate); |
| 570 HANDLESCOPE(isolate); |
| 568 error = CompileFunction(func); | 571 error = CompileFunction(func); |
| 569 if (!error.IsNull()) { | 572 if (!error.IsNull()) { |
| 570 return error.raw(); | 573 return error.raw(); |
| 571 } | 574 } |
| 572 } | 575 } |
| 573 } | 576 } |
| 574 return error.raw(); | 577 return error.raw(); |
| 575 } | 578 } |
| 576 | 579 |
| 577 | 580 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 result = isolate->object_store()->sticky_error(); | 636 result = isolate->object_store()->sticky_error(); |
| 634 isolate->object_store()->clear_sticky_error(); | 637 isolate->object_store()->clear_sticky_error(); |
| 635 isolate->set_long_jump_base(base); | 638 isolate->set_long_jump_base(base); |
| 636 return result.raw(); | 639 return result.raw(); |
| 637 } | 640 } |
| 638 UNREACHABLE(); | 641 UNREACHABLE(); |
| 639 return Object::null(); | 642 return Object::null(); |
| 640 } | 643 } |
| 641 | 644 |
| 642 } // namespace dart | 645 } // namespace dart |
| OLD | NEW |