| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 5471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5482 } | 5482 } |
| 5483 | 5483 |
| 5484 | 5484 |
| 5485 const char* PcDescriptors::KindAsStr(intptr_t index) const { | 5485 const char* PcDescriptors::KindAsStr(intptr_t index) const { |
| 5486 switch (DescriptorKind(index)) { | 5486 switch (DescriptorKind(index)) { |
| 5487 case PcDescriptors::kDeopt: return "deopt"; | 5487 case PcDescriptors::kDeopt: return "deopt"; |
| 5488 case PcDescriptors::kPatchCode: return "patch"; | 5488 case PcDescriptors::kPatchCode: return "patch"; |
| 5489 case PcDescriptors::kIcCall: return "ic-call"; | 5489 case PcDescriptors::kIcCall: return "ic-call"; |
| 5490 case PcDescriptors::kFuncCall: return "func-call"; | 5490 case PcDescriptors::kFuncCall: return "func-call"; |
| 5491 case PcDescriptors::kReturn: return "return"; | 5491 case PcDescriptors::kReturn: return "return"; |
| 5492 case PcDescriptors::kTypeTest: return "type-test"; |
| 5492 case PcDescriptors::kOther: return "other"; | 5493 case PcDescriptors::kOther: return "other"; |
| 5493 } | 5494 } |
| 5494 UNREACHABLE(); | 5495 UNREACHABLE(); |
| 5495 return ""; | 5496 return ""; |
| 5496 } | 5497 } |
| 5497 | 5498 |
| 5498 | 5499 |
| 5499 const char* PcDescriptors::ToCString() const { | 5500 const char* PcDescriptors::ToCString() const { |
| 5500 if (Length() == 0) { | 5501 if (Length() == 0) { |
| 5501 return "No pc descriptors\n"; | 5502 return "No pc descriptors\n"; |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5925 for (intptr_t i = 0; i < descriptors.Length(); i++) { | 5926 for (intptr_t i = 0; i < descriptors.Length(); i++) { |
| 5926 if ((descriptors.NodeId(i) == node_id) && | 5927 if ((descriptors.NodeId(i) == node_id) && |
| 5927 (descriptors.DescriptorKind(i) == PcDescriptors::kDeopt)) { | 5928 (descriptors.DescriptorKind(i) == PcDescriptors::kDeopt)) { |
| 5928 return descriptors.PC(i); | 5929 return descriptors.PC(i); |
| 5929 } | 5930 } |
| 5930 } | 5931 } |
| 5931 return 0; | 5932 return 0; |
| 5932 } | 5933 } |
| 5933 | 5934 |
| 5934 | 5935 |
| 5936 uword Code::GetTypeTestAtNodeId(intptr_t node_id) const { |
| 5937 const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); |
| 5938 for (intptr_t i = 0; i < descriptors.Length(); i++) { |
| 5939 if ((descriptors.NodeId(i) == node_id) && |
| 5940 (descriptors.DescriptorKind(i) == PcDescriptors::kTypeTest)) { |
| 5941 return descriptors.PC(i); |
| 5942 } |
| 5943 } |
| 5944 return 0; |
| 5945 } |
| 5946 |
| 5947 |
| 5935 const char* Code::ToCString() const { | 5948 const char* Code::ToCString() const { |
| 5936 const char* kFormat = "Code entry:0x%d"; | 5949 const char* kFormat = "Code entry:0x%d"; |
| 5937 intptr_t len = OS::SNPrint(NULL, 0, kFormat, EntryPoint()); | 5950 intptr_t len = OS::SNPrint(NULL, 0, kFormat, EntryPoint()); |
| 5938 char* chars = reinterpret_cast<char*>( | 5951 char* chars = reinterpret_cast<char*>( |
| 5939 Isolate::Current()->current_zone()->Allocate(len)); | 5952 Isolate::Current()->current_zone()->Allocate(len)); |
| 5940 OS::SNPrint(chars, len, kFormat, EntryPoint()); | 5953 OS::SNPrint(chars, len, kFormat, EntryPoint()); |
| 5941 return chars; | 5954 return chars; |
| 5942 } | 5955 } |
| 5943 | 5956 |
| 5944 | 5957 |
| (...skipping 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9094 const String& str = String::Handle(pattern()); | 9107 const String& str = String::Handle(pattern()); |
| 9095 const char* format = "JSRegExp: pattern=%s flags=%s"; | 9108 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 9096 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 9109 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 9097 char* chars = reinterpret_cast<char*>( | 9110 char* chars = reinterpret_cast<char*>( |
| 9098 Isolate::Current()->current_zone()->Allocate(len + 1)); | 9111 Isolate::Current()->current_zone()->Allocate(len + 1)); |
| 9099 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 9112 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 9100 return chars; | 9113 return chars; |
| 9101 } | 9114 } |
| 9102 | 9115 |
| 9103 } // namespace dart | 9116 } // namespace dart |
| OLD | NEW |