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

Side by Side Diff: runtime/vm/compiler.cc

Issue 10871005: Make ClassFinalizer indifferent on whether we are generating a snapshot or not. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 months 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
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 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/code_patcher.h" 10 #include "vm/code_patcher.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 const Array& result = Array::Handle(Array::New(max_id + 1)); 65 const Array& result = Array::Handle(Array::New(max_id + 1));
66 for (intptr_t i = 0; i < deopt_ids.length(); i++) { 66 for (intptr_t i = 0; i < deopt_ids.length(); i++) {
67 intptr_t result_index = deopt_ids[i]; 67 intptr_t result_index = deopt_ids[i];
68 ASSERT(result.At(result_index) == Object::null()); 68 ASSERT(result.At(result_index) == Object::null());
69 result.SetAt(result_index, Object::Handle(ic_data_objs.At(i))); 69 result.SetAt(result_index, Object::Handle(ic_data_objs.At(i)));
70 } 70 }
71 return result.raw(); 71 return result.raw();
72 } 72 }
73 73
74 74
75 RawError* Compiler::Compile(const Library& library, const Script& script) { 75 RawError* Compiler::Compile(const Library& library,
76 const Script& script,
77 bool generating_snapshot) {
76 Isolate* isolate = Isolate::Current(); 78 Isolate* isolate = Isolate::Current();
77 LongJump* base = isolate->long_jump_base(); 79 LongJump* base = isolate->long_jump_base();
78 LongJump jump; 80 LongJump jump;
79 isolate->set_long_jump_base(&jump); 81 isolate->set_long_jump_base(&jump);
80 if (setjmp(*jump.Set()) == 0) { 82 if (setjmp(*jump.Set()) == 0) {
81 if (FLAG_trace_compiler) { 83 if (FLAG_trace_compiler) {
82 HANDLESCOPE(isolate); 84 HANDLESCOPE(isolate);
83 const String& script_url = String::Handle(script.url()); 85 const String& script_url = String::Handle(script.url());
84 // TODO(iposva): Extract script kind. 86 // TODO(iposva): Extract script kind.
85 OS::Print("Compiling %s '%s'\n", "", script_url.ToCString()); 87 OS::Print("Compiling %s '%s'\n", "", script_url.ToCString());
86 } 88 }
87 const String& library_key = String::Handle(library.private_key()); 89 const String& library_key = String::Handle(library.private_key());
88 script.Tokenize(library_key); 90 script.Tokenize(library_key);
89 Parser::ParseCompilationUnit(library, script); 91 Parser::ParseCompilationUnit(library, script, generating_snapshot);
90 isolate->set_long_jump_base(base); 92 isolate->set_long_jump_base(base);
91 return Error::null(); 93 return Error::null();
92 } else { 94 } else {
93 Error& error = Error::Handle(); 95 Error& error = Error::Handle();
94 error = isolate->object_store()->sticky_error(); 96 error = isolate->object_store()->sticky_error();
95 isolate->object_store()->clear_sticky_error(); 97 isolate->object_store()->clear_sticky_error();
96 isolate->set_long_jump_base(base); 98 isolate->set_long_jump_base(base);
97 return error.raw(); 99 return error.raw();
98 } 100 }
99 UNREACHABLE(); 101 UNREACHABLE();
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 result = isolate->object_store()->sticky_error(); 554 result = isolate->object_store()->sticky_error();
553 isolate->object_store()->clear_sticky_error(); 555 isolate->object_store()->clear_sticky_error();
554 isolate->set_long_jump_base(base); 556 isolate->set_long_jump_base(base);
555 return result.raw(); 557 return result.raw();
556 } 558 }
557 UNREACHABLE(); 559 UNREACHABLE();
558 return Object::null(); 560 return Object::null();
559 } 561 }
560 562
561 } // namespace dart 563 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698