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

Side by Side Diff: vm/compiler.cc

Issue 9721006: Second set of changes for implementation of stack map support. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « vm/code_generator_x64_test.cc ('k') | vm/flow_graph_compiler_x64.h » ('j') | 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 #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_index_table.h" 10 #include "vm/code_index_table.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 ExtractTypeFeedback( 183 ExtractTypeFeedback(
184 Code::Handle(parsed_function.function().unoptimized_code()), 184 Code::Handle(parsed_function.function().unoptimized_code()),
185 parsed_function.node_sequence()); 185 parsed_function.node_sequence());
186 } 186 }
187 OptimizingCodeGenerator code_gen(&assembler, parsed_function); 187 OptimizingCodeGenerator code_gen(&assembler, parsed_function);
188 code_gen.GenerateCode(); 188 code_gen.GenerateCode();
189 Code& code = Code::Handle( 189 Code& code = Code::Handle(
190 Code::FinalizeCode(function_fullname, &assembler)); 190 Code::FinalizeCode(function_fullname, &assembler));
191 code.set_is_optimized(true); 191 code.set_is_optimized(true);
192 code_gen.FinalizePcDescriptors(code); 192 code_gen.FinalizePcDescriptors(code);
193 code_gen.FinalizeStackmaps(code);
193 code_gen.FinalizeExceptionHandlers(code); 194 code_gen.FinalizeExceptionHandlers(code);
194 function.SetCode(code); 195 function.SetCode(code);
195 code_index_table->AddCode(code); 196 code_index_table->AddCode(code);
196 CodePatcher::PatchEntry(Code::Handle(function.unoptimized_code())); 197 CodePatcher::PatchEntry(Code::Handle(function.unoptimized_code()));
197 if (FLAG_trace_compiler) { 198 if (FLAG_trace_compiler) {
198 OS::Print("--> patching entry 0x%x\n", 199 OS::Print("--> patching entry 0x%x\n",
199 Code::Handle(function.unoptimized_code()).EntryPoint()); 200 Code::Handle(function.unoptimized_code()).EntryPoint());
200 } 201 }
201 } else { 202 } else {
202 // Unoptimized code. 203 // Unoptimized code.
203 if (Code::Handle(function.unoptimized_code()).IsNull()) { 204 if (Code::Handle(function.unoptimized_code()).IsNull()) {
204 ASSERT(!function.HasCode()); 205 ASSERT(!function.HasCode());
205 // Compiling first time. 206 // Compiling first time.
206 CodeGenerator code_gen(&assembler, parsed_function); 207 CodeGenerator code_gen(&assembler, parsed_function);
207 code_gen.GenerateCode(); 208 code_gen.GenerateCode();
208 const Code& code = 209 const Code& code =
209 Code::Handle(Code::FinalizeCode(function_fullname, &assembler)); 210 Code::Handle(Code::FinalizeCode(function_fullname, &assembler));
210 code.set_is_optimized(false); 211 code.set_is_optimized(false);
211 code_gen.FinalizePcDescriptors(code); 212 code_gen.FinalizePcDescriptors(code);
213 code_gen.FinalizeStackmaps(code);
212 code_gen.FinalizeVarDescriptors(code); 214 code_gen.FinalizeVarDescriptors(code);
213 code_gen.FinalizeExceptionHandlers(code); 215 code_gen.FinalizeExceptionHandlers(code);
214 function.set_unoptimized_code(code); 216 function.set_unoptimized_code(code);
215 function.SetCode(code); 217 function.SetCode(code);
216 ASSERT(CodePatcher::CodeIsPatchable(code)); 218 ASSERT(CodePatcher::CodeIsPatchable(code));
217 code_index_table->AddCode(code); 219 code_index_table->AddCode(code);
218 } else { 220 } else {
219 // Disable optimized code. 221 // Disable optimized code.
220 ASSERT(function.HasOptimizedCode()); 222 ASSERT(function.HasOptimizedCode());
221 // Patch entry of optimized code. 223 // Patch entry of optimized code.
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 const Code& code = Code::Handle(Code::FinalizeCode(kEvalConst, &assembler)); 381 const Code& code = Code::Handle(Code::FinalizeCode(kEvalConst, &assembler));
380 382
381 func.SetCode(code); 383 func.SetCode(code);
382 CodeIndexTable* code_index_table = isolate->code_index_table(); 384 CodeIndexTable* code_index_table = isolate->code_index_table();
383 ASSERT(code_index_table != NULL); 385 ASSERT(code_index_table != NULL);
384 code_index_table->AddCode(code); 386 code_index_table->AddCode(code);
385 // TODO(hausner): We need a way to remove these one-time execution 387 // TODO(hausner): We need a way to remove these one-time execution
386 // functions from the global code description (PC mapping) tables so 388 // functions from the global code description (PC mapping) tables so
387 // we don't pollute the system unnecessarily with stale data. 389 // we don't pollute the system unnecessarily with stale data.
388 code_gen.FinalizePcDescriptors(code); 390 code_gen.FinalizePcDescriptors(code);
391 code_gen.FinalizeStackmaps(code);
389 code_gen.FinalizeExceptionHandlers(code); 392 code_gen.FinalizeExceptionHandlers(code);
390 393
391 GrowableArray<const Object*> arguments; // no arguments. 394 GrowableArray<const Object*> arguments; // no arguments.
392 const Array& kNoArgumentNames = Array::Handle(); 395 const Array& kNoArgumentNames = Array::Handle();
393 result = DartEntry::InvokeStatic(func, 396 result = DartEntry::InvokeStatic(func,
394 arguments, 397 arguments,
395 kNoArgumentNames); 398 kNoArgumentNames);
396 } else { 399 } else {
397 result = isolate->object_store()->sticky_error(); 400 result = isolate->object_store()->sticky_error();
398 isolate->object_store()->clear_sticky_error(); 401 isolate->object_store()->clear_sticky_error();
399 } 402 }
400 isolate->set_long_jump_base(base); 403 isolate->set_long_jump_base(base);
401 return result.raw(); 404 return result.raw();
402 } 405 }
403 406
404 407
405 } // namespace dart 408 } // namespace dart
OLDNEW
« no previous file with comments | « vm/code_generator_x64_test.cc ('k') | vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698