Chromium Code Reviews| 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 "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/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 18309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 18320 } | 18320 } |
| 18321 return OneByteString::raw(dststr); | 18321 return OneByteString::raw(dststr); |
| 18322 } | 18322 } |
| 18323 return OneByteString::raw(Symbols::Empty()); | 18323 return OneByteString::raw(Symbols::Empty()); |
| 18324 } | 18324 } |
| 18325 | 18325 |
| 18326 | 18326 |
| 18327 RawOneByteString* OneByteString::New(intptr_t len, | 18327 RawOneByteString* OneByteString::New(intptr_t len, |
| 18328 Heap::Space space) { | 18328 Heap::Space space) { |
| 18329 ASSERT(Isolate::Current() == Dart::vm_isolate() || | 18329 ASSERT(Isolate::Current() == Dart::vm_isolate() || |
| 18330 Isolate::Current()->object_store()->one_byte_string_class() != | 18330 (Isolate::Current()->object_store() != NULL && |
|
Cutch
2014/12/11 23:47:01
Parens around Isolate::Current()->object_store() !
turnidge
2014/12/12 17:48:29
Done.
| |
| 18331 Class::null()); | 18331 Isolate::Current()->object_store()->one_byte_string_class() != |
|
Cutch
2014/12/11 23:47:01
Parens around Isolate::Current()->object_store()->
turnidge
2014/12/12 17:48:29
Done.
| |
| 18332 Class::null())); | |
| 18332 if (len < 0 || len > kMaxElements) { | 18333 if (len < 0 || len > kMaxElements) { |
| 18333 // This should be caught before we reach here. | 18334 // This should be caught before we reach here. |
| 18334 FATAL1("Fatal error in OneByteString::New: invalid len %" Pd "\n", len); | 18335 FATAL1("Fatal error in OneByteString::New: invalid len %" Pd "\n", len); |
| 18335 } | 18336 } |
| 18336 { | 18337 { |
| 18337 RawObject* raw = Object::Allocate(OneByteString::kClassId, | 18338 RawObject* raw = Object::Allocate(OneByteString::kClassId, |
| 18338 OneByteString::InstanceSize(len), | 18339 OneByteString::InstanceSize(len), |
| 18339 space); | 18340 space); |
| 18340 NoGCScope no_gc; | 18341 NoGCScope no_gc; |
| 18341 RawOneByteString* result = reinterpret_cast<RawOneByteString*>(raw); | 18342 RawOneByteString* result = reinterpret_cast<RawOneByteString*>(raw); |
| (...skipping 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 20490 return tag_label.ToCString(); | 20491 return tag_label.ToCString(); |
| 20491 } | 20492 } |
| 20492 | 20493 |
| 20493 | 20494 |
| 20494 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 20495 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 20495 Instance::PrintJSONImpl(stream, ref); | 20496 Instance::PrintJSONImpl(stream, ref); |
| 20496 } | 20497 } |
| 20497 | 20498 |
| 20498 | 20499 |
| 20499 } // namespace dart | 20500 } // namespace dart |
| OLD | NEW |