Chromium Code Reviews| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 Zone* zone = thread->zone(); | 98 Zone* zone = thread->zone(); |
| 99 ASSERT(thread->IsMutatorThread()); | 99 ASSERT(thread->IsMutatorThread()); |
| 100 if (!function.HasCode()) { | 100 if (!function.HasCode()) { |
| 101 const Error& error = Error::Handle( | 101 const Error& error = Error::Handle( |
| 102 zone, Compiler::CompileFunction(thread, function)); | 102 zone, Compiler::CompileFunction(thread, function)); |
| 103 if (!error.IsNull()) { | 103 if (!error.IsNull()) { |
| 104 return error.raw(); | 104 return error.raw(); |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 // Now Call the invoke stub which will invoke the dart function. | 107 // Now Call the invoke stub which will invoke the dart function. |
| 108 #if !defined(TARGET_ARCH_DBC) | |
| 108 invokestub entrypoint = reinterpret_cast<invokestub>( | 109 invokestub entrypoint = reinterpret_cast<invokestub>( |
|
zra
2016/04/08 22:37:34
Maybe move into #elif and #else below.
Vyacheslav Egorov (Google)
2016/04/11 10:49:10
That would cause it to be duplicated twice. Not su
| |
| 109 StubCode::InvokeDartCode_entry()->EntryPoint()); | 110 StubCode::InvokeDartCode_entry()->EntryPoint()); |
| 111 #endif | |
| 110 const Code& code = Code::Handle(zone, function.CurrentCode()); | 112 const Code& code = Code::Handle(zone, function.CurrentCode()); |
| 111 ASSERT(!code.IsNull()); | 113 ASSERT(!code.IsNull()); |
| 112 ASSERT(thread->no_callback_scope_depth() == 0); | 114 ASSERT(thread->no_callback_scope_depth() == 0); |
| 113 ScopedIsolateStackLimits stack_limit(thread); | 115 ScopedIsolateStackLimits stack_limit(thread); |
| 114 SuspendLongJumpScope suspend_long_jump_scope(thread); | 116 SuspendLongJumpScope suspend_long_jump_scope(thread); |
| 115 TransitionToGenerated transition(thread); | 117 TransitionToGenerated transition(thread); |
| 116 #if defined(USING_SIMULATOR) | 118 #if defined(TARGET_ARCH_DBC) |
| 119 return Simulator::Current()->Call(code, | |
| 120 arguments_descriptor, | |
| 121 arguments, | |
| 122 thread); | |
| 123 #elif defined(USING_SIMULATOR) | |
| 117 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( | 124 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( |
| 118 reinterpret_cast<intptr_t>(entrypoint), | 125 reinterpret_cast<intptr_t>(entrypoint), |
| 119 reinterpret_cast<intptr_t>(&code), | 126 reinterpret_cast<intptr_t>(&code), |
| 120 reinterpret_cast<intptr_t>(&arguments_descriptor), | 127 reinterpret_cast<intptr_t>(&arguments_descriptor), |
| 121 reinterpret_cast<intptr_t>(&arguments), | 128 reinterpret_cast<intptr_t>(&arguments), |
| 122 reinterpret_cast<intptr_t>(thread))); | 129 reinterpret_cast<intptr_t>(thread))); |
| 123 #else | 130 #else |
| 124 return entrypoint(code, | 131 return entrypoint(code, |
| 125 arguments_descriptor, | 132 arguments_descriptor, |
| 126 arguments, | 133 arguments, |
| (...skipping 468 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 |