OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "compiler.h" | 7 #include "compiler.h" |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 isolate()->GetHStatistics()->IncrementSubtotals(time_taken_to_create_graph_, | 503 isolate()->GetHStatistics()->IncrementSubtotals(time_taken_to_create_graph_, |
504 time_taken_to_optimize_, | 504 time_taken_to_optimize_, |
505 time_taken_to_codegen_); | 505 time_taken_to_codegen_); |
506 } | 506 } |
507 } | 507 } |
508 | 508 |
509 | 509 |
510 // Sets the expected number of properties based on estimate from compiler. | 510 // Sets the expected number of properties based on estimate from compiler. |
511 void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared, | 511 void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared, |
512 int estimate) { | 512 int estimate) { |
513 // See the comment in SetExpectedNofProperties. | |
514 if (shared->live_objects_may_exist()) return; | |
515 | |
516 // If no properties are added in the constructor, they are more likely | 513 // If no properties are added in the constructor, they are more likely |
517 // to be added later. | 514 // to be added later. |
518 if (estimate == 0) estimate = 2; | 515 if (estimate == 0) estimate = 2; |
519 | 516 |
520 // TODO(yangguo): check whether those heuristics are still up-to-date. | 517 // TODO(yangguo): check whether those heuristics are still up-to-date. |
521 // We do not shrink objects that go into a snapshot (yet), so we adjust | 518 // We do not shrink objects that go into a snapshot (yet), so we adjust |
522 // the estimate conservatively. | 519 // the estimate conservatively. |
523 if (shared->GetIsolate()->serializer_enabled()) { | 520 if (shared->GetIsolate()->serializer_enabled()) { |
524 estimate += 2; | 521 estimate += 2; |
525 } else if (FLAG_clever_optimizations) { | 522 } else if (FLAG_clever_optimizations) { |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 AllowHandleDereference allow_deref; | 1284 AllowHandleDereference allow_deref; |
1288 bool tracing_on = info()->IsStub() | 1285 bool tracing_on = info()->IsStub() |
1289 ? FLAG_trace_hydrogen_stubs | 1286 ? FLAG_trace_hydrogen_stubs |
1290 : (FLAG_trace_hydrogen && | 1287 : (FLAG_trace_hydrogen && |
1291 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1288 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1292 return (tracing_on && | 1289 return (tracing_on && |
1293 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1290 OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1294 } | 1291 } |
1295 | 1292 |
1296 } } // namespace v8::internal | 1293 } } // namespace v8::internal |
OLD | NEW |