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 5345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5356 public: | 5356 public: |
5357 static const intptr_t kInitialSize = 16 * KB; | 5357 static const intptr_t kInitialSize = 16 * KB; |
5358 CompressedTokenStreamData() : | 5358 CompressedTokenStreamData() : |
5359 buffer_(NULL), | 5359 buffer_(NULL), |
5360 stream_(&buffer_, Reallocate, kInitialSize), | 5360 stream_(&buffer_, Reallocate, kInitialSize), |
5361 token_objects_(GrowableObjectArray::Handle( | 5361 token_objects_(GrowableObjectArray::Handle( |
5362 GrowableObjectArray::New(kInitialTokenCount, Heap::kOld))), | 5362 GrowableObjectArray::New(kInitialTokenCount, Heap::kOld))), |
5363 token_obj_(Object::Handle()), | 5363 token_obj_(Object::Handle()), |
5364 literal_token_(LiteralToken::Handle()), | 5364 literal_token_(LiteralToken::Handle()), |
5365 literal_str_(String::Handle()) { | 5365 literal_str_(String::Handle()) { |
5366 const String& empty_literal = String::Handle(); | 5366 token_objects_.Add(Object::null_string()); |
5367 token_objects_.Add(empty_literal); | |
5368 } | 5367 } |
5369 ~CompressedTokenStreamData() { | 5368 ~CompressedTokenStreamData() { |
5370 } | 5369 } |
5371 | 5370 |
5372 // Add an IDENT token into the stream and the token objects array. | 5371 // Add an IDENT token into the stream and the token objects array. |
5373 void AddIdentToken(String* ident) { | 5372 void AddIdentToken(String* ident) { |
5374 if (ident != NULL) { | 5373 if (ident != NULL) { |
5375 // If the IDENT token is already in the tokens object array use the | 5374 // If the IDENT token is already in the tokens object array use the |
5376 // same index instead of duplicating it. | 5375 // same index instead of duplicating it. |
5377 intptr_t index = FindIdentIndex(ident); | 5376 intptr_t index = FindIdentIndex(ident); |
(...skipping 8251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13629 space); | 13628 space); |
13630 return reinterpret_cast<RawWeakProperty*>(raw); | 13629 return reinterpret_cast<RawWeakProperty*>(raw); |
13631 } | 13630 } |
13632 | 13631 |
13633 | 13632 |
13634 const char* WeakProperty::ToCString() const { | 13633 const char* WeakProperty::ToCString() const { |
13635 return "_WeakProperty"; | 13634 return "_WeakProperty"; |
13636 } | 13635 } |
13637 | 13636 |
13638 } // namespace dart | 13637 } // namespace dart |
OLD | NEW |