Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Side by Side Diff: vm/compiler.cc

Issue 11280315: Start a fresh zone and handle scope for each function being compiled (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698