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