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

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: Rebasing Created 4 years, 7 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
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 11680 matching lines...) Expand 10 before | Expand all | Expand 10 after
11691 HHasInPrototypeChainAndBranch* result = 11691 HHasInPrototypeChainAndBranch* result =
11692 New<HHasInPrototypeChainAndBranch>(left, prototype); 11692 New<HHasInPrototypeChainAndBranch>(left, prototype);
11693 return ast_context()->ReturnControl(result, expr->id()); 11693 return ast_context()->ReturnControl(result, expr->id());
11694 } 11694 }
11695 } 11695 }
11696 11696
11697 HInstanceOf* result = New<HInstanceOf>(left, right); 11697 HInstanceOf* result = New<HInstanceOf>(left, right);
11698 return ast_context()->ReturnInstruction(result, expr->id()); 11698 return ast_context()->ReturnInstruction(result, expr->id());
11699 11699
11700 } else if (op == Token::IN) { 11700 } else if (op == Token::IN) {
11701 Add<HPushArguments>(left, right); 11701 Callable callable = CodeFactory::HasProperty(isolate());
11702 HValue* stub = Add<HConstant>(callable.code());
11703 HValue* values[] = {context(), left, right};
11702 HInstruction* result = 11704 HInstruction* result =
11703 New<HCallRuntime>(Runtime::FunctionForId(Runtime::kHasProperty), 2); 11705 New<HCallWithDescriptor>(stub, 0, callable.descriptor(),
11706 Vector<HValue*>(values, arraysize(values)));
11704 return ast_context()->ReturnInstruction(result, expr->id()); 11707 return ast_context()->ReturnInstruction(result, expr->id());
11705 } 11708 }
11706 11709
11707 PushBeforeSimulateBehavior push_behavior = 11710 PushBeforeSimulateBehavior push_behavior =
11708 ast_context()->IsEffect() ? NO_PUSH_BEFORE_SIMULATE 11711 ast_context()->IsEffect() ? NO_PUSH_BEFORE_SIMULATE
11709 : PUSH_BEFORE_SIMULATE; 11712 : PUSH_BEFORE_SIMULATE;
11710 HControlInstruction* compare = BuildCompareInstruction( 11713 HControlInstruction* compare = BuildCompareInstruction(
11711 op, left, right, left_type, right_type, combined_type, 11714 op, left, right, left_type, right_type, combined_type,
11712 ScriptPositionToSourcePosition(expr->left()->position()), 11715 ScriptPositionToSourcePosition(expr->left()->position()),
11713 ScriptPositionToSourcePosition(expr->right()->position()), 11716 ScriptPositionToSourcePosition(expr->right()->position()),
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after
13729 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13732 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13730 } 13733 }
13731 13734
13732 #ifdef DEBUG 13735 #ifdef DEBUG
13733 graph_->Verify(false); // No full verify. 13736 graph_->Verify(false); // No full verify.
13734 #endif 13737 #endif
13735 } 13738 }
13736 13739
13737 } // namespace internal 13740 } // namespace internal
13738 } // namespace v8 13741 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/full-codegen/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698