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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 graph()->set_undefined_constant(undefined_constant); | 155 graph()->set_undefined_constant(undefined_constant); |
156 | 156 |
157 for (int i = 0; i < param_count; ++i) { | 157 for (int i = 0; i < param_count; ++i) { |
158 HParameter* param = | 158 HParameter* param = |
159 Add<HParameter>(i, HParameter::REGISTER_PARAMETER); | 159 Add<HParameter>(i, HParameter::REGISTER_PARAMETER); |
160 start_environment->Bind(i, param); | 160 start_environment->Bind(i, param); |
161 parameters_[i] = param; | 161 parameters_[i] = param; |
162 } | 162 } |
163 | 163 |
164 HInstruction* stack_parameter_count; | 164 HInstruction* stack_parameter_count; |
165 if (descriptor_->stack_parameter_count_ != NULL) { | 165 if (descriptor_->stack_parameter_count_.is_valid()) { |
166 ASSERT(descriptor_->environment_length() == (param_count + 1)); | 166 ASSERT(descriptor_->environment_length() == (param_count + 1)); |
167 stack_parameter_count = New<HParameter>(param_count, | 167 stack_parameter_count = New<HParameter>(param_count, |
168 HParameter::REGISTER_PARAMETER, | 168 HParameter::REGISTER_PARAMETER, |
169 Representation::Integer32()); | 169 Representation::Integer32()); |
170 stack_parameter_count->set_type(HType::Smi()); | 170 stack_parameter_count->set_type(HType::Smi()); |
171 // It's essential to bind this value to the environment in case of deopt. | 171 // It's essential to bind this value to the environment in case of deopt. |
172 AddInstruction(stack_parameter_count); | 172 AddInstruction(stack_parameter_count); |
173 start_environment->Bind(param_count, stack_parameter_count); | 173 start_environment->Bind(param_count, stack_parameter_count); |
174 arguments_length_ = stack_parameter_count; | 174 arguments_length_ = stack_parameter_count; |
175 } else { | 175 } else { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 CodeStubInterfaceDescriptor* descriptor = | 291 CodeStubInterfaceDescriptor* descriptor = |
292 isolate->code_stub_interface_descriptor(major_key); | 292 isolate->code_stub_interface_descriptor(major_key); |
293 if (descriptor->register_param_count_ < 0) { | 293 if (descriptor->register_param_count_ < 0) { |
294 stub->InitializeInterfaceDescriptor(isolate, descriptor); | 294 stub->InitializeInterfaceDescriptor(isolate, descriptor); |
295 } | 295 } |
296 | 296 |
297 // If we are uninitialized we can use a light-weight stub to enter | 297 // If we are uninitialized we can use a light-weight stub to enter |
298 // the runtime that is significantly faster than using the standard | 298 // the runtime that is significantly faster than using the standard |
299 // stub-failure deopt mechanism. | 299 // stub-failure deopt mechanism. |
300 if (stub->IsUninitialized() && descriptor->has_miss_handler()) { | 300 if (stub->IsUninitialized() && descriptor->has_miss_handler()) { |
301 ASSERT(descriptor->stack_parameter_count_ == NULL); | 301 ASSERT(!descriptor->stack_parameter_count_.is_valid()); |
302 return stub->GenerateLightweightMissCode(isolate); | 302 return stub->GenerateLightweightMissCode(isolate); |
303 } | 303 } |
304 ElapsedTimer timer; | 304 ElapsedTimer timer; |
305 if (FLAG_profile_hydrogen_code_stub_compilation) { | 305 if (FLAG_profile_hydrogen_code_stub_compilation) { |
306 timer.Start(); | 306 timer.Start(); |
307 } | 307 } |
308 CodeStubGraphBuilder<Stub> builder(isolate, stub); | 308 CodeStubGraphBuilder<Stub> builder(isolate, stub); |
309 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); | 309 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); |
310 Handle<Code> code = chunk->Codegen(); | 310 Handle<Code> code = chunk->Codegen(); |
311 if (FLAG_profile_hydrogen_code_stub_compilation) { | 311 if (FLAG_profile_hydrogen_code_stub_compilation) { |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 return js_function; | 1242 return js_function; |
1243 } | 1243 } |
1244 | 1244 |
1245 | 1245 |
1246 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { | 1246 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { |
1247 return DoGenerateCode(isolate, this); | 1247 return DoGenerateCode(isolate, this); |
1248 } | 1248 } |
1249 | 1249 |
1250 | 1250 |
1251 } } // namespace v8::internal | 1251 } } // namespace v8::internal |
OLD | NEW |