| 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/hydrogen.h" | 5 #include "src/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 12267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12278 HValue* stub = Add<HConstant>(callable.code()); | 12278 HValue* stub = Add<HConstant>(callable.code()); |
| 12279 HValue* values[] = {context(), input}; | 12279 HValue* values[] = {context(), input}; |
| 12280 HInstruction* result = | 12280 HInstruction* result = |
| 12281 New<HCallWithDescriptor>(stub, 0, callable.descriptor(), | 12281 New<HCallWithDescriptor>(stub, 0, callable.descriptor(), |
| 12282 Vector<HValue*>(values, arraysize(values))); | 12282 Vector<HValue*>(values, arraysize(values))); |
| 12283 return ast_context()->ReturnInstruction(result, call->id()); | 12283 return ast_context()->ReturnInstruction(result, call->id()); |
| 12284 } | 12284 } |
| 12285 } | 12285 } |
| 12286 | 12286 |
| 12287 | 12287 |
| 12288 void HOptimizedGraphBuilder::GenerateToLength(CallRuntime* call) { |
| 12289 DCHECK_EQ(1, call->arguments()->length()); |
| 12290 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 12291 Callable callable = CodeFactory::ToLength(isolate()); |
| 12292 HValue* input = Pop(); |
| 12293 HValue* stub = Add<HConstant>(callable.code()); |
| 12294 HValue* values[] = {context(), input}; |
| 12295 HInstruction* result = |
| 12296 New<HCallWithDescriptor>(stub, 0, callable.descriptor(), |
| 12297 Vector<HValue*>(values, arraysize(values))); |
| 12298 return ast_context()->ReturnInstruction(result, call->id()); |
| 12299 } |
| 12300 |
| 12301 |
| 12288 void HOptimizedGraphBuilder::GenerateToNumber(CallRuntime* call) { | 12302 void HOptimizedGraphBuilder::GenerateToNumber(CallRuntime* call) { |
| 12289 DCHECK_EQ(1, call->arguments()->length()); | 12303 DCHECK_EQ(1, call->arguments()->length()); |
| 12290 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 12304 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 12291 Callable callable = CodeFactory::ToNumber(isolate()); | 12305 Callable callable = CodeFactory::ToNumber(isolate()); |
| 12292 HValue* input = Pop(); | 12306 HValue* input = Pop(); |
| 12293 if (input->type().IsTaggedNumber()) { | 12307 if (input->type().IsTaggedNumber()) { |
| 12294 return ast_context()->ReturnValue(input); | 12308 return ast_context()->ReturnValue(input); |
| 12295 } else { | 12309 } else { |
| 12296 HValue* stub = Add<HConstant>(callable.code()); | 12310 HValue* stub = Add<HConstant>(callable.code()); |
| 12297 HValue* values[] = {context(), input}; | 12311 HValue* values[] = {context(), input}; |
| (...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13677 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13691 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13678 } | 13692 } |
| 13679 | 13693 |
| 13680 #ifdef DEBUG | 13694 #ifdef DEBUG |
| 13681 graph_->Verify(false); // No full verify. | 13695 graph_->Verify(false); // No full verify. |
| 13682 #endif | 13696 #endif |
| 13683 } | 13697 } |
| 13684 | 13698 |
| 13685 } // namespace internal | 13699 } // namespace internal |
| 13686 } // namespace v8 | 13700 } // namespace v8 |
| OLD | NEW |