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

Unified Diff: src/crankshaft/hydrogen-instructions.h

Issue 2389133007: [crankshaft] Exclude context parameter from HCallWithDescriptor arguments. (Closed)
Patch Set: Rebasing Created 4 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/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-instructions.h
diff --git a/src/crankshaft/hydrogen-instructions.h b/src/crankshaft/hydrogen-instructions.h
index f65a1852b77d7a44e865000ffcc3ff01b48a4786..3b6bc48e16761ae504b322915bf9b9dbf6a7d7cd 100644
--- a/src/crankshaft/hydrogen-instructions.h
+++ b/src/crankshaft/hydrogen-instructions.h
@@ -2158,9 +2158,9 @@ class HCallWithDescriptor final : public HInstruction {
const Vector<HValue*>& operands,
TailCallMode syntactic_tail_call_mode = TailCallMode::kDisallow,
TailCallMode tail_call_mode = TailCallMode::kDisallow) {
- HCallWithDescriptor* res = new (zone)
- HCallWithDescriptor(target, argument_count, descriptor, operands,
- syntactic_tail_call_mode, tail_call_mode, zone);
+ HCallWithDescriptor* res = new (zone) HCallWithDescriptor(
+ context, target, argument_count, descriptor, operands,
+ syntactic_tail_call_mode, tail_call_mode, zone);
return res;
}
@@ -2200,21 +2200,24 @@ class HCallWithDescriptor final : public HInstruction {
CallInterfaceDescriptor descriptor() const { return descriptor_; }
- HValue* target() {
- return OperandAt(0);
+ HValue* target() { return OperandAt(0); }
+ HValue* context() { return OperandAt(1); }
+ HValue* parameter(int index) {
+ DCHECK_LT(index, GetParameterCount());
+ return OperandAt(index + 2);
}
std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
private:
// The argument count includes the receiver.
- HCallWithDescriptor(HValue* target, int argument_count,
+ HCallWithDescriptor(HValue* context, HValue* target, int argument_count,
CallInterfaceDescriptor descriptor,
const Vector<HValue*>& operands,
TailCallMode syntactic_tail_call_mode,
TailCallMode tail_call_mode, Zone* zone)
: descriptor_(descriptor),
- values_(GetParameterCount() + 1, zone), // +1 here is for target.
+ values_(GetParameterCount() + 2, zone), // +2 for context and target.
argument_count_(argument_count),
bit_field_(
TailCallModeField::encode(tail_call_mode) |
@@ -2223,6 +2226,7 @@ class HCallWithDescriptor final : public HInstruction {
// We can only tail call without any stack arguments.
DCHECK(tail_call_mode != TailCallMode::kAllow || argument_count == 0);
AddOperand(target, zone);
+ AddOperand(context, zone);
for (int i = 0; i < operands.length(); i++) {
AddOperand(operands[i], zone);
}
@@ -2235,9 +2239,7 @@ class HCallWithDescriptor final : public HInstruction {
SetOperandAt(values_.length() - 1, v);
}
- int GetParameterCount() const {
- return descriptor_.GetParameterCount() + 1; // +1 here is for context.
- }
+ int GetParameterCount() const { return descriptor_.GetParameterCount(); }
void InternalSetOperandAt(int index, HValue* value) final {
values_[index] = value;
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698