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 12320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12331 } else { | 12331 } else { |
12332 Callable callable = CodeFactory::ToInteger(isolate()); | 12332 Callable callable = CodeFactory::ToInteger(isolate()); |
12333 HValue* stub = Add<HConstant>(callable.code()); | 12333 HValue* stub = Add<HConstant>(callable.code()); |
12334 HValue* values[] = {context(), input}; | 12334 HValue* values[] = {context(), input}; |
12335 HInstruction* result = New<HCallWithDescriptor>( | 12335 HInstruction* result = New<HCallWithDescriptor>( |
12336 stub, 0, callable.descriptor(), ArrayVector(values)); | 12336 stub, 0, callable.descriptor(), ArrayVector(values)); |
12337 return ast_context()->ReturnInstruction(result, call->id()); | 12337 return ast_context()->ReturnInstruction(result, call->id()); |
12338 } | 12338 } |
12339 } | 12339 } |
12340 | 12340 |
12341 | |
12342 void HOptimizedGraphBuilder::GenerateToObject(CallRuntime* call) { | |
12343 DCHECK_EQ(1, call->arguments()->length()); | |
12344 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
12345 HValue* value = Pop(); | |
12346 HValue* result = BuildToObject(value); | |
12347 return ast_context()->ReturnValue(result); | |
12348 } | |
12349 | |
12350 | |
12351 void HOptimizedGraphBuilder::GenerateToString(CallRuntime* call) { | 12341 void HOptimizedGraphBuilder::GenerateToString(CallRuntime* call) { |
12352 DCHECK_EQ(1, call->arguments()->length()); | 12342 DCHECK_EQ(1, call->arguments()->length()); |
12353 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 12343 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
12354 HValue* input = Pop(); | 12344 HValue* input = Pop(); |
12355 if (input->type().IsString()) { | 12345 if (input->type().IsString()) { |
12356 return ast_context()->ReturnValue(input); | 12346 return ast_context()->ReturnValue(input); |
12357 } else { | 12347 } else { |
12358 Callable callable = CodeFactory::ToString(isolate()); | 12348 Callable callable = CodeFactory::ToString(isolate()); |
12359 HValue* stub = Add<HConstant>(callable.code()); | 12349 HValue* stub = Add<HConstant>(callable.code()); |
12360 HValue* values[] = {context(), input}; | 12350 HValue* values[] = {context(), input}; |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13433 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13423 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13434 } | 13424 } |
13435 | 13425 |
13436 #ifdef DEBUG | 13426 #ifdef DEBUG |
13437 graph_->Verify(false); // No full verify. | 13427 graph_->Verify(false); // No full verify. |
13438 #endif | 13428 #endif |
13439 } | 13429 } |
13440 | 13430 |
13441 } // namespace internal | 13431 } // namespace internal |
13442 } // namespace v8 | 13432 } // namespace v8 |
OLD | NEW |