| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/exceptions.h" | 5 #include "vm/exceptions.h" |
| 6 | 6 |
| 7 #include "platform/address_sanitizer.h" | 7 #include "platform/address_sanitizer.h" |
| 8 | 8 |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 } | 99 } |
| 100 ~PreallocatedStacktraceBuilder() { } | 100 ~PreallocatedStacktraceBuilder() { } |
| 101 | 101 |
| 102 virtual void AddFrame(const Code& code, | 102 virtual void AddFrame(const Code& code, |
| 103 const Smi& offset, | 103 const Smi& offset, |
| 104 bool is_catch_frame); | 104 bool is_catch_frame); |
| 105 | 105 |
| 106 virtual bool FullStacktrace() const { return false; } | 106 virtual bool FullStacktrace() const { return false; } |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 static const int kNumTopframes = 3; | 109 static const int kNumTopframes = Stacktrace::kPreallocatedStackdepth / 2; |
| 110 | 110 |
| 111 const Stacktrace& stacktrace_; | 111 const Stacktrace& stacktrace_; |
| 112 intptr_t cur_index_; | 112 intptr_t cur_index_; |
| 113 | 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(PreallocatedStacktraceBuilder); | 114 DISALLOW_COPY_AND_ASSIGN(PreallocatedStacktraceBuilder); |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 | 117 |
| 118 void PreallocatedStacktraceBuilder::AddFrame(const Code& code, | 118 void PreallocatedStacktraceBuilder::AddFrame(const Code& code, |
| 119 const Smi& offset, | 119 const Smi& offset, |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 | 754 |
| 755 // Throw JavascriptCompatibilityError exception. | 755 // Throw JavascriptCompatibilityError exception. |
| 756 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { | 756 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { |
| 757 const Array& exc_args = Array::Handle(Array::New(1)); | 757 const Array& exc_args = Array::Handle(Array::New(1)); |
| 758 const String& msg_str = String::Handle(String::New(msg)); | 758 const String& msg_str = String::Handle(String::New(msg)); |
| 759 exc_args.SetAt(0, msg_str); | 759 exc_args.SetAt(0, msg_str); |
| 760 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); | 760 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); |
| 761 } | 761 } |
| 762 | 762 |
| 763 } // namespace dart | 763 } // namespace dart |
| OLD | NEW |