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

Side by Side Diff: src/hydrogen.cc

Issue 754863002: Optimize testing for an index's existence in packed Arrays (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased for landing Created 6 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 unified diff | Download patch
« no previous file with comments | « src/array.js ('k') | src/macros.py » ('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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 11647 matching lines...) Expand 10 before | Expand all | Expand 10 after
11658 instance_type, Add<HConstant>(FIRST_JS_PROXY_TYPE), Token::GTE); 11658 instance_type, Add<HConstant>(FIRST_JS_PROXY_TYPE), Token::GTE);
11659 if_proxy.And(); 11659 if_proxy.And();
11660 if_proxy.If<HCompareNumericAndBranch>( 11660 if_proxy.If<HCompareNumericAndBranch>(
11661 instance_type, Add<HConstant>(LAST_JS_PROXY_TYPE), Token::LTE); 11661 instance_type, Add<HConstant>(LAST_JS_PROXY_TYPE), Token::LTE);
11662 11662
11663 if_proxy.CaptureContinuation(&continuation); 11663 if_proxy.CaptureContinuation(&continuation);
11664 return ast_context()->ReturnContinuation(&continuation, call->id()); 11664 return ast_context()->ReturnContinuation(&continuation, call->id());
11665 } 11665 }
11666 11666
11667 11667
11668 void HOptimizedGraphBuilder::GenerateHasFastPackedElements(CallRuntime* call) {
11669 DCHECK(call->arguments()->length() == 1);
11670 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
11671 HValue* object = Pop();
11672 HIfContinuation continuation(graph()->CreateBasicBlock(),
11673 graph()->CreateBasicBlock());
11674 IfBuilder if_not_smi(this);
11675 if_not_smi.IfNot<HIsSmiAndBranch>(object);
11676 if_not_smi.Then();
11677 {
11678 NoObservableSideEffectsScope no_effects(this);
11679
11680 IfBuilder if_fast_packed(this);
11681 HValue* elements_kind = BuildGetElementsKind(object);
11682 if_fast_packed.If<HCompareNumericAndBranch>(
11683 elements_kind, Add<HConstant>(FAST_SMI_ELEMENTS), Token::EQ);
11684 if_fast_packed.Or();
11685 if_fast_packed.If<HCompareNumericAndBranch>(
11686 elements_kind, Add<HConstant>(FAST_ELEMENTS), Token::EQ);
11687 if_fast_packed.Or();
11688 if_fast_packed.If<HCompareNumericAndBranch>(
11689 elements_kind, Add<HConstant>(FAST_DOUBLE_ELEMENTS), Token::EQ);
11690 if_fast_packed.JoinContinuation(&continuation);
11691 }
11692 if_not_smi.JoinContinuation(&continuation);
11693 return ast_context()->ReturnContinuation(&continuation, call->id());
11694 }
11695
11696
11668 void HOptimizedGraphBuilder::GenerateIsNonNegativeSmi(CallRuntime* call) { 11697 void HOptimizedGraphBuilder::GenerateIsNonNegativeSmi(CallRuntime* call) {
11669 return Bailout(kInlinedRuntimeFunctionIsNonNegativeSmi); 11698 return Bailout(kInlinedRuntimeFunctionIsNonNegativeSmi);
11670 } 11699 }
11671 11700
11672 11701
11673 void HOptimizedGraphBuilder::GenerateIsUndetectableObject(CallRuntime* call) { 11702 void HOptimizedGraphBuilder::GenerateIsUndetectableObject(CallRuntime* call) {
11674 DCHECK(call->arguments()->length() == 1); 11703 DCHECK(call->arguments()->length() == 1);
11675 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); 11704 CHECK_ALIVE(VisitForValue(call->arguments()->at(0)));
11676 HValue* value = Pop(); 11705 HValue* value = Pop();
11677 HIsUndetectableAndBranch* result = New<HIsUndetectableAndBranch>(value); 11706 HIsUndetectableAndBranch* result = New<HIsUndetectableAndBranch>(value);
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after
12991 if (ShouldProduceTraceOutput()) { 13020 if (ShouldProduceTraceOutput()) {
12992 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13021 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
12993 } 13022 }
12994 13023
12995 #ifdef DEBUG 13024 #ifdef DEBUG
12996 graph_->Verify(false); // No full verify. 13025 graph_->Verify(false); // No full verify.
12997 #endif 13026 #endif
12998 } 13027 }
12999 13028
13000 } } // namespace v8::internal 13029 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/array.js ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698