| 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 <memory> | 7 #include <memory> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 11524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11535 } | 11535 } |
| 11536 | 11536 |
| 11537 | 11537 |
| 11538 void HOptimizedGraphBuilder::GenerateToString(CallRuntime* call) { | 11538 void HOptimizedGraphBuilder::GenerateToString(CallRuntime* call) { |
| 11539 DCHECK_EQ(1, call->arguments()->length()); | 11539 DCHECK_EQ(1, call->arguments()->length()); |
| 11540 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 11540 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 11541 HValue* input = Pop(); | 11541 HValue* input = Pop(); |
| 11542 if (input->type().IsString()) { | 11542 if (input->type().IsString()) { |
| 11543 return ast_context()->ReturnValue(input); | 11543 return ast_context()->ReturnValue(input); |
| 11544 } else { | 11544 } else { |
| 11545 Callable callable = CodeFactory::ToString(isolate()); | 11545 Callable callable = Builtins::CallableFor(isolate(), Builtins::kToString); |
| 11546 HValue* stub = Add<HConstant>(callable.code()); | 11546 HValue* stub = Add<HConstant>(callable.code()); |
| 11547 HValue* values[] = {input}; | 11547 HValue* values[] = {input}; |
| 11548 HInstruction* result = New<HCallWithDescriptor>( | 11548 HInstruction* result = New<HCallWithDescriptor>( |
| 11549 stub, 0, callable.descriptor(), ArrayVector(values)); | 11549 stub, 0, callable.descriptor(), ArrayVector(values)); |
| 11550 return ast_context()->ReturnInstruction(result, call->id()); | 11550 return ast_context()->ReturnInstruction(result, call->id()); |
| 11551 } | 11551 } |
| 11552 } | 11552 } |
| 11553 | 11553 |
| 11554 | 11554 |
| 11555 void HOptimizedGraphBuilder::GenerateToLength(CallRuntime* call) { | 11555 void HOptimizedGraphBuilder::GenerateToLength(CallRuntime* call) { |
| (...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12528 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12528 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12529 } | 12529 } |
| 12530 | 12530 |
| 12531 #ifdef DEBUG | 12531 #ifdef DEBUG |
| 12532 graph_->Verify(false); // No full verify. | 12532 graph_->Verify(false); // No full verify. |
| 12533 #endif | 12533 #endif |
| 12534 } | 12534 } |
| 12535 | 12535 |
| 12536 } // namespace internal | 12536 } // namespace internal |
| 12537 } // namespace v8 | 12537 } // namespace v8 |
| OLD | NEW |