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

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

Issue 298963006: Change COMPILE_ASSERT to take only one argument and use it in more places. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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/assembler_x64.cc ('k') | runtime/vm/locations.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 5454 matching lines...) Expand 10 before | Expand all | Expand 10 after
5465 5465
5466 enum Kind { 5466 enum Kind {
5467 kNoneAlias = -1, 5467 kNoneAlias = -1,
5468 kCurrentContextAlias = 0, 5468 kCurrentContextAlias = 0,
5469 kUnknownIndexAlias = 1, 5469 kUnknownIndexAlias = 1,
5470 kFieldAlias = 2, 5470 kFieldAlias = 2,
5471 kVMFieldAlias = 3, 5471 kVMFieldAlias = 3,
5472 kConstantIndex = 4, 5472 kConstantIndex = 4,
5473 kNumKinds = kConstantIndex + 1 5473 kNumKinds = kConstantIndex + 1
5474 }; 5474 };
5475 COMPILE_ASSERT(kNumKinds < ((1 << kBitsForKind) - 1), InvalidBitFieldSize); 5475 COMPILE_ASSERT(kNumKinds < ((1 << kBitsForKind) - 1));
5476 5476
5477 explicit Alias(intptr_t alias) : alias_(alias) { } 5477 explicit Alias(intptr_t alias) : alias_(alias) { }
5478 5478
5479 Alias(Kind kind, uword payload) 5479 Alias(Kind kind, uword payload)
5480 : alias_(KindField::encode(kind) | PayloadField::encode(payload)) { } 5480 : alias_(KindField::encode(kind) | PayloadField::encode(payload)) { }
5481 5481
5482 uword payload() const { 5482 uword payload() const {
5483 return PayloadField::decode(alias_); 5483 return PayloadField::decode(alias_);
5484 } 5484 }
5485 5485
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after
7578 } 7578 }
7579 } 7579 }
7580 7580
7581 7581
7582 class CSEInstructionMap : public ValueObject { 7582 class CSEInstructionMap : public ValueObject {
7583 public: 7583 public:
7584 // Right now CSE and LICM track a single effect: possible externalization of 7584 // Right now CSE and LICM track a single effect: possible externalization of
7585 // strings. 7585 // strings.
7586 // Other effects like modifications of fields are tracked in a separate load 7586 // Other effects like modifications of fields are tracked in a separate load
7587 // forwarding pass via Alias structure. 7587 // forwarding pass via Alias structure.
7588 COMPILE_ASSERT(EffectSet::kLastEffect == 1, single_effect_is_tracked); 7588 COMPILE_ASSERT(EffectSet::kLastEffect == 1);
7589 7589
7590 CSEInstructionMap() : independent_(), dependent_() { } 7590 CSEInstructionMap() : independent_(), dependent_() { }
7591 explicit CSEInstructionMap(const CSEInstructionMap& other) 7591 explicit CSEInstructionMap(const CSEInstructionMap& other)
7592 : ValueObject(), 7592 : ValueObject(),
7593 independent_(other.independent_), 7593 independent_(other.independent_),
7594 dependent_(other.dependent_) { 7594 dependent_(other.dependent_) {
7595 } 7595 }
7596 7596
7597 void RemoveAffected(EffectSet effects) { 7597 void RemoveAffected(EffectSet effects) {
7598 if (!effects.IsNone()) { 7598 if (!effects.IsNone()) {
(...skipping 2247 matching lines...) Expand 10 before | Expand all | Expand 10 after
9846 } 9846 }
9847 9847
9848 // Insert materializations at environment uses. 9848 // Insert materializations at environment uses.
9849 for (intptr_t i = 0; i < exits.length(); i++) { 9849 for (intptr_t i = 0; i < exits.length(); i++) {
9850 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); 9850 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots);
9851 } 9851 }
9852 } 9852 }
9853 9853
9854 9854
9855 } // namespace dart 9855 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/locations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698