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/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
6 | 6 |
7 #include "vm/assert.h" | 7 #include "vm/assert.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 Instance& result = Instance::Handle(); | 162 Instance& result = Instance::Handle(); |
163 | 163 |
164 // Invoke the default constructor. | 164 // Invoke the default constructor. |
165 const String& period = String::Handle(String::New(".")); | 165 const String& period = String::Handle(String::New(".")); |
166 String& constructor_name = String::Handle(String::Concat(cls_name, period)); | 166 String& constructor_name = String::Handle(String::Concat(cls_name, period)); |
167 const Function& default_constructor = | 167 const Function& default_constructor = |
168 Function::Handle(target_class.LookupConstructor(constructor_name)); | 168 Function::Handle(target_class.LookupConstructor(constructor_name)); |
169 if (!default_constructor.IsNull()) { | 169 if (!default_constructor.IsNull()) { |
170 GrowableArray<const Object*> arguments(1); | 170 GrowableArray<const Object*> arguments(1); |
171 arguments.Add(&target); | 171 arguments.Add(&target); |
| 172 arguments.Add(&Smi::Handle(Smi::New(Function::kCtorPhaseAll))); |
172 const Array& kNoArgumentNames = Array::Handle(); | 173 const Array& kNoArgumentNames = Array::Handle(); |
173 result = DartEntry::InvokeStatic(default_constructor, | 174 result = DartEntry::InvokeStatic(default_constructor, |
174 arguments, | 175 arguments, |
175 kNoArgumentNames); | 176 kNoArgumentNames); |
176 if (result.IsUnhandledException()) { | 177 if (result.IsUnhandledException()) { |
177 UnhandledException& uhe = UnhandledException::Handle(); | 178 UnhandledException& uhe = UnhandledException::Handle(); |
178 uhe ^= result.raw(); | 179 uhe ^= result.raw(); |
179 ProcessUnhandledException(uhe); | 180 ProcessUnhandledException(uhe); |
180 } | 181 } |
181 ASSERT(result.IsNull()); | 182 ASSERT(result.IsNull()); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 intptr_t send_id = Smi::CheckedHandle(arguments->At(0)).Value(); | 336 intptr_t send_id = Smi::CheckedHandle(arguments->At(0)).Value(); |
336 intptr_t reply_id = Smi::CheckedHandle(arguments->At(1)).Value(); | 337 intptr_t reply_id = Smi::CheckedHandle(arguments->At(1)).Value(); |
337 // TODO(iposva): Allow for arbitrary messages to be sent. | 338 // TODO(iposva): Allow for arbitrary messages to be sent. |
338 void* data = SerializeObject(Instance::CheckedHandle(arguments->At(2))); | 339 void* data = SerializeObject(Instance::CheckedHandle(arguments->At(2))); |
339 | 340 |
340 // TODO(turnidge): Throw an exception when the return value is false? | 341 // TODO(turnidge): Throw an exception when the return value is false? |
341 PortMap::PostMessage(send_id, reply_id, data); | 342 PortMap::PostMessage(send_id, reply_id, data); |
342 } | 343 } |
343 | 344 |
344 } // namespace dart | 345 } // namespace dart |
OLD | NEW |