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