OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/code_generator.h" | 5 #include "vm/code_generator.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 } | 582 } |
583 const String& error_message = String::ZoneHandle( | 583 const String& error_message = String::ZoneHandle( |
584 Symbols::New(error.ToErrorCString())); | 584 Symbols::New(error.ToErrorCString())); |
585 Exceptions::CreateAndThrowTypeError( | 585 Exceptions::CreateAndThrowTypeError( |
586 location, src_type_name, dst_type_name, dst_name, error_message); | 586 location, src_type_name, dst_type_name, dst_name, error_message); |
587 UNREACHABLE(); | 587 UNREACHABLE(); |
588 } | 588 } |
589 | 589 |
590 | 590 |
591 DEFINE_RUNTIME_ENTRY(Throw, 1) { | 591 DEFINE_RUNTIME_ENTRY(Throw, 1) { |
592 const Instance& exception = Instance::CheckedHandle(arguments.ArgAt(0)); | 592 const Instance& exception = |
593 Exceptions::Throw(exception); | 593 Instance::CheckedHandle(isolate, arguments.ArgAt(0)); |
| 594 Exceptions::Throw(isolate, exception); |
594 } | 595 } |
595 | 596 |
596 | 597 |
597 DEFINE_RUNTIME_ENTRY(ReThrow, 2) { | 598 DEFINE_RUNTIME_ENTRY(ReThrow, 2) { |
598 const Instance& exception = Instance::CheckedHandle(arguments.ArgAt(0)); | 599 const Instance& exception = |
599 const Instance& stacktrace = Instance::CheckedHandle(arguments.ArgAt(1)); | 600 Instance::CheckedHandle(isolate, arguments.ArgAt(0)); |
600 Exceptions::ReThrow(exception, stacktrace); | 601 const Instance& stacktrace = |
| 602 Instance::CheckedHandle(isolate, arguments.ArgAt(1)); |
| 603 Exceptions::ReThrow(isolate, exception, stacktrace); |
601 } | 604 } |
602 | 605 |
603 | 606 |
604 // Patches static call in optimized code with the target's entry point. | 607 // Patches static call in optimized code with the target's entry point. |
605 // Compiles target if necessary. | 608 // Compiles target if necessary. |
606 DEFINE_RUNTIME_ENTRY(PatchStaticCall, 0) { | 609 DEFINE_RUNTIME_ENTRY(PatchStaticCall, 0) { |
607 DartFrameIterator iterator; | 610 DartFrameIterator iterator; |
608 StackFrame* caller_frame = iterator.NextFrame(); | 611 StackFrame* caller_frame = iterator.NextFrame(); |
609 ASSERT(caller_frame != NULL); | 612 ASSERT(caller_frame != NULL); |
610 const Code& caller_code = Code::Handle(caller_frame->LookupDartCode()); | 613 const Code& caller_code = Code::Handle(caller_frame->LookupDartCode()); |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 uword stack_overflow_flags = isolate->GetAndClearStackOverflowFlags(); | 1060 uword stack_overflow_flags = isolate->GetAndClearStackOverflowFlags(); |
1058 | 1061 |
1059 // If an interrupt happens at the same time as a stack overflow, we | 1062 // If an interrupt happens at the same time as a stack overflow, we |
1060 // process the stack overflow now and leave the interrupt for next | 1063 // process the stack overflow now and leave the interrupt for next |
1061 // time. | 1064 // time. |
1062 if (stack_pos < isolate->saved_stack_limit()) { | 1065 if (stack_pos < isolate->saved_stack_limit()) { |
1063 // Use the preallocated stack overflow exception to avoid calling | 1066 // Use the preallocated stack overflow exception to avoid calling |
1064 // into dart code. | 1067 // into dart code. |
1065 const Instance& exception = | 1068 const Instance& exception = |
1066 Instance::Handle(isolate->object_store()->stack_overflow()); | 1069 Instance::Handle(isolate->object_store()->stack_overflow()); |
1067 Exceptions::Throw(exception); | 1070 Exceptions::Throw(isolate, exception); |
1068 UNREACHABLE(); | 1071 UNREACHABLE(); |
1069 } | 1072 } |
1070 | 1073 |
1071 // The following code is used to stress test deoptimization and | 1074 // The following code is used to stress test deoptimization and |
1072 // debugger stack tracing. | 1075 // debugger stack tracing. |
1073 bool do_deopt = false; | 1076 bool do_deopt = false; |
1074 bool do_stacktrace = false; | 1077 bool do_stacktrace = false; |
1075 if ((FLAG_deoptimize_every > 0) || (FLAG_stacktrace_every > 0)) { | 1078 if ((FLAG_deoptimize_every > 0) || (FLAG_stacktrace_every > 0)) { |
1076 // TODO(turnidge): To make --deoptimize_every and | 1079 // TODO(turnidge): To make --deoptimize_every and |
1077 // --stacktrace-every faster we could move this increment/test to | 1080 // --stacktrace-every faster we could move this increment/test to |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1534 // of the given value. | 1537 // of the given value. |
1535 // Arg0: Field object; | 1538 // Arg0: Field object; |
1536 // Arg1: Value that is being stored. | 1539 // Arg1: Value that is being stored. |
1537 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { | 1540 DEFINE_RUNTIME_ENTRY(UpdateFieldCid, 2) { |
1538 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); | 1541 const Field& field = Field::CheckedHandle(arguments.ArgAt(0)); |
1539 const Object& value = Object::Handle(arguments.ArgAt(1)); | 1542 const Object& value = Object::Handle(arguments.ArgAt(1)); |
1540 field.RecordStore(value); | 1543 field.RecordStore(value); |
1541 } | 1544 } |
1542 | 1545 |
1543 } // namespace dart | 1546 } // namespace dart |
OLD | NEW |