| 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 11936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11947 void HOptimizedGraphBuilder::GenerateIsTypedArray(CallRuntime* call) { | 11947 void HOptimizedGraphBuilder::GenerateIsTypedArray(CallRuntime* call) { |
| 11948 DCHECK(call->arguments()->length() == 1); | 11948 DCHECK(call->arguments()->length() == 1); |
| 11949 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 11949 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 11950 HValue* value = Pop(); | 11950 HValue* value = Pop(); |
| 11951 HHasInstanceTypeAndBranch* result = | 11951 HHasInstanceTypeAndBranch* result = |
| 11952 New<HHasInstanceTypeAndBranch>(value, JS_TYPED_ARRAY_TYPE); | 11952 New<HHasInstanceTypeAndBranch>(value, JS_TYPED_ARRAY_TYPE); |
| 11953 return ast_context()->ReturnControl(result, call->id()); | 11953 return ast_context()->ReturnControl(result, call->id()); |
| 11954 } | 11954 } |
| 11955 | 11955 |
| 11956 | 11956 |
| 11957 void HOptimizedGraphBuilder::GenerateIsRegExp(CallRuntime* call) { | |
| 11958 DCHECK(call->arguments()->length() == 1); | |
| 11959 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | |
| 11960 HValue* value = Pop(); | |
| 11961 HHasInstanceTypeAndBranch* result = | |
| 11962 New<HHasInstanceTypeAndBranch>(value, JS_REGEXP_TYPE); | |
| 11963 return ast_context()->ReturnControl(result, call->id()); | |
| 11964 } | |
| 11965 | |
| 11966 | |
| 11967 void HOptimizedGraphBuilder::GenerateToInteger(CallRuntime* call) { | 11957 void HOptimizedGraphBuilder::GenerateToInteger(CallRuntime* call) { |
| 11968 DCHECK_EQ(1, call->arguments()->length()); | 11958 DCHECK_EQ(1, call->arguments()->length()); |
| 11969 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 11959 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 11970 HValue* input = Pop(); | 11960 HValue* input = Pop(); |
| 11971 if (input->type().IsSmi()) { | 11961 if (input->type().IsSmi()) { |
| 11972 return ast_context()->ReturnValue(input); | 11962 return ast_context()->ReturnValue(input); |
| 11973 } else { | 11963 } else { |
| 11974 Callable callable = CodeFactory::ToInteger(isolate()); | 11964 Callable callable = CodeFactory::ToInteger(isolate()); |
| 11975 HValue* stub = Add<HConstant>(callable.code()); | 11965 HValue* stub = Add<HConstant>(callable.code()); |
| 11976 HValue* values[] = {input}; | 11966 HValue* values[] = {input}; |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13009 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12999 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13010 } | 13000 } |
| 13011 | 13001 |
| 13012 #ifdef DEBUG | 13002 #ifdef DEBUG |
| 13013 graph_->Verify(false); // No full verify. | 13003 graph_->Verify(false); // No full verify. |
| 13014 #endif | 13004 #endif |
| 13015 } | 13005 } |
| 13016 | 13006 |
| 13017 } // namespace internal | 13007 } // namespace internal |
| 13018 } // namespace v8 | 13008 } // namespace v8 |
| OLD | NEW |