OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 <map> | 5 #include <map> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "vm/kernel_to_il.h" | 9 #include "vm/kernel_to_il.h" |
10 | 10 |
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 } | 1024 } |
1025 | 1025 |
1026 | 1026 |
1027 dart::String& TranslationHelper::DartString(String* content, | 1027 dart::String& TranslationHelper::DartString(String* content, |
1028 Heap::Space space) { | 1028 Heap::Space space) { |
1029 return dart::String::ZoneHandle( | 1029 return dart::String::ZoneHandle( |
1030 Z, dart::String::FromUTF8(content->buffer(), content->size(), space)); | 1030 Z, dart::String::FromUTF8(content->buffer(), content->size(), space)); |
1031 } | 1031 } |
1032 | 1032 |
1033 | 1033 |
| 1034 dart::String& TranslationHelper::DartString(const uint8_t* utf8_array, |
| 1035 intptr_t len, |
| 1036 Heap::Space space) { |
| 1037 return dart::String::ZoneHandle( |
| 1038 Z, dart::String::FromUTF8(utf8_array, len, space)); |
| 1039 } |
| 1040 |
| 1041 |
1034 const dart::String& TranslationHelper::DartSymbol(const char* content) const { | 1042 const dart::String& TranslationHelper::DartSymbol(const char* content) const { |
1035 return dart::String::ZoneHandle(Z, Symbols::New(thread_, content)); | 1043 return dart::String::ZoneHandle(Z, Symbols::New(thread_, content)); |
1036 } | 1044 } |
1037 | 1045 |
1038 | 1046 |
1039 dart::String& TranslationHelper::DartSymbol(String* content) const { | 1047 dart::String& TranslationHelper::DartSymbol(String* content) const { |
1040 return dart::String::ZoneHandle( | 1048 return dart::String::ZoneHandle( |
1041 Z, dart::Symbols::FromUTF8(thread_, content->buffer(), content->size())); | 1049 Z, dart::Symbols::FromUTF8(thread_, content->buffer(), content->size())); |
1042 } | 1050 } |
1043 | 1051 |
(...skipping 3219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4263 } | 4271 } |
4264 | 4272 |
4265 | 4273 |
4266 void FlowGraphBuilder::VisitBigintLiteral(BigintLiteral* node) { | 4274 void FlowGraphBuilder::VisitBigintLiteral(BigintLiteral* node) { |
4267 const dart::String& value = H.DartString(node->value()); | 4275 const dart::String& value = H.DartString(node->value()); |
4268 fragment_ = Constant(Integer::ZoneHandle(Z, Integer::New(value, Heap::kOld))); | 4276 fragment_ = Constant(Integer::ZoneHandle(Z, Integer::New(value, Heap::kOld))); |
4269 } | 4277 } |
4270 | 4278 |
4271 | 4279 |
4272 void FlowGraphBuilder::VisitDoubleLiteral(DoubleLiteral* node) { | 4280 void FlowGraphBuilder::VisitDoubleLiteral(DoubleLiteral* node) { |
4273 fragment_ = Constant(constant_evaluator_.EvaluateExpression(node)); | 4281 fragment_ = streaming_flow_graph_builder_->BuildAt(node->kernel_offset()); |
4274 } | 4282 } |
4275 | 4283 |
4276 | 4284 |
4277 void FlowGraphBuilder::VisitStringLiteral(StringLiteral* node) { | 4285 void FlowGraphBuilder::VisitStringLiteral(StringLiteral* node) { |
4278 fragment_ = streaming_flow_graph_builder_->BuildAt(node->kernel_offset()); | 4286 fragment_ = streaming_flow_graph_builder_->BuildAt(node->kernel_offset()); |
4279 } | 4287 } |
4280 | 4288 |
4281 | 4289 |
4282 void FlowGraphBuilder::VisitSymbolLiteral(SymbolLiteral* node) { | 4290 void FlowGraphBuilder::VisitSymbolLiteral(SymbolLiteral* node) { |
4283 fragment_ = Constant(constant_evaluator_.EvaluateExpression(node)); | 4291 fragment_ = Constant(constant_evaluator_.EvaluateExpression(node)); |
(...skipping 2176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6460 thread->clear_sticky_error(); | 6468 thread->clear_sticky_error(); |
6461 return error.raw(); | 6469 return error.raw(); |
6462 } | 6470 } |
6463 } | 6471 } |
6464 | 6472 |
6465 | 6473 |
6466 } // namespace kernel | 6474 } // namespace kernel |
6467 } // namespace dart | 6475 } // namespace dart |
6468 | 6476 |
6469 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 6477 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
OLD | NEW |