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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 1250563004: HydrogenCodeStubs consume stack arguments via descriptor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 5 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/code-stubs.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index b90f24dd8d59475ed0890b3c00eab4d4d33caddc..7ee424e7547af5f6e24f08b0b1d27913cc87a0da 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -48,7 +48,8 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
protected:
virtual HValue* BuildCodeStub() = 0;
- int GetParameterCount() const {
+ int GetParameterCount() const { return descriptor_.GetParameterCount(); }
+ int GetRegisterParameterCount() const {
return descriptor_.GetRegisterParameterCount();
}
HParameter* GetParameter(int parameter) {
@@ -138,6 +139,7 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
}
int param_count = GetParameterCount();
+ int register_param_count = GetRegisterParameterCount();
HEnvironment* start_environment = graph()->start_environment();
HBasicBlock* next_block = CreateBasicBlock(start_environment);
Goto(next_block);
@@ -148,11 +150,16 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
HInstruction* stack_parameter_count = NULL;
for (int i = 0; i < param_count; ++i) {
Representation r = GetParameterRepresentation(i);
- HParameter* param = Add<HParameter>(i,
- HParameter::REGISTER_PARAMETER, r);
+ HParameter* param;
+ if (i >= register_param_count) {
+ param = Add<HParameter>(i - register_param_count,
+ HParameter::STACK_PARAMETER, r);
+ } else {
+ param = Add<HParameter>(i, HParameter::REGISTER_PARAMETER, r);
+ }
start_environment->Bind(i, param);
parameters_[i] = param;
- if (IsParameterCountRegister(i)) {
+ if (i < register_param_count && IsParameterCountRegister(i)) {
param->set_type(HType::Smi());
stack_parameter_count = param;
arguments_length_ = stack_parameter_count;
@@ -161,7 +168,9 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
DCHECK(!runtime_stack_params || arguments_length_ != NULL);
if (!runtime_stack_params) {
- stack_parameter_count = graph()->GetConstantMinus1();
+ stack_parameter_count =
+ Add<HConstant>(param_count - register_param_count - 1);
+ // graph()->GetConstantMinus1();
arguments_length_ = graph()->GetConstant0();
}
« no previous file with comments | « src/code-stubs.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698