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

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

Issue 10826090: Optimize away most implicit const getter functions (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | runtime/vm/parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 1476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 } 1487 }
1488 1488
1489 1489
1490 void Class::SetFields(const Array& value) const { 1490 void Class::SetFields(const Array& value) const {
1491 ASSERT(!value.IsNull()); 1491 ASSERT(!value.IsNull());
1492 Field& field = Field::Handle(); 1492 Field& field = Field::Handle();
1493 intptr_t len = value.Length(); 1493 intptr_t len = value.Length();
1494 for (intptr_t i = 0; i < len; i++) { 1494 for (intptr_t i = 0; i < len; i++) {
1495 field ^= value.At(i); 1495 field ^= value.At(i);
1496 field.set_owner(*this); 1496 field.set_owner(*this);
1497 // Only static const fields may contain the Object::sentinel value.
1498 ASSERT(!(field.is_static() && field.is_final()) ||
1499 (field.value() == Object::sentinel()));
1500 } 1497 }
1501 // The value of static fields is already initialized to null. 1498 // The value of static fields is already initialized to null.
1502 StorePointer(&raw_ptr()->fields_, value.raw()); 1499 StorePointer(&raw_ptr()->fields_, value.raw());
1503 } 1500 }
1504 1501
1505 1502
1506 template <class FakeInstance> 1503 template <class FakeInstance>
1507 RawClass* Class::New(intptr_t index) { 1504 RawClass* Class::New(intptr_t index) {
1508 ASSERT(Object::class_class() != Class::null()); 1505 ASSERT(Object::class_class() != Class::null());
1509 Class& result = Class::Handle(); 1506 Class& result = Class::Handle();
(...skipping 9369 matching lines...) Expand 10 before | Expand all | Expand 10 after
10879 const String& str = String::Handle(pattern()); 10876 const String& str = String::Handle(pattern());
10880 const char* format = "JSRegExp: pattern=%s flags=%s"; 10877 const char* format = "JSRegExp: pattern=%s flags=%s";
10881 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); 10878 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
10882 char* chars = reinterpret_cast<char*>( 10879 char* chars = reinterpret_cast<char*>(
10883 Isolate::Current()->current_zone()->Allocate(len + 1)); 10880 Isolate::Current()->current_zone()->Allocate(len + 1));
10884 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); 10881 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
10885 return chars; 10882 return chars;
10886 } 10883 }
10887 10884
10888 } // namespace dart 10885 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698