equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
37 class LIREmitter; |
37 class LIREmitter; |
38 class Invoke; |
38 class Invoke; |
39 class SwitchRange; |
39 class SwitchRange; |
40 class LIRItem; |
40 class LIRItem; |
41 |
41 |
42 define_array(LIRItemArray, LIRItem*) |
42 typedef GrowableArray<LIRItem*> LIRItemList; |
43 define_stack(LIRItemList, LIRItemArray) |
|
44 |
43 |
45 class SwitchRange: public CompilationResourceObj { |
44 class SwitchRange: public CompilationResourceObj { |
46 private: |
45 private: |
47 int _low_key; |
46 int _low_key; |
48 int _high_key; |
47 int _high_key; |
54 int high_key() const { return _high_key; } |
53 int high_key() const { return _high_key; } |
55 int low_key() const { return _low_key; } |
54 int low_key() const { return _low_key; } |
56 BlockBegin* sux() const { return _sux; } |
55 BlockBegin* sux() const { return _sux; } |
57 }; |
56 }; |
58 |
57 |
59 define_array(SwitchRangeArray, SwitchRange*) |
58 typedef GrowableArray<SwitchRange*> SwitchRangeArray; |
60 define_stack(SwitchRangeList, SwitchRangeArray) |
59 typedef GrowableArray<SwitchRange*> SwitchRangeList; |
61 |
|
62 |
60 |
63 class ResolveNode; |
61 class ResolveNode; |
64 |
62 |
65 define_array(NodeArray, ResolveNode*); |
63 typedef GrowableArray<ResolveNode*> NodeList; |
66 define_stack(NodeList, NodeArray); |
|
67 |
|
68 |
64 |
69 // Node objects form a directed graph of LIR_Opr |
65 // Node objects form a directed graph of LIR_Opr |
70 // Edges between Nodes represent moves from one Node to its destinations |
66 // Edges between Nodes represent moves from one Node to its destinations |
71 class ResolveNode: public CompilationResourceObj { |
67 class ResolveNode: public CompilationResourceObj { |
72 private: |
68 private: |
84 , _start_node(false) {}; |
80 , _start_node(false) {}; |
85 |
81 |
86 // accessors |
82 // accessors |
87 LIR_Opr operand() const { return _operand; } |
83 LIR_Opr operand() const { return _operand; } |
88 int no_of_destinations() const { return _destinations.length(); } |
84 int no_of_destinations() const { return _destinations.length(); } |
89 ResolveNode* destination_at(int i) { return _destinations[i]; } |
85 ResolveNode* destination_at(int i) { return _destinations.at(i); } |
90 bool assigned() const { return _assigned; } |
86 bool assigned() const { return _assigned; } |
91 bool visited() const { return _visited; } |
87 bool visited() const { return _visited; } |
92 bool start_node() const { return _start_node; } |
88 bool start_node() const { return _start_node; } |
93 |
89 |
94 // modifiers |
90 // modifiers |