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

Unified Diff: src/code-stubs-hydrogen.cc

Issue 59823002: Reset opt count on optimized code map lookup failure. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/compiler.cc » ('j') | src/runtime-profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index dfa5ecd8cf840a75086eb5b0d5bac86b839aceb3..2022cac6404030fdce0af08a91ffb253df1b5b1a 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -1191,6 +1191,23 @@ void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
loop_builder.Break();
}
done_check.Else();
+ {
+ // The optimization count should be tied to the context, e.g. as
+ // entry in optimized code map. But for simplicity's sake we just
+ // reset the opt count if the optimized code map lookup fails,
+ // because no optimized code exists for the current context.
+ HValue* opt_count_and_bailout_reason = Add<HLoadNamedField>(
+ shared_info, HObjectAccess::ForOptCountAndBailoutReason());
+ int32_t opt_count_mask =
Jakob Kummerow 2013/11/05 14:35:05 BitField has a kMask which you can use. Note that
+ (1 << SharedFunctionInfo::OptCountBits::kSize - 1)
+ << SharedFunctionInfo::OptCountBits::kShift;
+ HValue* mask = Add<HConstant>(opt_count_mask);
+ HValue* result = Add<HBitwise>(
+ Token::BIT_AND, opt_count_and_bailout_reason, mask);
+ Add<HStoreNamedField>(shared_info,
+ HObjectAccess::ForOptCountAndBailoutReason(),
+ result);
+ }
done_check.End();
}
restore_check.End();
@@ -1241,8 +1258,6 @@ HValue* CodeStubGraphBuilder<FastNewClosureStub>::BuildCodeStub() {
HObjectAccess::ForSharedFunctionInfoPointer(),
shared_info);
Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
- shared_info);
- Add<HStoreNamedField>(js_function, HObjectAccess::ForFunctionContextPointer(),
context());
// Initialize the code pointer in the function to be the one
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | src/runtime-profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698