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

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

Issue 26682003: Cache number of type arguments in class object instead of recalculating it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/class_finalizer.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698