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-numbering.h" | 10 #include "src/ast-numbering.h" |
(...skipping 12585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12596 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 12596 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
12597 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | 12597 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); |
12598 HValue* right = Pop(); | 12598 HValue* right = Pop(); |
12599 HValue* left = Pop(); | 12599 HValue* left = Pop(); |
12600 HCompareObjectEqAndBranch* result = | 12600 HCompareObjectEqAndBranch* result = |
12601 New<HCompareObjectEqAndBranch>(left, right); | 12601 New<HCompareObjectEqAndBranch>(left, right); |
12602 return ast_context()->ReturnControl(result, call->id()); | 12602 return ast_context()->ReturnControl(result, call->id()); |
12603 } | 12603 } |
12604 | 12604 |
12605 | 12605 |
12606 // Fast support for StringAdd. | |
12607 void HOptimizedGraphBuilder::GenerateStringAdd(CallRuntime* call) { | |
12608 DCHECK_EQ(2, call->arguments()->length()); | |
12609 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
12610 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | |
12611 HValue* right = Pop(); | |
12612 HValue* left = Pop(); | |
12613 HInstruction* result = NewUncasted<HStringAdd>(left, right); | |
12614 return ast_context()->ReturnInstruction(result, call->id()); | |
12615 } | |
12616 | |
12617 | |
12618 // Fast support for SubString. | 12606 // Fast support for SubString. |
12619 void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { | 12607 void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { |
12620 DCHECK_EQ(3, call->arguments()->length()); | 12608 DCHECK_EQ(3, call->arguments()->length()); |
12621 CHECK_ALIVE(VisitExpressions(call->arguments())); | 12609 CHECK_ALIVE(VisitExpressions(call->arguments())); |
12622 PushArgumentsFromEnvironment(call->arguments()->length()); | 12610 PushArgumentsFromEnvironment(call->arguments()->length()); |
12623 HCallStub* result = New<HCallStub>(CodeStub::SubString, 3); | 12611 HCallStub* result = New<HCallStub>(CodeStub::SubString, 3); |
12624 return ast_context()->ReturnInstruction(result, call->id()); | 12612 return ast_context()->ReturnInstruction(result, call->id()); |
12625 } | 12613 } |
12626 | 12614 |
12627 | 12615 |
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13635 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13623 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13636 } | 13624 } |
13637 | 13625 |
13638 #ifdef DEBUG | 13626 #ifdef DEBUG |
13639 graph_->Verify(false); // No full verify. | 13627 graph_->Verify(false); // No full verify. |
13640 #endif | 13628 #endif |
13641 } | 13629 } |
13642 | 13630 |
13643 } // namespace internal | 13631 } // namespace internal |
13644 } // namespace v8 | 13632 } // namespace v8 |
OLD | NEW |