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

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

Issue 100613004: Use optimized code map to cache OSR code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: correctly upload stuff Created 7 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/compiler.h » ('j') | src/runtime.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 e52ec65c4b7632ac81cb082bfcd5d727cce3a574..0e7d6bbf887acd55df4b2942648fdba42c50aab3 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -1192,9 +1192,15 @@ void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
Label install_optimized;
HValue* first_context_slot = Add<HLoadNamedField>(optimized_map,
HObjectAccess::ForFirstContextSlot());
+ HValue* first_osr_ast_slot = Add<HLoadNamedField>(optimized_map,
+ HObjectAccess::ForFirstOsrAstIdSlot());
+ HValue* not_osr_ast_id = Add<HConstant>(BailoutId::None().ToInt(),
+ Representation::Smi());
IfBuilder already_in(this);
already_in.If<HCompareObjectEqAndBranch>(native_context,
first_context_slot);
+ already_in.AndIf<HCompareObjectEqAndBranch>(first_osr_ast_slot,
+ not_osr_ast_id);
already_in.Then();
{
HValue* code_object = Add<HLoadNamedField>(optimized_map,
@@ -1232,11 +1238,17 @@ void CodeStubGraphBuilderBase::BuildInstallFromOptimizedCodeMap(
{
HValue* keyed_minus = AddUncasted<HSub>(
key, shared_function_entry_length);
+ HValue* key_for_osr_ast_id = AddUncasted<HSub>(
+ key, graph()->GetConstant1());
HInstruction* keyed_lookup = Add<HLoadKeyed>(optimized_map,
keyed_minus, static_cast<HValue*>(NULL), FAST_ELEMENTS);
+ HInstruction* osr_ast_id = Add<HLoadKeyed>(optimized_map,
+ key_for_osr_ast_id, static_cast<HValue*>(NULL), FAST_ELEMENTS);
IfBuilder done_check(this);
done_check.If<HCompareObjectEqAndBranch>(native_context,
keyed_lookup);
+ done_check.AndIf<HCompareObjectEqAndBranch>(osr_ast_id,
+ not_osr_ast_id);
done_check.Then();
{
// Hit: fetch the optimized code.
« no previous file with comments | « no previous file | src/compiler.h » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698