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 #ifndef VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1225 RawAbstractType* ParameterTypeAt(intptr_t index) const; | 1225 RawAbstractType* ParameterTypeAt(intptr_t index) const; |
1226 void SetParameterTypeAt(intptr_t index, const AbstractType& value) const; | 1226 void SetParameterTypeAt(intptr_t index, const AbstractType& value) const; |
1227 void set_parameter_types(const Array& value) const; | 1227 void set_parameter_types(const Array& value) const; |
1228 | 1228 |
1229 // Parameter names are valid for all valid parameter indices, and are not | 1229 // Parameter names are valid for all valid parameter indices, and are not |
1230 // limited to named optional parameters. | 1230 // limited to named optional parameters. |
1231 RawString* ParameterNameAt(intptr_t index) const; | 1231 RawString* ParameterNameAt(intptr_t index) const; |
1232 void SetParameterNameAt(intptr_t index, const String& value) const; | 1232 void SetParameterNameAt(intptr_t index, const String& value) const; |
1233 void set_parameter_names(const Array& value) const; | 1233 void set_parameter_names(const Array& value) const; |
1234 | 1234 |
1235 RawCode* code() const { return raw_ptr()->code_; } | |
1236 // Sets function's code and code's function. | 1235 // Sets function's code and code's function. |
1237 void SetCode(const Code& value) const; | 1236 void SetCode(const Code& value) const; |
1238 RawCode* unoptimized_code() const { return raw_ptr()->unoptimized_code_; } | 1237 RawCode* unoptimized_code() const { return raw_ptr()->unoptimized_code_; } |
1239 void set_unoptimized_code(const Code& value) const; | 1238 void set_unoptimized_code(const Code& value) const; |
1240 static intptr_t code_offset() { return OFFSET_OF(RawFunction, code_); } | 1239 static intptr_t code_offset() { return OFFSET_OF(RawFunction, code_); } |
1241 inline bool HasCode() const; | 1240 inline bool HasCode() const; |
1242 | 1241 |
1243 RawContextScope* context_scope() const { return raw_ptr()->context_scope_; } | 1242 RawContextScope* context_scope() const { return raw_ptr()->context_scope_; } |
1244 void set_context_scope(const ContextScope& value) const; | 1243 void set_context_scope(const ContextScope& value) const; |
1245 | 1244 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1351 } | 1350 } |
1352 void set_deoptimization_counter(intptr_t value) const { | 1351 void set_deoptimization_counter(intptr_t value) const { |
1353 raw_ptr()->deoptimization_counter_ = value; | 1352 raw_ptr()->deoptimization_counter_ = value; |
1354 } | 1353 } |
1355 | 1354 |
1356 bool is_optimizable() const { | 1355 bool is_optimizable() const { |
1357 return raw_ptr()->is_optimizable_; | 1356 return raw_ptr()->is_optimizable_; |
1358 } | 1357 } |
1359 void set_is_optimizable(bool value) const; | 1358 void set_is_optimizable(bool value) const; |
1360 | 1359 |
1360 bool HasOptimizedCode() const; | |
1361 | |
1361 intptr_t NumberOfParameters() const; | 1362 intptr_t NumberOfParameters() const; |
1362 | 1363 |
1363 bool AreValidArgumentCounts(int num_arguments, int num_named_arguments) const; | 1364 bool AreValidArgumentCounts(int num_arguments, int num_named_arguments) const; |
1364 bool AreValidArguments(int num_arguments, const Array& argument_names) const; | 1365 bool AreValidArguments(int num_arguments, const Array& argument_names) const; |
1365 | 1366 |
1366 // Fully qualified name uniquely identifying the function under gdb and during | 1367 // Fully qualified name uniquely identifying the function under gdb and during |
1367 // ast printing. The special ':' character, if present, is replaced by '_'. | 1368 // ast printing. The special ':' character, if present, is replaced by '_'. |
1368 const char* ToFullyQualifiedCString() const; | 1369 const char* ToFullyQualifiedCString() const; |
1369 | 1370 |
1370 // Returns true if this function has parameters that are compatible with the | 1371 // Returns true if this function has parameters that are compatible with the |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1446 // function. | 1447 // function. |
1447 // The function and the class share the same given name. | 1448 // The function and the class share the same given name. |
1448 static RawFunction* NewClosureFunction(const String& name, | 1449 static RawFunction* NewClosureFunction(const String& name, |
1449 const Function& parent, | 1450 const Function& parent, |
1450 intptr_t token_index); | 1451 intptr_t token_index); |
1451 | 1452 |
1452 static const int kCtorPhaseInit = 1 << 0; | 1453 static const int kCtorPhaseInit = 1 << 0; |
1453 static const int kCtorPhaseBody = 1 << 1; | 1454 static const int kCtorPhaseBody = 1 << 1; |
1454 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); | 1455 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); |
1455 | 1456 |
1457 // Return the most recently compiled and installed code for this function. | |
1458 // It is not the only Code object that point to this function. | |
hausner
2012/02/28 00:37:09
points
srdjan
2012/02/28 01:18:59
Done.
| |
1459 RawCode* CurrentCode() const { return raw_ptr()->code_; } | |
1460 | |
1456 private: | 1461 private: |
1462 RawCode* code() const { return raw_ptr()->code_; } | |
siva
2012/02/28 00:52:20
Why do you want to retain this accessor. There see
srdjan
2012/02/28 01:18:59
Done.
| |
1457 void set_name(const String& value) const; | 1463 void set_name(const String& value) const; |
1458 void set_kind(RawFunction::Kind value) const; | 1464 void set_kind(RawFunction::Kind value) const; |
1459 void set_is_static(bool is_static) const; | 1465 void set_is_static(bool is_static) const; |
1460 void set_is_const(bool is_const) const; | 1466 void set_is_const(bool is_const) const; |
1461 void set_parent_function(const Function& value) const; | 1467 void set_parent_function(const Function& value) const; |
1462 void set_token_index(intptr_t value) const; | 1468 void set_token_index(intptr_t value) const; |
1463 void set_implicit_closure_function(const Function& value) const; | 1469 void set_implicit_closure_function(const Function& value) const; |
1464 static RawFunction* New(); | 1470 static RawFunction* New(); |
1465 | 1471 |
1466 RawString* BuildSignature(bool instantiate, | 1472 RawString* BuildSignature(bool instantiate, |
(...skipping 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3742 } | 3748 } |
3743 | 3749 |
3744 | 3750 |
3745 void Context::SetAt(intptr_t index, const Instance& value) const { | 3751 void Context::SetAt(intptr_t index, const Instance& value) const { |
3746 StorePointer(InstanceAddr(index), value.raw()); | 3752 StorePointer(InstanceAddr(index), value.raw()); |
3747 } | 3753 } |
3748 | 3754 |
3749 } // namespace dart | 3755 } // namespace dart |
3750 | 3756 |
3751 #endif // VM_OBJECT_H_ | 3757 #endif // VM_OBJECT_H_ |
OLD | NEW |