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

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

Issue 384403002: StubCallInterfaceDescriptor takes a context register. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More refinements. Created 6 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
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index bdd168b690fb79d57f4333a72c6e2397a34b4ba0..53406913c6b751e0a496a5134bdc66c108feb02f 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -39,7 +39,8 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
info_(stub, isolate),
context_(NULL) {
descriptor_ = stub->GetInterfaceDescriptor();
- parameters_.Reset(new HParameter*[descriptor_->register_param_count()]);
+ int parameter_count = descriptor_->register_param_count() - 1;
danno 2014/07/16 13:19:59 GetEnvironmentParameterCount
mvstanton 2014/07/17 09:04:04 Done.
+ parameters_.Reset(new HParameter*[parameter_count]);
}
virtual bool BuildGraph();
@@ -116,7 +117,9 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
isolate()->GetHTracer()->TraceCompilation(&info_);
}
- int param_count = descriptor_->register_param_count();
+ // Every descriptor has a context register parameter, which we don't need
+ // to include here.
+ int param_count = descriptor_->register_param_count() - 1;
danno 2014/07/16 13:19:59 Use GetEnvironmentLength(), then comment is unnece
mvstanton 2014/07/17 09:04:04 Done. (but I used GetEnvironmentParameterCount() a
HEnvironment* start_environment = graph()->start_environment();
HBasicBlock* next_block = CreateBasicBlock(start_environment);
Goto(next_block);
@@ -126,11 +129,13 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
bool runtime_stack_params = descriptor_->stack_parameter_count().is_valid();
HInstruction* stack_parameter_count = NULL;
for (int i = 0; i < param_count; ++i) {
- Representation r = descriptor_->GetRegisterParameterRepresentation(i);
- HParameter* param = Add<HParameter>(i, HParameter::REGISTER_PARAMETER, r);
+ int parameter_index = i+1;
danno 2014/07/16 13:19:59 nit: make sure to clang format your patch. Comment
mvstanton 2014/07/17 09:04:04 I got rid of this whole notion of "convert a param
+ Representation r = descriptor_->GetParameterRepresentation(parameter_index);
+ HParameter* param = Add<HParameter>(parameter_index,
+ HParameter::REGISTER_PARAMETER, r);
start_environment->Bind(i, param);
parameters_[i] = param;
- if (descriptor_->IsParameterCountRegister(i)) {
+ if (descriptor_->IsParameterCountRegister(parameter_index)) {
param->set_type(HType::Smi());
stack_parameter_count = param;
arguments_length_ = stack_parameter_count;

Powered by Google App Engine
This is Rietveld 408576698