| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/class_finalizer.h" | 5 #include "vm/class_finalizer.h" |
| 6 | 6 |
| 7 #include "vm/flags.h" | 7 #include "vm/flags.h" |
| 8 #include "vm/heap.h" | 8 #include "vm/heap.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
| (...skipping 2580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2591 error ^= Parser::FormatError(script, token_pos, "Error", format, args); | 2591 error ^= Parser::FormatError(script, token_pos, "Error", format, args); |
| 2592 } else { | 2592 } else { |
| 2593 error ^= Parser::FormatErrorWithAppend( | 2593 error ^= Parser::FormatErrorWithAppend( |
| 2594 prev_error, script, token_pos, "Error", format, args); | 2594 prev_error, script, token_pos, "Error", format, args); |
| 2595 } | 2595 } |
| 2596 va_end(args); | 2596 va_end(args); |
| 2597 ReportError(error); | 2597 ReportError(error); |
| 2598 } | 2598 } |
| 2599 | 2599 |
| 2600 | 2600 |
| 2601 void ClassFinalizer::ReportError(const char* format, ...) { | |
| 2602 va_list args; | |
| 2603 va_start(args, format); | |
| 2604 const Error& error = Error::Handle( | |
| 2605 Parser::FormatError(Script::Handle(), -1, "Error", format, args)); | |
| 2606 va_end(args); | |
| 2607 ReportError(error); | |
| 2608 } | |
| 2609 | |
| 2610 | |
| 2611 void ClassFinalizer::VerifyImplicitFieldOffsets() { | 2601 void ClassFinalizer::VerifyImplicitFieldOffsets() { |
| 2612 #ifdef DEBUG | 2602 #ifdef DEBUG |
| 2613 Isolate* isolate = Isolate::Current(); | 2603 Isolate* isolate = Isolate::Current(); |
| 2614 const ClassTable& class_table = *(isolate->class_table()); | 2604 const ClassTable& class_table = *(isolate->class_table()); |
| 2615 Class& cls = Class::Handle(isolate); | 2605 Class& cls = Class::Handle(isolate); |
| 2616 Array& fields_array = Array::Handle(isolate); | 2606 Array& fields_array = Array::Handle(isolate); |
| 2617 Field& field = Field::Handle(isolate); | 2607 Field& field = Field::Handle(isolate); |
| 2618 String& name = String::Handle(isolate); | 2608 String& name = String::Handle(isolate); |
| 2619 String& expected_name = String::Handle(isolate); | 2609 String& expected_name = String::Handle(isolate); |
| 2620 Error& error = Error::Handle(isolate); | 2610 Error& error = Error::Handle(isolate); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2661 expected_name ^= String::New("_offset"); | 2651 expected_name ^= String::New("_offset"); |
| 2662 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); | 2652 ASSERT(String::EqualsIgnoringPrivateKey(name, expected_name)); |
| 2663 field ^= fields_array.At(2); | 2653 field ^= fields_array.At(2); |
| 2664 ASSERT(field.Offset() == TypedDataView::length_offset()); | 2654 ASSERT(field.Offset() == TypedDataView::length_offset()); |
| 2665 name ^= field.name(); | 2655 name ^= field.name(); |
| 2666 ASSERT(name.Equals("length")); | 2656 ASSERT(name.Equals("length")); |
| 2667 #endif | 2657 #endif |
| 2668 } | 2658 } |
| 2669 | 2659 |
| 2670 } // namespace dart | 2660 } // namespace dart |
| OLD | NEW |