Sha256: a5bce87efe29273982595db42d927ed6cb9cf30f94eb7c18f6b2842eb0b9840e

Contents?: true

Size: 1.34 KB

Versions: 4

Compression:

Stored size: 1.34 KB

Contents

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/interpreter/bytecode-flags.h"

#include "src/code-stubs.h"

namespace v8 {
namespace internal {
namespace interpreter {

// static
uint8_t CreateObjectLiteralFlags::Encode(bool fast_clone_supported,
                                         int properties_count,
                                         int runtime_flags) {
  uint8_t result = FlagsBits::encode(runtime_flags);
  if (fast_clone_supported) {
    STATIC_ASSERT(
        FastCloneShallowObjectStub::kMaximumClonedProperties <=
        1 << CreateObjectLiteralFlags::FastClonePropertiesCountBits::kShift);
    DCHECK_LE(properties_count,
              FastCloneShallowObjectStub::kMaximumClonedProperties);
    result |= CreateObjectLiteralFlags::FastClonePropertiesCountBits::encode(
        properties_count);
  }
  return result;
}

// static
uint8_t CreateClosureFlags::Encode(bool pretenure, bool is_function_scope) {
  uint8_t result = PretenuredBit::encode(pretenure);
  if (!FLAG_always_opt && !FLAG_prepare_always_opt &&
      pretenure == NOT_TENURED && is_function_scope) {
    result |= FastNewClosureBit::encode(true);
  }
  return result;
}

}  // namespace interpreter
}  // namespace internal
}  // namespace v8

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
node-compiler-0.9.1 vendor/node/deps/v8/src/interpreter/bytecode-flags.cc
node-compiler-0.9.0 vendor/node-v7.2.1/deps/v8/src/interpreter/bytecode-flags.cc
node-compiler-0.8.0 vendor/node-v7.2.0/deps/v8/src/interpreter/bytecode-flags.cc
node-compiler-0.7.0 vendor/node-v7.1.0/deps/v8/src/interpreter/bytecode-flags.cc