| 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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 } | 2046 } |
| 2047 | 2047 |
| 2048 | 2048 |
| 2049 // List of recognized list factories in core lib: | 2049 // List of recognized list factories in core lib: |
| 2050 // (factory-name-symbol, result-cid, fingerprint). | 2050 // (factory-name-symbol, result-cid, fingerprint). |
| 2051 // TODO(srdjan): Store the values in the snapshot instead. | 2051 // TODO(srdjan): Store the values in the snapshot instead. |
| 2052 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ | 2052 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ |
| 2053 V(ObjectArrayFactory, kArrayCid, 97987288) \ | 2053 V(ObjectArrayFactory, kArrayCid, 97987288) \ |
| 2054 V(GrowableObjectArrayWithData, kGrowableObjectArrayCid, 816132033) \ | 2054 V(GrowableObjectArrayWithData, kGrowableObjectArrayCid, 816132033) \ |
| 2055 V(GrowableObjectArrayFactory, kGrowableObjectArrayCid, 552407276) \ | 2055 V(GrowableObjectArrayFactory, kGrowableObjectArrayCid, 552407276) \ |
| 2056 V(Int8ListFactory, kTypedDataInt8ArrayCid, 2066002614) \ | 2056 V(Int8ListFactory, kTypedDataInt8ArrayCid, 1299195009) \ |
| 2057 V(Uint8ListFactory, kTypedDataUint8ArrayCid, 1493118613) \ | 2057 V(Uint8ListFactory, kTypedDataUint8ArrayCid, 1493118613) \ |
| 2058 V(Uint8ClampedListFactory, kTypedDataUint8ClampedArrayCid, 244333676) \ | 2058 V(Uint8ClampedListFactory, kTypedDataUint8ClampedArrayCid, 642014193) \ |
| 2059 V(Int16ListFactory, kTypedDataInt16ArrayCid, 335889889) \ | 2059 V(Int16ListFactory, kTypedDataInt16ArrayCid, 1346619471) \ |
| 2060 V(Uint16ListFactory, kTypedDataUint16ArrayCid, 1374024153) \ | 2060 V(Uint16ListFactory, kTypedDataUint16ArrayCid, 1374024153) \ |
| 2061 V(Int32ListFactory, kTypedDataInt32ArrayCid, 1615677219) \ | 2061 V(Int32ListFactory, kTypedDataInt32ArrayCid, 1583592980) \ |
| 2062 V(Uint32ListFactory, kTypedDataUint32ArrayCid, 1239540305) \ | 2062 V(Uint32ListFactory, kTypedDataUint32ArrayCid, 1940214615) \ |
| 2063 V(Int64ListFactory, kTypedDataInt64ArrayCid, 993438946) \ | 2063 V(Int64ListFactory, kTypedDataInt64ArrayCid, 108181413) \ |
| 2064 V(Uint64ListFactory, kTypedDataUint64ArrayCid, 1830907325) \ | 2064 V(Uint64ListFactory, kTypedDataUint64ArrayCid, 375587484) \ |
| 2065 V(Float64ListFactory, kTypedDataFloat64ArrayCid, 1236037424) \ | 2065 V(Float64ListFactory, kTypedDataFloat64ArrayCid, 919047725) \ |
| 2066 V(Float32ListFactory, kTypedDataFloat32ArrayCid, 570814412) \ | 2066 V(Float32ListFactory, kTypedDataFloat32ArrayCid, 1038684997) \ |
| 2067 V(Float32x4ListFactory, kTypedDataFloat32x4ArrayCid, 173774085) \ | 2067 V(Float32x4ListFactory, kTypedDataFloat32x4ArrayCid, 801641591) \ |
| 2068 | 2068 |
| 2069 | 2069 |
| 2070 // Class that recognizes factories and returns corresponding result cid. | 2070 // Class that recognizes factories and returns corresponding result cid. |
| 2071 class FactoryRecognizer : public AllStatic { | 2071 class FactoryRecognizer : public AllStatic { |
| 2072 public: | 2072 public: |
| 2073 // Return kDynamicCid if factory is not recognized. | 2073 // Return kDynamicCid if factory is not recognized. |
| 2074 static intptr_t ResultCid(const Function& factory) { | 2074 static intptr_t ResultCid(const Function& factory) { |
| 2075 ASSERT(factory.IsFactory()); | 2075 ASSERT(factory.IsFactory()); |
| 2076 const Class& function_class = Class::Handle(factory.Owner()); | 2076 const Class& function_class = Class::Handle(factory.Owner()); |
| 2077 const Library& lib = Library::Handle(function_class.library()); | 2077 const Library& lib = Library::Handle(function_class.library()); |
| (...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3381 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3381 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3382 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3382 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3383 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3383 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3384 const Error& error = Error::Handle( | 3384 const Error& error = Error::Handle( |
| 3385 LanguageError::New(String::Handle(String::New(chars)))); | 3385 LanguageError::New(String::Handle(String::New(chars)))); |
| 3386 Isolate::Current()->long_jump_base()->Jump(1, error); | 3386 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3387 } | 3387 } |
| 3388 | 3388 |
| 3389 | 3389 |
| 3390 } // namespace dart | 3390 } // namespace dart |
| OLD | NEW |