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

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

Issue 1688283003: [Interpreter] Implements calls through CallICStub in the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: removes an unused label declaration. Created 4 years, 10 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.cc » ('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 7103c7217812395ff47fbcd78f3212d3ad10d355..6b764bf60ba343cd4cc9ea9ac2014aa804e0753a 100644
--- a/src/interpreter/bytecode-array-builder.cc
+++ b/src/interpreter/bytecode-array-builder.cc
@@ -1059,12 +1059,10 @@ void BytecodeArrayBuilder::EnsureReturn(FunctionLiteral* literal) {
}
}
-BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable,
- Register receiver_args,
- size_t receiver_args_count,
- int feedback_slot,
- TailCallMode tail_call_mode) {
- Bytecode bytecode = BytecodeForCall(tail_call_mode);
+BytecodeArrayBuilder& BytecodeArrayBuilder::CallIC(
+ Register callable, Register receiver_args, size_t receiver_args_count,
+ int feedback_slot, TailCallMode tail_call_mode) {
+ Bytecode bytecode = BytecodeForCallIC(tail_call_mode);
if (FitsInReg8Operand(callable) && FitsInReg8Operand(receiver_args) &&
FitsInIdx8Operand(receiver_args_count) &&
FitsInIdx8Operand(feedback_slot)) {
@@ -1085,6 +1083,26 @@ BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable,
return *this;
}
+BytecodeArrayBuilder& BytecodeArrayBuilder::Call(Register callable,
+ Register receiver_args,
+ size_t receiver_args_count,
+ TailCallMode tail_call_mode) {
+ Bytecode bytecode = BytecodeForCall(tail_call_mode);
+ if (FitsInReg8Operand(callable) && FitsInReg8Operand(receiver_args) &&
+ FitsInIdx8Operand(receiver_args_count)) {
+ Output(bytecode, callable.ToRawOperand(), receiver_args.ToRawOperand(),
+ static_cast<uint8_t>(receiver_args_count));
+ } else if (FitsInReg16Operand(callable) &&
+ FitsInReg16Operand(receiver_args) &&
+ FitsInIdx16Operand(receiver_args_count)) {
+ bytecode = BytecodeForWideOperands(bytecode);
+ Output(bytecode, callable.ToRawOperand(), receiver_args.ToRawOperand(),
+ static_cast<uint16_t>(receiver_args_count));
+ } else {
+ UNIMPLEMENTED();
+ }
+ return *this;
+}
BytecodeArrayBuilder& BytecodeArrayBuilder::New(Register constructor,
Register first_arg,
size_t arg_count) {
@@ -1426,6 +1444,10 @@ Bytecode BytecodeArrayBuilder::BytecodeForCompareOperation(Token::Value op) {
// static
Bytecode BytecodeArrayBuilder::BytecodeForWideOperands(Bytecode bytecode) {
switch (bytecode) {
+ case Bytecode::kCallIC:
+ return Bytecode::kCallICWide;
+ case Bytecode::kTailCallIC:
+ return Bytecode::kTailCallICWide;
case Bytecode::kCall:
return Bytecode::kCallWide;
case Bytecode::kTailCall:
@@ -1570,6 +1592,19 @@ Bytecode BytecodeArrayBuilder::BytecodeForDelete(LanguageMode language_mode) {
}
// static
+Bytecode BytecodeArrayBuilder::BytecodeForCallIC(TailCallMode tail_call_mode) {
+ switch (tail_call_mode) {
+ case TailCallMode::kDisallow:
+ return Bytecode::kCallIC;
+ case TailCallMode::kAllow:
+ return Bytecode::kTailCallIC;
+ default:
+ UNREACHABLE();
+ }
+ return static_cast<Bytecode>(-1);
+}
+
+// static
Bytecode BytecodeArrayBuilder::BytecodeForCall(TailCallMode tail_call_mode) {
switch (tail_call_mode) {
case TailCallMode::kDisallow:
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/interpreter/bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698