| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/ast/ast.h" | 5 #include "src/ast/ast.h" |
| 6 | 6 |
| 7 #include <cmath> // For isfinite. | 7 #include <cmath> // For isfinite. |
| 8 | 8 |
| 9 #include "src/ast/prettyprinter.h" | 9 #include "src/ast/prettyprinter.h" |
| 10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 } | 706 } |
| 707 | 707 |
| 708 | 708 |
| 709 bool CompareOperation::IsLiteralCompareNull(Expression** expr) { | 709 bool CompareOperation::IsLiteralCompareNull(Expression** expr) { |
| 710 return MatchLiteralCompareNull(left_, op_, right_, expr) || | 710 return MatchLiteralCompareNull(left_, op_, right_, expr) || |
| 711 MatchLiteralCompareNull(right_, op_, left_, expr); | 711 MatchLiteralCompareNull(right_, op_, left_, expr); |
| 712 } | 712 } |
| 713 | 713 |
| 714 | 714 |
| 715 // ---------------------------------------------------------------------------- | 715 // ---------------------------------------------------------------------------- |
| 716 // Inlining support | |
| 717 | |
| 718 bool Declaration::IsInlineable() const { | |
| 719 return proxy()->var()->IsStackAllocated(); | |
| 720 } | |
| 721 | |
| 722 bool FunctionDeclaration::IsInlineable() const { | |
| 723 return false; | |
| 724 } | |
| 725 | |
| 726 | |
| 727 // ---------------------------------------------------------------------------- | |
| 728 // Recording of type feedback | 716 // Recording of type feedback |
| 729 | 717 |
| 730 // TODO(rossberg): all RecordTypeFeedback functions should disappear | 718 // TODO(rossberg): all RecordTypeFeedback functions should disappear |
| 731 // once we use the common type field in the AST consistently. | 719 // once we use the common type field in the AST consistently. |
| 732 | 720 |
| 733 void Expression::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { | 721 void Expression::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { |
| 734 set_to_boolean_types(oracle->ToBooleanTypes(test_id())); | 722 set_to_boolean_types(oracle->ToBooleanTypes(test_id())); |
| 735 } | 723 } |
| 736 | 724 |
| 737 | 725 |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 bool Literal::Match(void* literal1, void* literal2) { | 1127 bool Literal::Match(void* literal1, void* literal2) { |
| 1140 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1128 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
| 1141 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1129 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
| 1142 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1130 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
| 1143 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1131 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
| 1144 } | 1132 } |
| 1145 | 1133 |
| 1146 | 1134 |
| 1147 } // namespace internal | 1135 } // namespace internal |
| 1148 } // namespace v8 | 1136 } // namespace v8 |
| OLD | NEW |