| 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/compile-time-value.h" | 9 #include "src/ast/compile-time-value.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 | 1077 |
| 1078 | 1078 |
| 1079 // static | 1079 // static |
| 1080 bool Literal::Match(void* literal1, void* literal2) { | 1080 bool Literal::Match(void* literal1, void* literal2) { |
| 1081 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1081 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
| 1082 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1082 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
| 1083 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1083 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
| 1084 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1084 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
| 1085 } | 1085 } |
| 1086 | 1086 |
| 1087 const char* InternalVariable::name() const { |
| 1088 switch (type()) { |
| 1089 case kGeneratorObject: |
| 1090 return ".generator_object"; |
| 1091 default: |
| 1092 break; |
| 1093 } |
| 1094 UNREACHABLE(); |
| 1095 return nullptr; |
| 1096 } |
| 1097 |
| 1087 const char* CallRuntime::debug_name() { | 1098 const char* CallRuntime::debug_name() { |
| 1088 #ifdef DEBUG | 1099 #ifdef DEBUG |
| 1089 return NameForNativeContextIntrinsicIndex(context_index_); | 1100 return is_jsruntime() ? NameForNativeContextIntrinsicIndex(context_index_) |
| 1101 : function_->name; |
| 1090 #else | 1102 #else |
| 1091 return is_jsruntime() ? "(context function)" : function_->name; | 1103 return is_jsruntime() ? "(context function)" : function_->name; |
| 1092 #endif // DEBUG | 1104 #endif // DEBUG |
| 1093 } | 1105 } |
| 1094 | 1106 |
| 1095 } // namespace internal | 1107 } // namespace internal |
| 1096 } // namespace v8 | 1108 } // namespace v8 |
| OLD | NEW |