| 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" |
| 11 #include "src/code-factory.h" |
| 11 #include "src/full-codegen/full-codegen.h" | 12 #include "src/full-codegen/full-codegen.h" |
| 12 #include "src/hydrogen-bce.h" | 13 #include "src/hydrogen-bce.h" |
| 13 #include "src/hydrogen-bch.h" | 14 #include "src/hydrogen-bch.h" |
| 14 #include "src/hydrogen-canonicalize.h" | 15 #include "src/hydrogen-canonicalize.h" |
| 15 #include "src/hydrogen-check-elimination.h" | 16 #include "src/hydrogen-check-elimination.h" |
| 16 #include "src/hydrogen-dce.h" | 17 #include "src/hydrogen-dce.h" |
| 17 #include "src/hydrogen-dehoist.h" | 18 #include "src/hydrogen-dehoist.h" |
| 18 #include "src/hydrogen-environment-liveness.h" | 19 #include "src/hydrogen-environment-liveness.h" |
| 19 #include "src/hydrogen-escape-analysis.h" | 20 #include "src/hydrogen-escape-analysis.h" |
| 20 #include "src/hydrogen-gvn.h" | 21 #include "src/hydrogen-gvn.h" |
| (...skipping 12196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12217 | 12218 |
| 12218 void HOptimizedGraphBuilder::GenerateToObject(CallRuntime* call) { | 12219 void HOptimizedGraphBuilder::GenerateToObject(CallRuntime* call) { |
| 12219 DCHECK_EQ(1, call->arguments()->length()); | 12220 DCHECK_EQ(1, call->arguments()->length()); |
| 12220 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 12221 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 12221 HValue* value = Pop(); | 12222 HValue* value = Pop(); |
| 12222 HValue* result = BuildToObject(value); | 12223 HValue* result = BuildToObject(value); |
| 12223 return ast_context()->ReturnValue(result); | 12224 return ast_context()->ReturnValue(result); |
| 12224 } | 12225 } |
| 12225 | 12226 |
| 12226 | 12227 |
| 12228 void HOptimizedGraphBuilder::GenerateToString(CallRuntime* call) { |
| 12229 DCHECK_EQ(1, call->arguments()->length()); |
| 12230 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 12231 Callable callable = CodeFactory::ToString(isolate()); |
| 12232 HValue* input = Pop(); |
| 12233 if (input->type().IsString()) { |
| 12234 return ast_context()->ReturnValue(input); |
| 12235 } else { |
| 12236 HValue* stub = Add<HConstant>(callable.code()); |
| 12237 HValue* values[] = {context(), input}; |
| 12238 HInstruction* result = |
| 12239 New<HCallWithDescriptor>(stub, 0, callable.descriptor(), |
| 12240 Vector<HValue*>(values, arraysize(values))); |
| 12241 return ast_context()->ReturnInstruction(result, call->id()); |
| 12242 } |
| 12243 } |
| 12244 |
| 12245 |
| 12227 void HOptimizedGraphBuilder::GenerateIsJSProxy(CallRuntime* call) { | 12246 void HOptimizedGraphBuilder::GenerateIsJSProxy(CallRuntime* call) { |
| 12228 DCHECK(call->arguments()->length() == 1); | 12247 DCHECK(call->arguments()->length() == 1); |
| 12229 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 12248 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 12230 HValue* value = Pop(); | 12249 HValue* value = Pop(); |
| 12231 HIfContinuation continuation; | 12250 HIfContinuation continuation; |
| 12232 IfBuilder if_proxy(this); | 12251 IfBuilder if_proxy(this); |
| 12233 | 12252 |
| 12234 HValue* smicheck = if_proxy.IfNot<HIsSmiAndBranch>(value); | 12253 HValue* smicheck = if_proxy.IfNot<HIsSmiAndBranch>(value); |
| 12235 if_proxy.And(); | 12254 if_proxy.And(); |
| 12236 HValue* map = Add<HLoadNamedField>(value, smicheck, HObjectAccess::ForMap()); | 12255 HValue* map = Add<HLoadNamedField>(value, smicheck, HObjectAccess::ForMap()); |
| (...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13598 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13617 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13599 } | 13618 } |
| 13600 | 13619 |
| 13601 #ifdef DEBUG | 13620 #ifdef DEBUG |
| 13602 graph_->Verify(false); // No full verify. | 13621 graph_->Verify(false); // No full verify. |
| 13603 #endif | 13622 #endif |
| 13604 } | 13623 } |
| 13605 | 13624 |
| 13606 } // namespace internal | 13625 } // namespace internal |
| 13607 } // namespace v8 | 13626 } // namespace v8 |
| OLD | NEW |