| OLD | NEW |
| 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 "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/bigint_operations.h" | 9 #include "vm/bigint_operations.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 cls.raw_ptr()->num_native_fields_ = 0; | 292 cls.raw_ptr()->num_native_fields_ = 0; |
| 293 cls.InitEmptyFields(); | 293 cls.InitEmptyFields(); |
| 294 Isolate::Current()->class_table()->Register(cls); | 294 Isolate::Current()->class_table()->Register(cls); |
| 295 } | 295 } |
| 296 | 296 |
| 297 // Allocate and initialize the null class. | 297 // Allocate and initialize the null class. |
| 298 cls = Class::New<Instance>(kNullClassId); | 298 cls = Class::New<Instance>(kNullClassId); |
| 299 cls.set_is_finalized(); | 299 cls.set_is_finalized(); |
| 300 null_class_ = cls.raw(); | 300 null_class_ = cls.raw(); |
| 301 | 301 |
| 302 // Allocate and initialize the free list element class. |
| 303 cls = Class::New<FreeListElement::FakeInstance>(kFreeListElement); |
| 304 cls.set_is_finalized(); |
| 305 |
| 302 // Allocate and initialize the sentinel values of Null class. | 306 // Allocate and initialize the sentinel values of Null class. |
| 303 { | 307 { |
| 304 cls = null_class_; | 308 cls = null_class_; |
| 305 Instance& sentinel = Instance::Handle(); | 309 Instance& sentinel = Instance::Handle(); |
| 306 sentinel ^= Object::Allocate(cls, Instance::InstanceSize(), Heap::kOld); | 310 sentinel ^= Object::Allocate(cls, Instance::InstanceSize(), Heap::kOld); |
| 307 sentinel_ = sentinel.raw(); | 311 sentinel_ = sentinel.raw(); |
| 308 | 312 |
| 309 Instance& transition_sentinel = Instance::Handle(); | 313 Instance& transition_sentinel = Instance::Handle(); |
| 310 transition_sentinel ^= | 314 transition_sentinel ^= |
| 311 Object::Allocate(cls, Instance::InstanceSize(), Heap::kOld); | 315 Object::Allocate(cls, Instance::InstanceSize(), Heap::kOld); |
| (...skipping 9797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10109 const String& str = String::Handle(pattern()); | 10113 const String& str = String::Handle(pattern()); |
| 10110 const char* format = "JSRegExp: pattern=%s flags=%s"; | 10114 const char* format = "JSRegExp: pattern=%s flags=%s"; |
| 10111 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); | 10115 intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags()); |
| 10112 char* chars = reinterpret_cast<char*>( | 10116 char* chars = reinterpret_cast<char*>( |
| 10113 Isolate::Current()->current_zone()->Allocate(len + 1)); | 10117 Isolate::Current()->current_zone()->Allocate(len + 1)); |
| 10114 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); | 10118 OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags()); |
| 10115 return chars; | 10119 return chars; |
| 10116 } | 10120 } |
| 10117 | 10121 |
| 10118 } // namespace dart | 10122 } // namespace dart |
| OLD | NEW |