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

Unified Diff: src/interpreter/bytecode-array-builder.cc

Issue 1412953007: [Interpreter] Fill out function prologue support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 2 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-array-builder.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-array-builder.cc
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc
index 7fb5e949a11b815d860618265f8fed5a43124264..26b5414b3a6b79305c066696a13cc0ef1a6622c9 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -389,6 +389,17 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::CreateClosure(
}
+BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArguments(
+ CreateArgumentsType type) {
+ // TODO(rmcilroy): Consider passing the type as a bytecode operand rather
+ // than having two different bytecodes once we have better support for
+ // branches in the InterpreterAssembler.
+ Bytecode bytecode = BytecodeForCreateArguments(type);
+ Output(bytecode);
+ return *this;
+}
+
+
BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral(
int literal_index, Register flags) {
if (FitsInIdx8Operand(literal_index)) {
@@ -990,6 +1001,21 @@ Bytecode BytecodeArrayBuilder::BytecodeForStoreGlobal(
// static
+Bytecode BytecodeArrayBuilder::BytecodeForCreateArguments(
+ CreateArgumentsType type) {
+ switch (type) {
+ case CreateArgumentsType::kMappedArguments:
+ return Bytecode::kCreateMappedArguments;
+ case CreateArgumentsType::kUnmappedArguments:
+ return Bytecode::kCreateUnmappedArguments;
+ default:
+ UNREACHABLE();
+ }
+ return static_cast<Bytecode>(-1);
+}
+
+
+// static
bool BytecodeArrayBuilder::FitsInIdx8Operand(int value) {
return kMinUInt8 <= value && value <= kMaxUInt8;
}
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698