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

Side by Side Diff: runtime/vm/flow_graph_compiler.h

Issue 14682020: Optimize functions containing try-catch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 7 years, 7 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 | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('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 #ifndef VM_FLOW_GRAPH_COMPILER_H_ 5 #ifndef VM_FLOW_GRAPH_COMPILER_H_
6 #define VM_FLOW_GRAPH_COMPILER_H_ 6 #define VM_FLOW_GRAPH_COMPILER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/code_descriptors.h" 10 #include "vm/code_descriptors.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 ~FlowGraphCompiler(); 237 ~FlowGraphCompiler();
238 238
239 static bool SupportsUnboxedMints(); 239 static bool SupportsUnboxedMints();
240 240
241 // Accessors. 241 // Accessors.
242 Assembler* assembler() const { return assembler_; } 242 Assembler* assembler() const { return assembler_; }
243 const ParsedFunction& parsed_function() const { return parsed_function_; } 243 const ParsedFunction& parsed_function() const { return parsed_function_; }
244 const GrowableArray<BlockEntryInstr*>& block_order() const { 244 const GrowableArray<BlockEntryInstr*>& block_order() const {
245 return block_order_; 245 return block_order_;
246 } 246 }
247
248 const FlowGraph& flow_graph() const { return flow_graph_; }
249
247 DescriptorList* pc_descriptors_list() const { 250 DescriptorList* pc_descriptors_list() const {
248 return pc_descriptors_list_; 251 return pc_descriptors_list_;
249 } 252 }
250 BlockEntryInstr* current_block() const { return current_block_; } 253 BlockEntryInstr* current_block() const { return current_block_; }
251 void set_current_block(BlockEntryInstr* value) { 254 void set_current_block(BlockEntryInstr* value) {
252 current_block_ = value; 255 current_block_ = value;
253 } 256 }
254 static bool CanOptimize(); 257 static bool CanOptimize();
255 bool CanOptimizeFunction() const; 258 bool CanOptimizeFunction() const;
256 bool is_optimizing() const { return is_optimizing_; } 259 bool is_optimizing() const { return is_optimizing_; }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 void EmitEqualityRegConstCompare(Register reg, 376 void EmitEqualityRegConstCompare(Register reg,
374 const Object& obj, 377 const Object& obj,
375 bool needs_number_check); 378 bool needs_number_check);
376 void EmitEqualityRegRegCompare(Register left, 379 void EmitEqualityRegRegCompare(Register left,
377 Register right, 380 Register right,
378 bool needs_number_check); 381 bool needs_number_check);
379 // Implement equality: if any of the arguments is null do identity check. 382 // Implement equality: if any of the arguments is null do identity check.
380 // Fallthrough calls super equality. 383 // Fallthrough calls super equality.
381 void EmitSuperEqualityCallPrologue(Register result, Label* skip_call); 384 void EmitSuperEqualityCallPrologue(Register result, Label* skip_call);
382 385
386 void EmitTrySync(Instruction* instr, intptr_t try_index);
387
383 intptr_t StackSize() const; 388 intptr_t StackSize() const;
384 389
385 // Returns assembler label associated with the given block entry. 390 // Returns assembler label associated with the given block entry.
386 Label* GetJumpLabel(BlockEntryInstr* block_entry) const; 391 Label* GetJumpLabel(BlockEntryInstr* block_entry) const;
387 bool WasCompacted(BlockEntryInstr* block_entry) const; 392 bool WasCompacted(BlockEntryInstr* block_entry) const;
388 393
389 // Returns true if there is a next block after the current one in 394 // Returns true if there is a next block after the current one in
390 // the block order and if it is the given block. 395 // the block order and if it is the given block.
391 bool CanFallThroughTo(BlockEntryInstr* block_entry) const; 396 bool CanFallThroughTo(BlockEntryInstr* block_entry) const;
392 397
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 462
458 // Returns 'sorted' array in decreasing count order. 463 // Returns 'sorted' array in decreasing count order.
459 static void SortICDataByCount(const ICData& ic_data, 464 static void SortICDataByCount(const ICData& ic_data,
460 GrowableArray<CidTarget>* sorted); 465 GrowableArray<CidTarget>* sorted);
461 466
462 private: 467 private:
463 friend class CheckStackOverflowSlowPath; // For pending_deoptimization_env_. 468 friend class CheckStackOverflowSlowPath; // For pending_deoptimization_env_.
464 469
465 void EmitFrameEntry(); 470 void EmitFrameEntry();
466 471
472 void EmitTrySyncMove(Address dest, Location loc, bool* push_emitted);
473
467 void AddStaticCallTarget(const Function& function); 474 void AddStaticCallTarget(const Function& function);
468 475
469 void GenerateDeferredCode(); 476 void GenerateDeferredCode();
470 477
471 void EmitInstructionPrologue(Instruction* instr); 478 void EmitInstructionPrologue(Instruction* instr);
472 void EmitInstructionEpilogue(Instruction* instr); 479 void EmitInstructionEpilogue(Instruction* instr);
473 480
474 // Emit code to load a Value into register 'dst'. 481 // Emit code to load a Value into register 'dst'.
475 void LoadValue(Register dst, Value* value); 482 void LoadValue(Register dst, Value* value);
476 483
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // that should be used when deoptimizing we store it in this variable. 590 // that should be used when deoptimizing we store it in this variable.
584 // In future AddDeoptStub should be moved out of the instruction template. 591 // In future AddDeoptStub should be moved out of the instruction template.
585 Environment* pending_deoptimization_env_; 592 Environment* pending_deoptimization_env_;
586 593
587 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); 594 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler);
588 }; 595 };
589 596
590 } // namespace dart 597 } // namespace dart
591 598
592 #endif // VM_FLOW_GRAPH_COMPILER_H_ 599 #endif // VM_FLOW_GRAPH_COMPILER_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698