OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 | 126 |
127 HInstruction* stack_parameter_count; | 127 HInstruction* stack_parameter_count; |
128 if (descriptor_->stack_parameter_count_ != NULL) { | 128 if (descriptor_->stack_parameter_count_ != NULL) { |
129 ASSERT(descriptor_->environment_length() == (param_count + 1)); | 129 ASSERT(descriptor_->environment_length() == (param_count + 1)); |
130 stack_parameter_count = new(zone) HParameter(param_count, | 130 stack_parameter_count = new(zone) HParameter(param_count, |
131 HParameter::REGISTER_PARAMETER); | 131 HParameter::REGISTER_PARAMETER); |
132 // it's essential to bind this value to the environment in case of deopt | 132 // it's essential to bind this value to the environment in case of deopt |
133 start_environment->Bind(param_count, stack_parameter_count); | 133 start_environment->Bind(param_count, stack_parameter_count); |
134 AddInstruction(stack_parameter_count); | 134 AddInstruction(stack_parameter_count); |
| 135 arguments_length_ = stack_parameter_count; |
135 } else { | 136 } else { |
136 ASSERT(descriptor_->environment_length() == param_count); | 137 ASSERT(descriptor_->environment_length() == param_count); |
137 stack_parameter_count = AddInstruction(new(zone) | 138 stack_parameter_count = graph()->GetConstantMinus1(); |
138 HConstant(-1, Representation::Integer32())); | 139 arguments_length_ = graph()->GetConstant0(); |
139 } | 140 } |
140 | 141 |
141 arguments_length_ = stack_parameter_count; | |
142 | |
143 context_ = new(zone) HContext(); | 142 context_ = new(zone) HContext(); |
144 AddInstruction(context_); | 143 AddInstruction(context_); |
145 start_environment->BindContext(context_); | 144 start_environment->BindContext(context_); |
146 | 145 |
147 AddSimulate(BailoutId::StubEntry()); | 146 AddSimulate(BailoutId::StubEntry()); |
148 | 147 |
149 HValue* return_value = BuildCodeStub(); | 148 HValue* return_value = BuildCodeStub(); |
150 HReturn* hreturn_instruction = new(zone) HReturn(return_value, | 149 HReturn* hreturn_instruction = new(zone) HReturn(return_value, |
151 context_, | 150 context_, |
152 stack_parameter_count); | 151 stack_parameter_count); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } | 375 } |
377 | 376 |
378 | 377 |
379 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() { | 378 Handle<Code> ArrayNArgumentsConstructorStub::GenerateCode() { |
380 CodeStubGraphBuilder<ArrayNArgumentsConstructorStub> builder(this); | 379 CodeStubGraphBuilder<ArrayNArgumentsConstructorStub> builder(this); |
381 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); | 380 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); |
382 return chunk->Codegen(Code::COMPILED_STUB); | 381 return chunk->Codegen(Code::COMPILED_STUB); |
383 } | 382 } |
384 | 383 |
385 } } // namespace v8::internal | 384 } } // namespace v8::internal |
OLD | NEW |