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

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

Issue 1508703002: Use WeakCells in the optimized code map rather than traversing in pause. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed nit. Created 5 years 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/contexts.h » ('j') | no next file with comments »
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 62ad816562bd543f9bbded7e2cbb8f3e9026f6d4..0160474833c8b4f9ade5b121d0ab560fa385517e 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -1870,19 +1870,29 @@ void CodeStubGraphBuilderBase::BuildCheckAndInstallOptimizedCode(
HValue* osr_ast_id_none = Add<HConstant>(BailoutId::None().ToInt());
HValue* context_slot = LoadFromOptimizedCodeMap(
optimized_map, map_index, SharedFunctionInfo::kContextOffset);
+ context_slot = Add<HLoadNamedField>(context_slot, nullptr,
+ HObjectAccess::ForWeakCellValue());
HValue* osr_ast_slot = LoadFromOptimizedCodeMap(
optimized_map, map_index, SharedFunctionInfo::kOsrAstIdOffset);
HValue* code_object = LoadFromOptimizedCodeMap(
optimized_map, map_index, SharedFunctionInfo::kCachedCodeOffset);
+ code_object = Add<HLoadNamedField>(code_object, nullptr,
+ HObjectAccess::ForWeakCellValue());
builder->If<HCompareObjectEqAndBranch>(native_context,
context_slot);
builder->AndIf<HCompareObjectEqAndBranch>(osr_ast_slot, osr_ast_id_none);
builder->And();
builder->IfNot<HCompareObjectEqAndBranch>(code_object,
- graph()->GetConstantUndefined());
+ graph()->GetConstant0());
builder->Then();
HValue* literals = LoadFromOptimizedCodeMap(optimized_map,
map_index, SharedFunctionInfo::kLiteralsOffset);
+ literals = Add<HLoadNamedField>(literals, nullptr,
+ HObjectAccess::ForWeakCellValue());
+ IfBuilder maybe_deopt(this);
+ maybe_deopt.If<HCompareObjectEqAndBranch>(literals, graph()->GetConstant0());
+ maybe_deopt.ThenDeopt(Deoptimizer::kLiteralsWereDisposed);
+ maybe_deopt.End();
BuildInstallOptimizedCode(js_function, native_context, code_object, literals);
@@ -2006,8 +2016,10 @@ void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
HValue* shared_code =
Add<HLoadNamedField>(optimized_map, nullptr,
HObjectAccess::ForOptimizedCodeMapSharedCode());
+ shared_code = Add<HLoadNamedField>(shared_code, nullptr,
+ HObjectAccess::ForWeakCellValue());
shared_code_check.IfNot<HCompareObjectEqAndBranch>(
- shared_code, graph()->GetConstantUndefined());
+ shared_code, graph()->GetConstant0());
shared_code_check.Then();
{
// Store the context-independent optimized code.
« no previous file with comments | « no previous file | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698