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

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 1894953004: Add HasProperty code stub that tries simple lookups or jumps to runtime otherwise. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments, tweak linear search limit based on local measurements 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 "src/crankshaft/hydrogen.h" 5 #include "src/crankshaft/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/allocation-site-scopes.h" 9 #include "src/allocation-site-scopes.h"
10 #include "src/ast/ast-numbering.h" 10 #include "src/ast/ast-numbering.h"
(...skipping 11686 matching lines...) Expand 10 before | Expand all | Expand 10 after
11697 HHasInPrototypeChainAndBranch* result = 11697 HHasInPrototypeChainAndBranch* result =
11698 New<HHasInPrototypeChainAndBranch>(left, prototype); 11698 New<HHasInPrototypeChainAndBranch>(left, prototype);
11699 return ast_context()->ReturnControl(result, expr->id()); 11699 return ast_context()->ReturnControl(result, expr->id());
11700 } 11700 }
11701 } 11701 }
11702 11702
11703 HInstanceOf* result = New<HInstanceOf>(left, right); 11703 HInstanceOf* result = New<HInstanceOf>(left, right);
11704 return ast_context()->ReturnInstruction(result, expr->id()); 11704 return ast_context()->ReturnInstruction(result, expr->id());
11705 11705
11706 } else if (op == Token::IN) { 11706 } else if (op == Token::IN) {
11707 Add<HPushArguments>(left, right); 11707 Callable callable = CodeFactory::HasProperty(isolate());
11708 HValue* stub = Add<HConstant>(callable.code());
11709 HValue* values[] = {context(), left, right};
11708 HInstruction* result = 11710 HInstruction* result =
11709 New<HCallRuntime>(Runtime::FunctionForId(Runtime::kHasProperty), 2); 11711 New<HCallWithDescriptor>(stub, 0, callable.descriptor(),
11712 Vector<HValue*>(values, arraysize(values)));
11710 return ast_context()->ReturnInstruction(result, expr->id()); 11713 return ast_context()->ReturnInstruction(result, expr->id());
11711 } 11714 }
11712 11715
11713 PushBeforeSimulateBehavior push_behavior = 11716 PushBeforeSimulateBehavior push_behavior =
11714 ast_context()->IsEffect() ? NO_PUSH_BEFORE_SIMULATE 11717 ast_context()->IsEffect() ? NO_PUSH_BEFORE_SIMULATE
11715 : PUSH_BEFORE_SIMULATE; 11718 : PUSH_BEFORE_SIMULATE;
11716 HControlInstruction* compare = BuildCompareInstruction( 11719 HControlInstruction* compare = BuildCompareInstruction(
11717 op, left, right, left_type, right_type, combined_type, 11720 op, left, right, left_type, right_type, combined_type,
11718 ScriptPositionToSourcePosition(expr->left()->position()), 11721 ScriptPositionToSourcePosition(expr->left()->position()),
11719 ScriptPositionToSourcePosition(expr->right()->position()), 11722 ScriptPositionToSourcePosition(expr->right()->position()),
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after
13735 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13738 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13736 } 13739 }
13737 13740
13738 #ifdef DEBUG 13741 #ifdef DEBUG
13739 graph_->Verify(false); // No full verify. 13742 graph_->Verify(false); // No full verify.
13740 #endif 13743 #endif
13741 } 13744 }
13742 13745
13743 } // namespace internal 13746 } // namespace internal
13744 } // namespace v8 13747 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698