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

Unified Diff: src/interpreter/bytecodes.cc

Issue 2113613002: [Interpereter] Inline FastNewClosure into CreateClosure bytecode handler (Closed) Base URL: ssh://rmcilroy.lon.corp.google.com///usr/local/google/code/v8_full/v8@int_context
Patch Set: Rebaseline bytecode expectations Created 4 years, 6 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/bytecodes.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecodes.cc
diff --git a/src/interpreter/bytecodes.cc b/src/interpreter/bytecodes.cc
index 5e44588cba196bbbcc039a8ad658e19e1ccb63e4..543c9c5075effa0ee8c750d653b52b9e75e4bce7 100644
--- a/src/interpreter/bytecodes.cc
+++ b/src/interpreter/bytecodes.cc
@@ -7,6 +7,7 @@
#include <iomanip>
#include "src/base/bits.h"
+#include "src/code-stubs.h"
#include "src/frames.h"
#include "src/interpreter/bytecode-traits.h"
#include "src/interpreter/interpreter.h"
@@ -916,6 +917,33 @@ std::string Register::ToString(int parameter_count) {
}
}
+// 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/bytecodes.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698