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/runtime_entry.h" | 5 #include "vm/runtime_entry.h" |
6 | 6 |
7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
8 #include "vm/ast.h" | 8 #include "vm/ast.h" |
9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 const TypeArguments& instantiator_type_arguments, | 383 const TypeArguments& instantiator_type_arguments, |
384 const TypeArguments& function_type_arguments, | 384 const TypeArguments& function_type_arguments, |
385 const Bool& result) { | 385 const Bool& result) { |
386 DartFrameIterator iterator(Thread::Current(), | 386 DartFrameIterator iterator(Thread::Current(), |
387 StackFrameIterator::kNoCrossThreadIteration); | 387 StackFrameIterator::kNoCrossThreadIteration); |
388 StackFrame* caller_frame = iterator.NextFrame(); | 388 StackFrame* caller_frame = iterator.NextFrame(); |
389 ASSERT(caller_frame != NULL); | 389 ASSERT(caller_frame != NULL); |
390 | 390 |
391 const AbstractType& instance_type = | 391 const AbstractType& instance_type = |
392 AbstractType::Handle(instance.GetType(Heap::kNew)); | 392 AbstractType::Handle(instance.GetType(Heap::kNew)); |
393 ASSERT(instance_type.IsInstantiated()); | 393 ASSERT(instance_type.IsInstantiated() || |
| 394 (instance.IsClosure() && instance_type.IsInstantiated(kCurrentClass))); |
394 if (type.IsInstantiated()) { | 395 if (type.IsInstantiated()) { |
395 OS::PrintErr("%s: '%s' %" Pd " %s '%s' %" Pd " (pc: %#" Px ").\n", message, | 396 OS::PrintErr("%s: '%s' %" Pd " %s '%s' %" Pd " (pc: %#" Px ").\n", message, |
396 String::Handle(instance_type.Name()).ToCString(), | 397 String::Handle(instance_type.Name()).ToCString(), |
397 Class::Handle(instance_type.type_class()).id(), | 398 Class::Handle(instance_type.type_class()).id(), |
398 (result.raw() == Bool::True().raw()) ? "is" : "is !", | 399 (result.raw() == Bool::True().raw()) ? "is" : "is !", |
399 String::Handle(type.Name()).ToCString(), | 400 String::Handle(type.Name()).ToCString(), |
400 Class::Handle(type.type_class()).id(), caller_frame->pc()); | 401 Class::Handle(type.type_class()).id(), caller_frame->pc()); |
401 } else { | 402 } else { |
402 // Instantiate type before printing. | 403 // Instantiate type before printing. |
403 Error& bound_error = Error::Handle(); | 404 Error& bound_error = Error::Handle(); |
(...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2351 const intptr_t new_size = 2 * old_size; | 2352 const intptr_t new_size = 2 * old_size; |
2352 const intptr_t elm_size = old_data.ElementSizeInBytes(); | 2353 const intptr_t elm_size = old_data.ElementSizeInBytes(); |
2353 const TypedData& new_data = | 2354 const TypedData& new_data = |
2354 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); | 2355 TypedData::Handle(TypedData::New(cid, new_size, Heap::kOld)); |
2355 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); | 2356 TypedData::Copy(new_data, 0, old_data, 0, old_size * elm_size); |
2356 typed_data_cell.SetAt(0, new_data); | 2357 typed_data_cell.SetAt(0, new_data); |
2357 arguments.SetReturn(new_data); | 2358 arguments.SetReturn(new_data); |
2358 } | 2359 } |
2359 | 2360 |
2360 } // namespace dart | 2361 } // namespace dart |
OLD | NEW |