| 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/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 5148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5159 stream.AddFinalizer(data, DataFinalizer); | 5159 stream.AddFinalizer(data, DataFinalizer); |
| 5160 const TokenStream& result = TokenStream::Handle(TokenStream::New()); | 5160 const TokenStream& result = TokenStream::Handle(TokenStream::New()); |
| 5161 result.SetStream(stream); | 5161 result.SetStream(stream); |
| 5162 return result.raw(); | 5162 return result.raw(); |
| 5163 } | 5163 } |
| 5164 | 5164 |
| 5165 | 5165 |
| 5166 // Helper class for creation of compressed token stream data. | 5166 // Helper class for creation of compressed token stream data. |
| 5167 class CompressedTokenStreamData : public ValueObject { | 5167 class CompressedTokenStreamData : public ValueObject { |
| 5168 public: | 5168 public: |
| 5169 static const intptr_t kIncrementSize = 16 * KB; | 5169 static const intptr_t kInitialSize = 16 * KB; |
| 5170 CompressedTokenStreamData() : | 5170 CompressedTokenStreamData() : |
| 5171 buffer_(NULL), | 5171 buffer_(NULL), |
| 5172 stream_(&buffer_, Reallocate, kIncrementSize), | 5172 stream_(&buffer_, Reallocate, kInitialSize), |
| 5173 token_objects_(GrowableObjectArray::Handle( | 5173 token_objects_(GrowableObjectArray::Handle( |
| 5174 GrowableObjectArray::New(kInitialTokenCount, Heap::kOld))), | 5174 GrowableObjectArray::New(kInitialTokenCount, Heap::kOld))), |
| 5175 token_obj_(Object::Handle()), | 5175 token_obj_(Object::Handle()), |
| 5176 literal_token_(LiteralToken::Handle()), | 5176 literal_token_(LiteralToken::Handle()), |
| 5177 literal_str_(String::Handle()) { | 5177 literal_str_(String::Handle()) { |
| 5178 const String& empty_literal = String::Handle(); | 5178 const String& empty_literal = String::Handle(); |
| 5179 token_objects_.Add(empty_literal); | 5179 token_objects_.Add(empty_literal); |
| 5180 } | 5180 } |
| 5181 ~CompressedTokenStreamData() { | 5181 ~CompressedTokenStreamData() { |
| 5182 } | 5182 } |
| (...skipping 8456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13639 } | 13639 } |
| 13640 return result.raw(); | 13640 return result.raw(); |
| 13641 } | 13641 } |
| 13642 | 13642 |
| 13643 | 13643 |
| 13644 const char* WeakProperty::ToCString() const { | 13644 const char* WeakProperty::ToCString() const { |
| 13645 return "_WeakProperty"; | 13645 return "_WeakProperty"; |
| 13646 } | 13646 } |
| 13647 | 13647 |
| 13648 } // namespace dart | 13648 } // namespace dart |
| OLD | NEW |