OLD | NEW |
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 12558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12569 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | 12569 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); |
12570 HValue* index = Pop(); | 12570 HValue* index = Pop(); |
12571 HValue* string = Pop(); | 12571 HValue* string = Pop(); |
12572 HInstruction* char_code = BuildStringCharCodeAt(string, index); | 12572 HInstruction* char_code = BuildStringCharCodeAt(string, index); |
12573 AddInstruction(char_code); | 12573 AddInstruction(char_code); |
12574 HInstruction* result = NewUncasted<HStringCharFromCode>(char_code); | 12574 HInstruction* result = NewUncasted<HStringCharFromCode>(char_code); |
12575 return ast_context()->ReturnInstruction(result, call->id()); | 12575 return ast_context()->ReturnInstruction(result, call->id()); |
12576 } | 12576 } |
12577 | 12577 |
12578 | 12578 |
12579 // Fast support for object equality testing. | |
12580 void HOptimizedGraphBuilder::GenerateObjectEquals(CallRuntime* call) { | |
12581 DCHECK(call->arguments()->length() == 2); | |
12582 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
12583 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | |
12584 HValue* right = Pop(); | |
12585 HValue* left = Pop(); | |
12586 HCompareObjectEqAndBranch* result = | |
12587 New<HCompareObjectEqAndBranch>(left, right); | |
12588 return ast_context()->ReturnControl(result, call->id()); | |
12589 } | |
12590 | |
12591 | |
12592 // Fast support for SubString. | 12579 // Fast support for SubString. |
12593 void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { | 12580 void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { |
12594 DCHECK_EQ(3, call->arguments()->length()); | 12581 DCHECK_EQ(3, call->arguments()->length()); |
12595 CHECK_ALIVE(VisitExpressions(call->arguments())); | 12582 CHECK_ALIVE(VisitExpressions(call->arguments())); |
12596 PushArgumentsFromEnvironment(call->arguments()->length()); | 12583 PushArgumentsFromEnvironment(call->arguments()->length()); |
12597 HCallStub* result = New<HCallStub>(CodeStub::SubString, 3); | 12584 HCallStub* result = New<HCallStub>(CodeStub::SubString, 3); |
12598 return ast_context()->ReturnInstruction(result, call->id()); | 12585 return ast_context()->ReturnInstruction(result, call->id()); |
12599 } | 12586 } |
12600 | 12587 |
12601 | 12588 |
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13597 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13584 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13598 } | 13585 } |
13599 | 13586 |
13600 #ifdef DEBUG | 13587 #ifdef DEBUG |
13601 graph_->Verify(false); // No full verify. | 13588 graph_->Verify(false); // No full verify. |
13602 #endif | 13589 #endif |
13603 } | 13590 } |
13604 | 13591 |
13605 } // namespace internal | 13592 } // namespace internal |
13606 } // namespace v8 | 13593 } // namespace v8 |
OLD | NEW |