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

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

Issue 927363004: Verify/document assumption about stack resource addresses. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | « runtime/vm/allocation.cc ('k') | runtime/vm/longjump.cc » ('j') | 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 // Continue simulating at the given pc in the given frame after setting up the 275 // Continue simulating at the given pc in the given frame after setting up the
276 // exception object in the kExceptionObjectReg register and the stacktrace 276 // exception object in the kExceptionObjectReg register and the stacktrace
277 // object (may be raw null) in the kStackTraceObjectReg register. 277 // object (may be raw null) in the kStackTraceObjectReg register.
278 278
279 Simulator::Current()->Longjmp(program_counter, stack_pointer, frame_pointer, 279 Simulator::Current()->Longjmp(program_counter, stack_pointer, frame_pointer,
280 raw_exception, raw_stacktrace, isolate); 280 raw_exception, raw_stacktrace, isolate);
281 #else 281 #else
282 // Prepare for unwinding frames by destroying all the stack resources 282 // Prepare for unwinding frames by destroying all the stack resources
283 // in the previous frames. 283 // in the previous frames.
284 284 StackResource::Unwind(isolate, stack_pointer);
285 while (isolate->top_resource() != NULL && 285 // There should be some stack resources left, since we never cross the
286 (reinterpret_cast<uword>(isolate->top_resource()) < stack_pointer)) { 286 // bottommost C++ frame with its handlescope, etc.
287 isolate->top_resource()->~StackResource(); 287 ASSERT(isolate->top_resource() != NULL);
288 }
289 288
290 // Call a stub to set up the exception object in kExceptionObjectReg, 289 // Call a stub to set up the exception object in kExceptionObjectReg,
291 // to set up the stacktrace object in kStackTraceObjectReg, and to 290 // to set up the stacktrace object in kStackTraceObjectReg, and to
292 // continue execution at the given pc in the given frame. 291 // continue execution at the given pc in the given frame.
293 typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*, 292 typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*,
294 Isolate*); 293 Isolate*);
295 ExcpHandler func = reinterpret_cast<ExcpHandler>( 294 ExcpHandler func = reinterpret_cast<ExcpHandler>(
296 StubCode::JumpToExceptionHandlerEntryPoint()); 295 StubCode::JumpToExceptionHandlerEntryPoint());
297 296
298 // Unpoison the stack before we tear it down in the generated stub code. 297 // Unpoison the stack before we tear it down in the generated stub code.
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 753
755 // Throw JavascriptCompatibilityError exception. 754 // Throw JavascriptCompatibilityError exception.
756 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { 755 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) {
757 const Array& exc_args = Array::Handle(Array::New(1)); 756 const Array& exc_args = Array::Handle(Array::New(1));
758 const String& msg_str = String::Handle(String::New(msg)); 757 const String& msg_str = String::Handle(String::New(msg));
759 exc_args.SetAt(0, msg_str); 758 exc_args.SetAt(0, msg_str);
760 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); 759 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args);
761 } 760 }
762 761
763 } // namespace dart 762 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/allocation.cc ('k') | runtime/vm/longjump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698