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 10906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10917 | 10917 |
10918 | 10918 |
10919 // Check for the form (%_ClassOf(foo) === 'BarClass'). | 10919 // Check for the form (%_ClassOf(foo) === 'BarClass'). |
10920 static bool IsClassOfTest(CompareOperation* expr) { | 10920 static bool IsClassOfTest(CompareOperation* expr) { |
10921 if (expr->op() != Token::EQ_STRICT) return false; | 10921 if (expr->op() != Token::EQ_STRICT) return false; |
10922 CallRuntime* call = expr->left()->AsCallRuntime(); | 10922 CallRuntime* call = expr->left()->AsCallRuntime(); |
10923 if (call == NULL) return false; | 10923 if (call == NULL) return false; |
10924 Literal* literal = expr->right()->AsLiteral(); | 10924 Literal* literal = expr->right()->AsLiteral(); |
10925 if (literal == NULL) return false; | 10925 if (literal == NULL) return false; |
10926 if (!literal->value()->IsString()) return false; | 10926 if (!literal->value()->IsString()) return false; |
10927 if (!call->is_jsruntime() && | 10927 if (call->is_jsruntime()) return false; |
10928 call->function()->function_id != Runtime::kInlineClassOf) { | 10928 if (call->function()->function_id != Runtime::kInlineClassOf) return false; |
10929 return false; | 10929 DCHECK_EQ(call->arguments()->length(), 1); |
10930 } | |
10931 DCHECK(call->arguments()->length() == 1); | |
10932 return true; | 10930 return true; |
10933 } | 10931 } |
10934 | 10932 |
10935 | |
10936 void HOptimizedGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) { | 10933 void HOptimizedGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) { |
10937 DCHECK(!HasStackOverflow()); | 10934 DCHECK(!HasStackOverflow()); |
10938 DCHECK(current_block() != NULL); | 10935 DCHECK(current_block() != NULL); |
10939 DCHECK(current_block()->HasPredecessor()); | 10936 DCHECK(current_block()->HasPredecessor()); |
10940 switch (expr->op()) { | 10937 switch (expr->op()) { |
10941 case Token::COMMA: | 10938 case Token::COMMA: |
10942 return VisitComma(expr); | 10939 return VisitComma(expr); |
10943 case Token::OR: | 10940 case Token::OR: |
10944 case Token::AND: | 10941 case Token::AND: |
10945 return VisitLogicalExpression(expr); | 10942 return VisitLogicalExpression(expr); |
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12979 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12976 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12980 } | 12977 } |
12981 | 12978 |
12982 #ifdef DEBUG | 12979 #ifdef DEBUG |
12983 graph_->Verify(false); // No full verify. | 12980 graph_->Verify(false); // No full verify. |
12984 #endif | 12981 #endif |
12985 } | 12982 } |
12986 | 12983 |
12987 } // namespace internal | 12984 } // namespace internal |
12988 } // namespace v8 | 12985 } // namespace v8 |
OLD | NEW |