Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: runtime/vm/exceptions.cc

Issue 1007003002: Get C++ stack pointer in an ASAN-compatible fashion when jumping to exception handler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 // Call a stub to set up the exception object in kExceptionObjectReg, 225 // Call a stub to set up the exception object in kExceptionObjectReg,
226 // to set up the stacktrace object in kStackTraceObjectReg, and to 226 // to set up the stacktrace object in kStackTraceObjectReg, and to
227 // continue execution at the given pc in the given frame. 227 // continue execution at the given pc in the given frame.
228 typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*, 228 typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*,
229 Isolate*); 229 Isolate*);
230 ExcpHandler func = reinterpret_cast<ExcpHandler>( 230 ExcpHandler func = reinterpret_cast<ExcpHandler>(
231 StubCode::JumpToExceptionHandlerEntryPoint()); 231 StubCode::JumpToExceptionHandlerEntryPoint());
232 232
233 // Unpoison the stack before we tear it down in the generated stub code. 233 // Unpoison the stack before we tear it down in the generated stub code.
234 uword current_sp = reinterpret_cast<uword>(&program_counter) - 1024; 234 uword current_sp = Isolate::GetCurrentStackPointer() - 1024;
235 ASAN_UNPOISON(reinterpret_cast<void*>(current_sp), 235 ASAN_UNPOISON(reinterpret_cast<void*>(current_sp),
236 stack_pointer - current_sp); 236 stack_pointer - current_sp);
237 237
238 func(program_counter, stack_pointer, frame_pointer, 238 func(program_counter, stack_pointer, frame_pointer,
239 raw_exception, raw_stacktrace, isolate); 239 raw_exception, raw_stacktrace, isolate);
240 #endif 240 #endif
241 UNREACHABLE(); 241 UNREACHABLE();
242 } 242 }
243 243
244 244
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 664
665 // Throw JavascriptCompatibilityError exception. 665 // Throw JavascriptCompatibilityError exception.
666 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { 666 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) {
667 const Array& exc_args = Array::Handle(Array::New(1)); 667 const Array& exc_args = Array::Handle(Array::New(1));
668 const String& msg_str = String::Handle(String::New(msg)); 668 const String& msg_str = String::Handle(String::New(msg));
669 exc_args.SetAt(0, msg_str); 669 exc_args.SetAt(0, msg_str);
670 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); 670 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args);
671 } 671 }
672 672
673 } // namespace dart 673 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698