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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 // Now Call the invoke stub which will invoke the dart function. | 94 // Now Call the invoke stub which will invoke the dart function. |
95 invokestub entrypoint = reinterpret_cast<invokestub>( | 95 invokestub entrypoint = reinterpret_cast<invokestub>( |
96 StubCode::InvokeDartCode_entry()->EntryPoint()); | 96 StubCode::InvokeDartCode_entry()->EntryPoint()); |
97 const Code& code = Code::Handle(zone, function.CurrentCode()); | 97 const Code& code = Code::Handle(zone, function.CurrentCode()); |
98 ASSERT(!code.IsNull()); | 98 ASSERT(!code.IsNull()); |
99 ASSERT(Isolate::Current()->no_callback_scope_depth() == 0); | 99 ASSERT(Isolate::Current()->no_callback_scope_depth() == 0); |
100 ScopedIsolateStackLimits stack_limit(isolate); | 100 ScopedIsolateStackLimits stack_limit(isolate); |
101 SuspendLongJumpScope suspend_long_jump_scope(thread); | 101 SuspendLongJumpScope suspend_long_jump_scope(thread); |
102 #if defined(USING_SIMULATOR) | 102 #if defined(USING_SIMULATOR) |
103 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( | 103 #if defined(ARCH_IS_64_BIT) |
104 reinterpret_cast<intptr_t>(entrypoint), | 104 // TODO(zra): Change to intptr_t so we have only one case. |
105 reinterpret_cast<intptr_t>(&code), | 105 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( |
106 reinterpret_cast<intptr_t>(&arguments_descriptor), | 106 reinterpret_cast<int64_t>(entrypoint), |
107 reinterpret_cast<intptr_t>(&arguments), | 107 static_cast<int64_t>(code.EntryPoint()), |
108 reinterpret_cast<intptr_t>(thread))); | 108 reinterpret_cast<int64_t>(&arguments_descriptor), |
| 109 reinterpret_cast<int64_t>(&arguments), |
| 110 reinterpret_cast<int64_t>(thread))); |
109 #else | 111 #else |
110 return entrypoint(code, | 112 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( |
111 arguments_descriptor, | 113 reinterpret_cast<int32_t>(entrypoint), |
112 arguments, | 114 static_cast<int32_t>(code.EntryPoint()), |
113 thread); | 115 reinterpret_cast<int32_t>(&arguments_descriptor), |
| 116 reinterpret_cast<int32_t>(&arguments), |
| 117 reinterpret_cast<int32_t>(thread))); |
| 118 #endif |
| 119 #else |
| 120 return entrypoint(code.EntryPoint(), |
| 121 arguments_descriptor, |
| 122 arguments, |
| 123 thread); |
114 #endif | 124 #endif |
115 } | 125 } |
116 | 126 |
117 | 127 |
118 RawObject* DartEntry::InvokeClosure(const Array& arguments) { | 128 RawObject* DartEntry::InvokeClosure(const Array& arguments) { |
119 const Array& arguments_descriptor = | 129 const Array& arguments_descriptor = |
120 Array::Handle(ArgumentsDescriptor::New(arguments.Length())); | 130 Array::Handle(ArgumentsDescriptor::New(arguments.Length())); |
121 return InvokeClosure(arguments, arguments_descriptor); | 131 return InvokeClosure(arguments, arguments_descriptor); |
122 } | 132 } |
123 | 133 |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 const Array& args = Array::Handle(Array::New(kNumArguments)); | 586 const Array& args = Array::Handle(Array::New(kNumArguments)); |
577 args.SetAt(0, map); | 587 args.SetAt(0, map); |
578 args.SetAt(1, key); | 588 args.SetAt(1, key); |
579 args.SetAt(2, value); | 589 args.SetAt(2, value); |
580 const Object& result = Object::Handle(DartEntry::InvokeFunction(function, | 590 const Object& result = Object::Handle(DartEntry::InvokeFunction(function, |
581 args)); | 591 args)); |
582 return result.raw(); | 592 return result.raw(); |
583 } | 593 } |
584 | 594 |
585 } // namespace dart | 595 } // namespace dart |
OLD | NEW |