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

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

Issue 1156593002: Cache current thread in a reserved register and use it in LoadIsolate (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added more comments. Created 5 years, 7 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"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 ScopedIsolateStackLimits stack_limit(isolate); 98 ScopedIsolateStackLimits stack_limit(isolate);
99 SuspendLongJumpScope suspend_long_jump_scope(isolate); 99 SuspendLongJumpScope suspend_long_jump_scope(isolate);
100 #if defined(USING_SIMULATOR) 100 #if defined(USING_SIMULATOR)
101 #if defined(ARCH_IS_64_BIT) 101 #if defined(ARCH_IS_64_BIT)
102 // TODO(zra): Change to intptr_t so we have only one case. 102 // TODO(zra): Change to intptr_t so we have only one case.
103 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( 103 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call(
104 reinterpret_cast<int64_t>(entrypoint), 104 reinterpret_cast<int64_t>(entrypoint),
105 static_cast<int64_t>(code.EntryPoint()), 105 static_cast<int64_t>(code.EntryPoint()),
106 reinterpret_cast<int64_t>(&arguments_descriptor), 106 reinterpret_cast<int64_t>(&arguments_descriptor),
107 reinterpret_cast<int64_t>(&arguments), 107 reinterpret_cast<int64_t>(&arguments),
108 0)); 108 reinterpret_cast<int64_t>(thread)));
109 #else 109 #else
110 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call( 110 return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call(
111 reinterpret_cast<int32_t>(entrypoint), 111 reinterpret_cast<int32_t>(entrypoint),
112 static_cast<int32_t>(code.EntryPoint()), 112 static_cast<int32_t>(code.EntryPoint()),
113 reinterpret_cast<int32_t>(&arguments_descriptor), 113 reinterpret_cast<int32_t>(&arguments_descriptor),
114 reinterpret_cast<int32_t>(&arguments), 114 reinterpret_cast<int32_t>(&arguments),
115 0)); 115 reinterpret_cast<int32_t>(thread)));
116 #endif 116 #endif
117 #else 117 #else
118 return entrypoint(code.EntryPoint(), 118 return entrypoint(code.EntryPoint(),
119 arguments_descriptor, 119 arguments_descriptor,
120 arguments); 120 arguments,
121 thread);
121 #endif 122 #endif
122 } 123 }
123 124
124 125
125 RawObject* DartEntry::InvokeClosure(const Array& arguments) { 126 RawObject* DartEntry::InvokeClosure(const Array& arguments) {
126 const Array& arguments_descriptor = 127 const Array& arguments_descriptor =
127 Array::Handle(ArgumentsDescriptor::New(arguments.Length())); 128 Array::Handle(ArgumentsDescriptor::New(arguments.Length()));
128 return InvokeClosure(arguments, arguments_descriptor); 129 return InvokeClosure(arguments, arguments_descriptor);
129 } 130 }
130 131
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 const Array& args = Array::Handle(Array::New(kNumArguments)); 518 const Array& args = Array::Handle(Array::New(kNumArguments));
518 args.SetAt(0, map); 519 args.SetAt(0, map);
519 args.SetAt(1, key); 520 args.SetAt(1, key);
520 args.SetAt(2, value); 521 args.SetAt(2, value);
521 const Object& result = Object::Handle(DartEntry::InvokeFunction(function, 522 const Object& result = Object::Handle(DartEntry::InvokeFunction(function,
522 args)); 523 args));
523 return result.raw(); 524 return result.raw();
524 } 525 }
525 526
526 } // namespace dart 527 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698