Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: runtime/vm/dart_entry.cc

Issue 1541073002: Implement safepointing of threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-review-comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 const Array& args = Array::Handle(Array::New(kNumArguments)); 594 const Array& args = Array::Handle(Array::New(kNumArguments));
593 args.SetAt(0, map); 595 args.SetAt(0, map);
594 args.SetAt(1, key); 596 args.SetAt(1, key);
595 args.SetAt(2, value); 597 args.SetAt(2, value);
596 const Object& result = Object::Handle(DartEntry::InvokeFunction(function, 598 const Object& result = Object::Handle(DartEntry::InvokeFunction(function,
597 args)); 599 args));
598 return result.raw(); 600 return result.raw();
599 } 601 }
600 602
601 } // namespace dart 603 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698