Home | History | Annotate | Download | only in interpreter
      1 // Copyright 2016 the V8 project authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef V8_INTERPRETER_BYTECODE_FLAGS_H_
      6 #define V8_INTERPRETER_BYTECODE_FLAGS_H_
      7 
      8 #include "src/utils.h"
      9 
     10 namespace v8 {
     11 namespace internal {
     12 namespace interpreter {
     13 
     14 class CreateArrayLiteralFlags {
     15  public:
     16   class FlagsBits : public BitField8<int, 0, 3> {};
     17   class FastShallowCloneBit : public BitField8<bool, FlagsBits::kNext, 1> {};
     18 
     19   static uint8_t Encode(bool use_fast_shallow_clone, int runtime_flags);
     20 
     21  private:
     22   DISALLOW_IMPLICIT_CONSTRUCTORS(CreateArrayLiteralFlags);
     23 };
     24 
     25 class CreateObjectLiteralFlags {
     26  public:
     27   class FlagsBits : public BitField8<int, 0, 3> {};
     28   class FastClonePropertiesCountBits
     29       : public BitField8<int, FlagsBits::kNext, 3> {};
     30 
     31   static uint8_t Encode(bool fast_clone_supported, int properties_count,
     32                         int runtime_flags);
     33 
     34  private:
     35   DISALLOW_IMPLICIT_CONSTRUCTORS(CreateObjectLiteralFlags);
     36 };
     37 
     38 class CreateClosureFlags {
     39  public:
     40   class PretenuredBit : public BitField8<bool, 0, 1> {};
     41   class FastNewClosureBit : public BitField8<bool, PretenuredBit::kNext, 1> {};
     42 
     43   static uint8_t Encode(bool pretenure, bool is_function_scope);
     44 
     45  private:
     46   DISALLOW_IMPLICIT_CONSTRUCTORS(CreateClosureFlags);
     47 };
     48 
     49 }  // namespace interpreter
     50 }  // namespace internal
     51 }  // namespace v8
     52 
     53 #endif  // V8_INTERPRETER_BYTECODE_FLAGS_H_
     54