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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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_ == NULL); |
302 return stub->GenerateLightweightMissCode(isolate); | 302 return stub->GenerateLightweightMissCode(isolate); |
303 } | 303 } |
304 ElapsedTimer timer; | |
305 if (FLAG_profile_hydrogen_code_stub_compilation) { | |
306 timer.Start(); | |
Yang
2013/10/02 09:53:53
You don't want to include GenerateLightweightMissC
| |
307 } | |
304 CodeStubGraphBuilder<Stub> builder(isolate, stub); | 308 CodeStubGraphBuilder<Stub> builder(isolate, stub); |
305 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); | 309 LChunk* chunk = OptimizeGraph(builder.CreateGraph()); |
306 return chunk->Codegen(); | 310 Handle<Code> code = chunk->Codegen(); |
311 if (FLAG_profile_hydrogen_code_stub_compilation) { | |
312 double ms = timer.Elapsed().InMillisecondsF(); | |
313 PrintF("[Lazy compilation of %s took %0.3f ms]\n", *stub->GetName(), ms); | |
314 } | |
315 return code; | |
307 } | 316 } |
308 | 317 |
309 | 318 |
310 template <> | 319 template <> |
311 HValue* CodeStubGraphBuilder<ToNumberStub>::BuildCodeStub() { | 320 HValue* CodeStubGraphBuilder<ToNumberStub>::BuildCodeStub() { |
312 HValue* value = GetParameter(0); | 321 HValue* value = GetParameter(0); |
313 | 322 |
314 // Check if the parameter is already a SMI or heap number. | 323 // Check if the parameter is already a SMI or heap number. |
315 IfBuilder if_number(this); | 324 IfBuilder if_number(this); |
316 if_number.If<HIsSmiAndBranch>(value); | 325 if_number.If<HIsSmiAndBranch>(value); |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1127 return js_function; | 1136 return js_function; |
1128 } | 1137 } |
1129 | 1138 |
1130 | 1139 |
1131 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { | 1140 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { |
1132 return DoGenerateCode(isolate, this); | 1141 return DoGenerateCode(isolate, this); |
1133 } | 1142 } |
1134 | 1143 |
1135 | 1144 |
1136 } } // namespace v8::internal | 1145 } } // namespace v8::internal |
OLD | NEW |