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

Unified Diff: src/compiler.cc

Issue 1873173002: [compiler] Set expect property count right after parsing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 4 years, 8 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 | « no previous file | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index e2f016114afd23f363788013966acf6433739336..250dcbf269b91253ad69077202671780824952f0 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -488,27 +488,6 @@ void OptimizedCompileJob::RecordOptimizationStats() {
namespace {
-// Sets the expected number of properties based on estimate from compiler.
-void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared,
- int estimate) {
- // If no properties are added in the constructor, they are more likely
- // to be added later.
- if (estimate == 0) estimate = 2;
-
- // TODO(yangguo): check whether those heuristics are still up-to-date.
- // We do not shrink objects that go into a snapshot (yet), so we adjust
- // the estimate conservatively.
- if (shared->GetIsolate()->serializer_enabled()) {
- estimate += 2;
- } else {
- // Inobject slack tracking will reclaim redundant inobject space later,
- // so we can afford to adjust the estimate generously.
- estimate += 8;
- }
-
- shared->set_expected_nof_properties(estimate);
-}
-
void MaybeDisableOptimization(Handle<SharedFunctionInfo> shared_info,
BailoutReason bailout_reason) {
if (bailout_reason != kNoReason) {
@@ -663,7 +642,6 @@ MUST_USE_RESULT MaybeHandle<Code> GetUnoptimizedCode(CompilationInfo* info) {
Handle<SharedFunctionInfo> shared = info->shared_info();
FunctionLiteral* lit = info->literal();
DCHECK_EQ(shared->language_mode(), lit->language_mode());
- SetExpectedNofPropertiesFromEstimate(shared, lit->expected_property_count());
MaybeDisableOptimization(shared, lit->dont_optimize_reason());
// Compile either unoptimized code or bytecode for the interpreter.
@@ -1120,12 +1098,6 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
PROFILE(isolate, CodeCreateEvent(log_tag, *info->abstract_code(), *result,
info, *script_name));
- // Hint to the runtime system used when allocating space for initial
- // property space by setting the expected number of properties for
- // the instances of the function.
- SetExpectedNofPropertiesFromEstimate(result,
- lit->expected_property_count());
-
if (!script.is_null())
script->set_compilation_state(Script::COMPILATION_STATE_COMPILED);
@@ -1608,10 +1580,6 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
result->set_allows_lazy_compilation(literal->AllowsLazyCompilation());
result->set_allows_lazy_compilation_without_context(allow_lazy_without_ctx);
- // Set the expected number of properties for instances and return
- // the resulting function.
- SetExpectedNofPropertiesFromEstimate(result,
- literal->expected_property_count());
live_edit_tracker.RecordFunctionInfo(result, literal, info.zone());
}
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698