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" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 Zone* zone = thread->zone(); | 96 Zone* zone = thread->zone(); |
97 ASSERT(thread->IsMutatorThread()); | 97 ASSERT(thread->IsMutatorThread()); |
98 if (!function.HasCode()) { | 98 if (!function.HasCode()) { |
99 const Error& error = Error::Handle( | 99 const Error& error = Error::Handle( |
100 zone, Compiler::CompileFunction(thread, function)); | 100 zone, Compiler::CompileFunction(thread, function)); |
101 if (!error.IsNull()) { | 101 if (!error.IsNull()) { |
102 return error.raw(); | 102 return error.raw(); |
103 } | 103 } |
104 } | 104 } |
105 // Now Call the invoke stub which will invoke the dart function. | 105 // Now Call the invoke stub which will invoke the dart function. |
| 106 #if !defined(TARGET_ARCH_DBC) |
106 invokestub entrypoint = reinterpret_cast<invokestub>( | 107 invokestub entrypoint = reinterpret_cast<invokestub>( |
107 StubCode::InvokeDartCode_entry()->EntryPoint()); | 108 StubCode::InvokeDartCode_entry()->EntryPoint()); |
| 109 #endif |
108 const Code& code = Code::Handle(zone, function.CurrentCode()); | 110 const Code& code = Code::Handle(zone, function.CurrentCode()); |
109 ASSERT(!code.IsNull()); | 111 ASSERT(!code.IsNull()); |
110 ASSERT(thread->no_callback_scope_depth() == 0); | 112 ASSERT(thread->no_callback_scope_depth() == 0); |
111 ScopedIsolateStackLimits stack_limit(thread); | 113 ScopedIsolateStackLimits stack_limit(thread); |
112 SuspendLongJumpScope suspend_long_jump_scope(thread); | 114 SuspendLongJumpScope suspend_long_jump_scope(thread); |
113 TransitionToGenerated transition(thread); | 115 TransitionToGenerated transition(thread); |
114 #if defined(USING_SIMULATOR) | 116 #if defined(TARGET_ARCH_DBC) |
| 117 return Simulator::Current()->Call(code, |
| 118 arguments_descriptor, |
| 119 arguments, |
| 120 thread); |
| 121 #elif defined(USING_SIMULATOR) |
115 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( | 122 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( |
116 reinterpret_cast<intptr_t>(entrypoint), | 123 reinterpret_cast<intptr_t>(entrypoint), |
117 reinterpret_cast<intptr_t>(&code), | 124 reinterpret_cast<intptr_t>(&code), |
118 reinterpret_cast<intptr_t>(&arguments_descriptor), | 125 reinterpret_cast<intptr_t>(&arguments_descriptor), |
119 reinterpret_cast<intptr_t>(&arguments), | 126 reinterpret_cast<intptr_t>(&arguments), |
120 reinterpret_cast<intptr_t>(thread))); | 127 reinterpret_cast<intptr_t>(thread))); |
121 #else | 128 #else |
122 return entrypoint(code, | 129 return entrypoint(code, |
123 arguments_descriptor, | 130 arguments_descriptor, |
124 arguments, | 131 arguments, |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 const Array& args = Array::Handle(Array::New(kNumArguments)); | 602 const Array& args = Array::Handle(Array::New(kNumArguments)); |
596 args.SetAt(0, map); | 603 args.SetAt(0, map); |
597 args.SetAt(1, key); | 604 args.SetAt(1, key); |
598 args.SetAt(2, value); | 605 args.SetAt(2, value); |
599 const Object& result = Object::Handle(DartEntry::InvokeFunction(function, | 606 const Object& result = Object::Handle(DartEntry::InvokeFunction(function, |
600 args)); | 607 args)); |
601 return result.raw(); | 608 return result.raw(); |
602 } | 609 } |
603 | 610 |
604 } // namespace dart | 611 } // namespace dart |
OLD | NEW |