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/dart_entry.h" | 5 #include "vm/dart_entry.h" |
6 | 6 |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
11 #include "vm/object_store.h" | 11 #include "vm/object_store.h" |
12 #include "vm/resolver.h" | 12 #include "vm/resolver.h" |
| 13 #include "vm/safepoint.h" |
13 #include "vm/simulator.h" | 14 #include "vm/simulator.h" |
14 #include "vm/stub_code.h" | 15 #include "vm/stub_code.h" |
15 #include "vm/symbols.h" | 16 #include "vm/symbols.h" |
16 | 17 |
17 namespace dart { | 18 namespace dart { |
18 | 19 |
19 DECLARE_FLAG(bool, lazy_dispatchers); | 20 DECLARE_FLAG(bool, lazy_dispatchers); |
20 | 21 |
21 // A cache of VM heap allocated arguments descriptors. | 22 // A cache of VM heap allocated arguments descriptors. |
22 RawArray* ArgumentsDescriptor::cached_args_descriptors_[kCachedDescriptorCount]; | 23 RawArray* ArgumentsDescriptor::cached_args_descriptors_[kCachedDescriptorCount]; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } | 107 } |
107 } | 108 } |
108 // Now Call the invoke stub which will invoke the dart function. | 109 // Now Call the invoke stub which will invoke the dart function. |
109 invokestub entrypoint = reinterpret_cast<invokestub>( | 110 invokestub entrypoint = reinterpret_cast<invokestub>( |
110 StubCode::InvokeDartCode_entry()->EntryPoint()); | 111 StubCode::InvokeDartCode_entry()->EntryPoint()); |
111 const Code& code = Code::Handle(zone, function.CurrentCode()); | 112 const Code& code = Code::Handle(zone, function.CurrentCode()); |
112 ASSERT(!code.IsNull()); | 113 ASSERT(!code.IsNull()); |
113 ASSERT(thread->no_callback_scope_depth() == 0); | 114 ASSERT(thread->no_callback_scope_depth() == 0); |
114 ScopedIsolateStackLimits stack_limit(thread); | 115 ScopedIsolateStackLimits stack_limit(thread); |
115 SuspendLongJumpScope suspend_long_jump_scope(thread); | 116 SuspendLongJumpScope suspend_long_jump_scope(thread); |
| 117 TransitionToGenerated transition(thread); |
116 #if defined(USING_SIMULATOR) | 118 #if defined(USING_SIMULATOR) |
117 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( | 119 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( |
118 reinterpret_cast<intptr_t>(entrypoint), | 120 reinterpret_cast<intptr_t>(entrypoint), |
119 reinterpret_cast<intptr_t>(&code), | 121 reinterpret_cast<intptr_t>(&code), |
120 reinterpret_cast<intptr_t>(&arguments_descriptor), | 122 reinterpret_cast<intptr_t>(&arguments_descriptor), |
121 reinterpret_cast<intptr_t>(&arguments), | 123 reinterpret_cast<intptr_t>(&arguments), |
122 reinterpret_cast<intptr_t>(thread))); | 124 reinterpret_cast<intptr_t>(thread))); |
123 #else | 125 #else |
124 return entrypoint(code, | 126 return entrypoint(code, |
125 arguments_descriptor, | 127 arguments_descriptor, |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 const Array& args = Array::Handle(Array::New(kNumArguments)); | 592 const Array& args = Array::Handle(Array::New(kNumArguments)); |
591 args.SetAt(0, map); | 593 args.SetAt(0, map); |
592 args.SetAt(1, key); | 594 args.SetAt(1, key); |
593 args.SetAt(2, value); | 595 args.SetAt(2, value); |
594 const Object& result = Object::Handle(DartEntry::InvokeFunction(function, | 596 const Object& result = Object::Handle(DartEntry::InvokeFunction(function, |
595 args)); | 597 args)); |
596 return result.raw(); | 598 return result.raw(); |
597 } | 599 } |
598 | 600 |
599 } // namespace dart | 601 } // namespace dart |
OLD | NEW |