OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
(...skipping 7182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7193 | 7193 |
7194 // Indicates that code for this function cannot be flushed. | 7194 // Indicates that code for this function cannot be flushed. |
7195 DECL_BOOLEAN_ACCESSORS(dont_flush) | 7195 DECL_BOOLEAN_ACCESSORS(dont_flush) |
7196 | 7196 |
7197 // Indicates that this function is a generator. | 7197 // Indicates that this function is a generator. |
7198 DECL_BOOLEAN_ACCESSORS(is_generator) | 7198 DECL_BOOLEAN_ACCESSORS(is_generator) |
7199 | 7199 |
7200 // Indicates that this function is an arrow function. | 7200 // Indicates that this function is an arrow function. |
7201 DECL_BOOLEAN_ACCESSORS(is_arrow) | 7201 DECL_BOOLEAN_ACCESSORS(is_arrow) |
7202 | 7202 |
| 7203 // Indicates that this function is a concise method. |
| 7204 DECL_BOOLEAN_ACCESSORS(is_concise_method) |
| 7205 |
| 7206 FunctionKind kind() const { |
| 7207 // TODO(arv): Update to handle concise generator methods. |
| 7208 if (is_arrow()) return FunctionKind::kArrowFunction; |
| 7209 if (is_generator()) return FunctionKind::kGeneratorFunction; |
| 7210 if (is_concise_method()) return FunctionKind::kConciseMethod; |
| 7211 return FunctionKind::kNormalFunction; |
| 7212 } |
| 7213 |
7203 // Indicates whether or not the code in the shared function support | 7214 // Indicates whether or not the code in the shared function support |
7204 // deoptimization. | 7215 // deoptimization. |
7205 inline bool has_deoptimization_support(); | 7216 inline bool has_deoptimization_support(); |
7206 | 7217 |
7207 // Enable deoptimization support through recompiled code. | 7218 // Enable deoptimization support through recompiled code. |
7208 void EnableDeoptimizationSupport(Code* recompiled); | 7219 void EnableDeoptimizationSupport(Code* recompiled); |
7209 | 7220 |
7210 // Disable (further) attempted optimization of all functions sharing this | 7221 // Disable (further) attempted optimization of all functions sharing this |
7211 // shared function info. | 7222 // shared function info. |
7212 void DisableOptimization(BailoutReason reason); | 7223 void DisableOptimization(BailoutReason reason); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7389 kNative, | 7400 kNative, |
7390 kInlineBuiltin, | 7401 kInlineBuiltin, |
7391 kBoundFunction, | 7402 kBoundFunction, |
7392 kIsAnonymous, | 7403 kIsAnonymous, |
7393 kNameShouldPrintAsAnonymous, | 7404 kNameShouldPrintAsAnonymous, |
7394 kIsFunction, | 7405 kIsFunction, |
7395 kDontCache, | 7406 kDontCache, |
7396 kDontFlush, | 7407 kDontFlush, |
7397 kIsGenerator, | 7408 kIsGenerator, |
7398 kIsArrow, | 7409 kIsArrow, |
| 7410 kIsConciseMethod, |
7399 kCompilerHintsCount // Pseudo entry | 7411 kCompilerHintsCount // Pseudo entry |
7400 }; | 7412 }; |
7401 | 7413 |
7402 class DeoptCountBits: public BitField<int, 0, 4> {}; | 7414 class DeoptCountBits: public BitField<int, 0, 4> {}; |
7403 class OptReenableTriesBits: public BitField<int, 4, 18> {}; | 7415 class OptReenableTriesBits: public BitField<int, 4, 18> {}; |
7404 class ICAgeBits: public BitField<int, 22, 8> {}; | 7416 class ICAgeBits: public BitField<int, 22, 8> {}; |
7405 | 7417 |
7406 class OptCountBits: public BitField<int, 0, 22> {}; | 7418 class OptCountBits: public BitField<int, 0, 22> {}; |
7407 class DisabledOptimizationReasonBits: public BitField<int, 22, 8> {}; | 7419 class DisabledOptimizationReasonBits: public BitField<int, 22, 8> {}; |
7408 | 7420 |
(...skipping 3781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11190 } else { | 11202 } else { |
11191 value &= ~(1 << bit_position); | 11203 value &= ~(1 << bit_position); |
11192 } | 11204 } |
11193 return value; | 11205 return value; |
11194 } | 11206 } |
11195 }; | 11207 }; |
11196 | 11208 |
11197 } } // namespace v8::internal | 11209 } } // namespace v8::internal |
11198 | 11210 |
11199 #endif // V8_OBJECTS_H_ | 11211 #endif // V8_OBJECTS_H_ |
OLD | NEW |