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

Unified Diff: src/hydrogen-instructions.h

Issue 1211333003: Make context register implicit for CallInterfaceDescriptors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Platform ports Created 5 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
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index c876bd50fafd803c19578bb898440352d5689e7b..160fb34bb39aea7dd487c2dd38dd5b179bcd11af 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -2261,9 +2261,9 @@ class HCallWithDescriptor final : public HInstruction {
CallInterfaceDescriptor descriptor,
const Vector<HValue*>& operands,
CallMode call_mode = NORMAL_CALL) {
- DCHECK(operands.length() == descriptor.GetEnvironmentLength());
HCallWithDescriptor* res = new (zone) HCallWithDescriptor(
target, argument_count, descriptor, operands, call_mode, zone);
+ DCHECK(operands.length() == res->GetParameterCount());
return res;
}
@@ -2271,11 +2271,12 @@ class HCallWithDescriptor final : public HInstruction {
HValue* OperandAt(int index) const final { return values_[index]; }
Representation RequiredInputRepresentation(int index) final {
- if (index == 0) {
+ if (index == 0 || index == 1) {
+ // Target + context
return Representation::Tagged();
} else {
- int par_index = index - 1;
- DCHECK(par_index < descriptor_.GetEnvironmentLength());
+ int par_index = index - 2;
+ DCHECK(par_index < GetParameterCount());
return RepresentationFromType(descriptor_.GetParameterType(par_index));
}
}
@@ -2307,7 +2308,7 @@ class HCallWithDescriptor final : public HInstruction {
const Vector<HValue*>& operands, CallMode call_mode,
Zone* zone)
: descriptor_(descriptor),
- values_(descriptor.GetEnvironmentLength() + 1, zone),
+ values_(GetParameterCount() + 1, zone),
argument_count_(argument_count),
call_mode_(call_mode) {
// We can only tail call without any stack arguments.
@@ -2325,6 +2326,10 @@ class HCallWithDescriptor final : public HInstruction {
SetOperandAt(values_.length() - 1, v);
}
+ int GetParameterCount() const {
+ return descriptor_.GetRegisterParameterCount() + 1;
+ }
+
void InternalSetOperandAt(int index, HValue* value) final {
values_[index] = value;
}
« src/code-stubs.h ('K') | « src/hydrogen.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698