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

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

Issue 1270803003: VM: More abstract interface for generating stub calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « runtime/vm/debugger_x64.cc ('k') | runtime/vm/flow_graph_compiler.h » ('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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // Prepare for unwinding frames by destroying all the stack resources 221 // Prepare for unwinding frames by destroying all the stack resources
222 // in the previous frames. 222 // in the previous frames.
223 StackResource::Unwind(thread); 223 StackResource::Unwind(thread);
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 Thread*); 229 Thread*);
230 ExcpHandler func = reinterpret_cast<ExcpHandler>( 230 ExcpHandler func = reinterpret_cast<ExcpHandler>(
231 StubCode::JumpToExceptionHandlerEntryPoint()); 231 StubCode::JumpToExceptionHandler_entry()->EntryPoint());
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 = Isolate::GetCurrentStackPointer() - 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, thread); 239 raw_exception, raw_stacktrace, thread);
240 #endif 240 #endif
241 UNREACHABLE(); 241 UNREACHABLE();
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 670
671 // Throw JavascriptCompatibilityError exception. 671 // Throw JavascriptCompatibilityError exception.
672 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { 672 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) {
673 const Array& exc_args = Array::Handle(Array::New(1)); 673 const Array& exc_args = Array::Handle(Array::New(1));
674 const String& msg_str = String::Handle(String::New(msg)); 674 const String& msg_str = String::Handle(String::New(msg));
675 exc_args.SetAt(0, msg_str); 675 exc_args.SetAt(0, msg_str);
676 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); 676 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args);
677 } 677 }
678 678
679 } // namespace dart 679 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/debugger_x64.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698