Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: src/interpreter/bytecode-flags.cc

Issue 2149093002: Reland "[interpreter] Reduce dependencies in bytecodes.{h,cc}" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecode-flags.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-flags.cc
diff --git a/src/interpreter/bytecode-flags.cc b/src/interpreter/bytecode-flags.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9b25dbd230959d2f330f93651725eeca2df966d8
--- /dev/null
+++ b/src/interpreter/bytecode-flags.cc
@@ -0,0 +1,42 @@
+// 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
« no previous file with comments | « src/interpreter/bytecode-flags.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698