OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_EFFECTS_H_ | 5 #ifndef V8_EFFECTS_H_ |
6 #define V8_EFFECTS_H_ | 6 #define V8_EFFECTS_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/types.h" | 10 #include "src/types.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // merges into a previous effect, i.e., type bounds are merged. Alternative | 26 // merges into a previous effect, i.e., type bounds are merged. Alternative |
27 // composition always merges bounds. It yields a possible effect if at least | 27 // composition always merges bounds. It yields a possible effect if at least |
28 // one was only possible. | 28 // one was only possible. |
29 struct Effect { | 29 struct Effect { |
30 enum Modality { POSSIBLE, DEFINITE }; | 30 enum Modality { POSSIBLE, DEFINITE }; |
31 | 31 |
32 Modality modality; | 32 Modality modality; |
33 Bounds bounds; | 33 Bounds bounds; |
34 | 34 |
35 Effect() : modality(DEFINITE) {} | 35 Effect() : modality(DEFINITE) {} |
36 Effect(Bounds b, Modality m = DEFINITE) : modality(m), bounds(b) {} | 36 explicit Effect(Bounds b, Modality m = DEFINITE) : modality(m), bounds(b) {} |
37 | 37 |
38 // The unknown effect. | 38 // The unknown effect. |
39 static Effect Unknown(Zone* zone) { | 39 static Effect Unknown(Zone* zone) { |
40 return Effect(Bounds::Unbounded(zone), POSSIBLE); | 40 return Effect(Bounds::Unbounded(zone), POSSIBLE); |
41 } | 41 } |
42 | 42 |
43 static Effect Forget(Zone* zone) { | 43 static Effect Forget(Zone* zone) { |
44 return Effect(Bounds::Unbounded(zone), DEFINITE); | 44 return Effect(Bounds::Unbounded(zone), DEFINITE); |
45 } | 45 } |
46 | 46 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 NestedEffects result = *this; | 327 NestedEffects result = *this; |
328 result.pop(); | 328 result.pop(); |
329 DCHECK(!this->is_empty()); | 329 DCHECK(!this->is_empty()); |
330 return result; | 330 return result; |
331 } | 331 } |
332 }; | 332 }; |
333 | 333 |
334 } } // namespace v8::internal | 334 } } // namespace v8::internal |
335 | 335 |
336 #endif // V8_EFFECTS_H_ | 336 #endif // V8_EFFECTS_H_ |
OLD | NEW |