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 11 matching lines...) Expand all Loading... | |
22 #include "src/type-info.h" | 22 #include "src/type-info.h" |
23 | 23 |
24 namespace v8 { | 24 namespace v8 { |
25 namespace internal { | 25 namespace internal { |
26 | 26 |
27 // ---------------------------------------------------------------------------- | 27 // ---------------------------------------------------------------------------- |
28 // Implementation of other node functionality. | 28 // Implementation of other node functionality. |
29 | 29 |
30 #ifdef DEBUG | 30 #ifdef DEBUG |
31 | 31 |
32 static const char* NameForNativeContextIntrinsicIndex(uint32_t idx) { | |
33 switch (idx) { | |
34 #define NATIVE_CONTEXT_FIELDS_IDX(NAME, Type, name) \ | |
35 case Context::NAME: \ | |
36 return #name; | |
37 | |
38 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELDS_IDX) | |
39 | |
40 default: | |
41 break; | |
42 } | |
43 | |
44 return "UnknownIntrinsicIndex"; | |
45 } | |
46 | |
32 void AstNode::Print() { Print(Isolate::Current()); } | 47 void AstNode::Print() { Print(Isolate::Current()); } |
33 | 48 |
34 void AstNode::Print(Isolate* isolate) { | 49 void AstNode::Print(Isolate* isolate) { |
35 AstPrinter::PrintOut(isolate, this); | 50 AstPrinter::PrintOut(isolate, this); |
36 } | 51 } |
37 | 52 |
38 | 53 |
39 #endif // DEBUG | 54 #endif // DEBUG |
40 | 55 |
41 #define RETURN_NODE(Node) \ | 56 #define RETURN_NODE(Node) \ |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1057 | 1072 |
1058 | 1073 |
1059 // static | 1074 // static |
1060 bool Literal::Match(void* literal1, void* literal2) { | 1075 bool Literal::Match(void* literal1, void* literal2) { |
1061 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); | 1076 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); |
1062 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); | 1077 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); |
1063 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || | 1078 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || |
1064 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); | 1079 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); |
1065 } | 1080 } |
1066 | 1081 |
1082 const char* CallRuntime::debug_name() { | |
1083 #ifdef DEBUG | |
1084 return NameForNativeContextIntrinsicIndex(context_index_); | |
caitp
2017/01/29 05:32:33
Hey, sorry I didn't catch this sooner. This makes
| |
1085 #else | |
1086 return is_jsruntime() ? "(context function)" : function_->name; | |
1087 #endif // DEBUG | |
1088 } | |
1089 | |
1067 } // namespace internal | 1090 } // namespace internal |
1068 } // namespace v8 | 1091 } // namespace v8 |
OLD | NEW |