| 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 12585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12596 // Fast support for SubString. | 12596 // Fast support for SubString. |
| 12597 void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { | 12597 void HOptimizedGraphBuilder::GenerateSubString(CallRuntime* call) { |
| 12598 DCHECK_EQ(3, call->arguments()->length()); | 12598 DCHECK_EQ(3, call->arguments()->length()); |
| 12599 CHECK_ALIVE(VisitExpressions(call->arguments())); | 12599 CHECK_ALIVE(VisitExpressions(call->arguments())); |
| 12600 PushArgumentsFromEnvironment(call->arguments()->length()); | 12600 PushArgumentsFromEnvironment(call->arguments()->length()); |
| 12601 HCallStub* result = New<HCallStub>(CodeStub::SubString, 3); | 12601 HCallStub* result = New<HCallStub>(CodeStub::SubString, 3); |
| 12602 return ast_context()->ReturnInstruction(result, call->id()); | 12602 return ast_context()->ReturnInstruction(result, call->id()); |
| 12603 } | 12603 } |
| 12604 | 12604 |
| 12605 | 12605 |
| 12606 void HOptimizedGraphBuilder::GenerateStringGetLength(CallRuntime* call) { | |
| 12607 DCHECK(call->arguments()->length() == 1); | |
| 12608 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
| 12609 HValue* string = Pop(); | |
| 12610 HInstruction* result = BuildLoadStringLength(string); | |
| 12611 return ast_context()->ReturnInstruction(result, call->id()); | |
| 12612 } | |
| 12613 | |
| 12614 | |
| 12615 // Support for direct calls from JavaScript to native RegExp code. | 12606 // Support for direct calls from JavaScript to native RegExp code. |
| 12616 void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) { | 12607 void HOptimizedGraphBuilder::GenerateRegExpExec(CallRuntime* call) { |
| 12617 DCHECK_EQ(4, call->arguments()->length()); | 12608 DCHECK_EQ(4, call->arguments()->length()); |
| 12618 CHECK_ALIVE(VisitExpressions(call->arguments())); | 12609 CHECK_ALIVE(VisitExpressions(call->arguments())); |
| 12619 PushArgumentsFromEnvironment(call->arguments()->length()); | 12610 PushArgumentsFromEnvironment(call->arguments()->length()); |
| 12620 HCallStub* result = New<HCallStub>(CodeStub::RegExpExec, 4); | 12611 HCallStub* result = New<HCallStub>(CodeStub::RegExpExec, 4); |
| 12621 return ast_context()->ReturnInstruction(result, call->id()); | 12612 return ast_context()->ReturnInstruction(result, call->id()); |
| 12622 } | 12613 } |
| 12623 | 12614 |
| 12624 | 12615 |
| (...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13622 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13613 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13623 } | 13614 } |
| 13624 | 13615 |
| 13625 #ifdef DEBUG | 13616 #ifdef DEBUG |
| 13626 graph_->Verify(false); // No full verify. | 13617 graph_->Verify(false); // No full verify. |
| 13627 #endif | 13618 #endif |
| 13628 } | 13619 } |
| 13629 | 13620 |
| 13630 } // namespace internal | 13621 } // namespace internal |
| 13631 } // namespace v8 | 13622 } // namespace v8 |
| OLD | NEW |