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