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_COMPILER_JS_OPERATOR_H_ | 5 #ifndef V8_COMPILER_JS_OPERATOR_H_ |
6 #define V8_COMPILER_JS_OPERATOR_H_ | 6 #define V8_COMPILER_JS_OPERATOR_H_ |
7 | 7 |
8 #include "src/runtime/runtime.h" | 8 #include "src/runtime/runtime.h" |
9 #include "src/unique.h" | 9 #include "src/unique.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 namespace compiler { | 13 namespace compiler { |
14 | 14 |
15 // Forward declarations. | 15 // Forward declarations. |
16 class Operator; | 16 class Operator; |
17 struct JSOperatorGlobalCache; | 17 struct JSOperatorGlobalCache; |
18 | 18 |
19 | 19 |
20 // Defines the arity and the call flags for a JavaScript function call. This is | 20 // Defines the arity and the call flags for a JavaScript function call. This is |
21 // used as a parameter by JSCallFunction operators. | 21 // used as a parameter by JSCallFunction operators. |
22 class CallFunctionParameters final { | 22 class CallFunctionParameters final { |
23 public: | 23 public: |
24 CallFunctionParameters(size_t arity, CallFunctionFlags flags, | 24 CallFunctionParameters(size_t arity, CallFunctionFlags flags, |
25 LanguageMode language_mode) | 25 LanguageMode language_mode) |
26 : bit_field_(ArityField::encode(arity) | FlagsField::encode(flags) | | 26 : bit_field_(ArityField::encode(static_cast<unsigned>(arity)) | |
| 27 FlagsField::encode(flags) | |
27 LanguageModeField::encode(language_mode)) {} | 28 LanguageModeField::encode(language_mode)) {} |
28 | 29 |
29 size_t arity() const { return ArityField::decode(bit_field_); } | 30 size_t arity() const { return ArityField::decode(bit_field_); } |
30 CallFunctionFlags flags() const { return FlagsField::decode(bit_field_); } | 31 CallFunctionFlags flags() const { return FlagsField::decode(bit_field_); } |
31 LanguageMode language_mode() const { | 32 LanguageMode language_mode() const { |
32 return LanguageModeField::decode(bit_field_); | 33 return LanguageModeField::decode(bit_field_); |
33 } | 34 } |
34 | 35 |
35 bool operator==(CallFunctionParameters const& that) const { | 36 bool operator==(CallFunctionParameters const& that) const { |
36 return this->bit_field_ == that.bit_field_; | 37 return this->bit_field_ == that.bit_field_; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 Zone* const zone_; | 334 Zone* const zone_; |
334 | 335 |
335 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); | 336 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); |
336 }; | 337 }; |
337 | 338 |
338 } // namespace compiler | 339 } // namespace compiler |
339 } // namespace internal | 340 } // namespace internal |
340 } // namespace v8 | 341 } // namespace v8 |
341 | 342 |
342 #endif // V8_COMPILER_JS_OPERATOR_H_ | 343 #endif // V8_COMPILER_JS_OPERATOR_H_ |
OLD | NEW |