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 12595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12606 { | 12606 { |
12607 // If the object is not a value return the object. | 12607 // If the object is not a value return the object. |
12608 Push(object); | 12608 Push(object); |
12609 Add<HSimulate>(call->id(), FIXED_SIMULATE); | 12609 Add<HSimulate>(call->id(), FIXED_SIMULATE); |
12610 } | 12610 } |
12611 if_objectisvalue.End(); | 12611 if_objectisvalue.End(); |
12612 return ast_context()->ReturnValue(Pop()); | 12612 return ast_context()->ReturnValue(Pop()); |
12613 } | 12613 } |
12614 | 12614 |
12615 | 12615 |
12616 void HOptimizedGraphBuilder::GenerateOneByteSeqStringSetChar( | |
12617 CallRuntime* call) { | |
12618 DCHECK(call->arguments()->length() == 3); | |
12619 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
12620 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | |
12621 CHECK_ALIVE(VisitForValue(call->arguments()->at(2))); | |
12622 HValue* string = Pop(); | |
12623 HValue* value = Pop(); | |
12624 HValue* index = Pop(); | |
12625 Add<HSeqStringSetChar>(String::ONE_BYTE_ENCODING, string, | |
12626 index, value); | |
12627 Add<HSimulate>(call->id(), FIXED_SIMULATE); | |
12628 return ast_context()->ReturnValue(graph()->GetConstantUndefined()); | |
12629 } | |
12630 | |
12631 | |
12632 void HOptimizedGraphBuilder::GenerateTwoByteSeqStringSetChar( | |
12633 CallRuntime* call) { | |
12634 DCHECK(call->arguments()->length() == 3); | |
12635 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
12636 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | |
12637 CHECK_ALIVE(VisitForValue(call->arguments()->at(2))); | |
12638 HValue* string = Pop(); | |
12639 HValue* value = Pop(); | |
12640 HValue* index = Pop(); | |
12641 Add<HSeqStringSetChar>(String::TWO_BYTE_ENCODING, string, | |
12642 index, value); | |
12643 Add<HSimulate>(call->id(), FIXED_SIMULATE); | |
12644 return ast_context()->ReturnValue(graph()->GetConstantUndefined()); | |
12645 } | |
12646 | |
12647 | |
12648 // Fast support for charCodeAt(n). | 12616 // Fast support for charCodeAt(n). |
12649 void HOptimizedGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) { | 12617 void HOptimizedGraphBuilder::GenerateStringCharCodeAt(CallRuntime* call) { |
12650 DCHECK(call->arguments()->length() == 2); | 12618 DCHECK(call->arguments()->length() == 2); |
12651 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 12619 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
12652 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); | 12620 CHECK_ALIVE(VisitForValue(call->arguments()->at(1))); |
12653 HValue* index = Pop(); | 12621 HValue* index = Pop(); |
12654 HValue* string = Pop(); | 12622 HValue* string = Pop(); |
12655 HInstruction* result = BuildStringCharCodeAt(string, index); | 12623 HInstruction* result = BuildStringCharCodeAt(string, index); |
12656 return ast_context()->ReturnInstruction(result, call->id()); | 12624 return ast_context()->ReturnInstruction(result, call->id()); |
12657 } | 12625 } |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13697 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13665 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13698 } | 13666 } |
13699 | 13667 |
13700 #ifdef DEBUG | 13668 #ifdef DEBUG |
13701 graph_->Verify(false); // No full verify. | 13669 graph_->Verify(false); // No full verify. |
13702 #endif | 13670 #endif |
13703 } | 13671 } |
13704 | 13672 |
13705 } // namespace internal | 13673 } // namespace internal |
13706 } // namespace v8 | 13674 } // namespace v8 |
OLD | NEW |