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

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

Issue 12490013: Deoptimizer support for hydrogen stubs that accept a variable number of arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Deoptimizer and BuildGraph() support for variable argument stubs Created 7 years, 9 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.h » ('j') | src/deoptimizer.cc » ('J')
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 bb8bfe3fdc4447e90683ffc8df0cf77514ae1cd5..026e777901fa3e2e1b8bc9fae67e806c79a6d08b 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -124,11 +124,13 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
parameters_[i] = param;
}
+ HInstruction* stack_pop_count;
danno 2013/03/20 21:07:33 nit: Can you define this down where you initially
mvstanton 2013/03/21 11:47:35 Done.
HInstruction* stack_parameter_count;
if (descriptor_->stack_parameter_count_ != NULL) {
ASSERT(descriptor_->environment_length() == (param_count + 1));
stack_parameter_count = new(zone) HParameter(param_count,
- HParameter::REGISTER_PARAMETER);
+ HParameter::REGISTER_PARAMETER,
+ Representation::Integer32());
// it's essential to bind this value to the environment in case of deopt
start_environment->Bind(param_count, stack_parameter_count);
AddInstruction(stack_parameter_count);
@@ -139,6 +141,8 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
arguments_length_ = graph()->GetConstant0();
}
+ stack_pop_count = stack_parameter_count;
+
context_ = new(zone) HContext();
AddInstruction(context_);
start_environment->BindContext(context_);
@@ -146,13 +150,25 @@ bool CodeStubGraphBuilderBase::BuildGraph() {
AddSimulate(BailoutId::StubEntry());
HValue* return_value = BuildCodeStub();
+
+ // We might have extra expressions to pop from the stack in addition to the
+ // arguments above
+ if (descriptor_->acting_as_js_function_) {
+ HInstruction* amount = graph()->GetConstant1();
+ stack_pop_count = AddInstruction(
+ HAdd::New(zone, context_, stack_parameter_count, amount));
+ stack_pop_count->ChangeRepresentation(Representation::Integer32());
+ stack_pop_count->ClearFlag(HValue::kCanOverflow);
+ }
+
HReturn* hreturn_instruction = new(zone) HReturn(return_value,
context_,
- stack_parameter_count);
+ stack_pop_count);
current_block()->Finish(hreturn_instruction);
return true;
}
+
template <class Stub>
class CodeStubGraphBuilder: public CodeStubGraphBuilderBase {
public:
« no previous file with comments | « src/code-stubs.cc ('k') | src/deoptimizer.h » ('j') | src/deoptimizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698