Chromium Code Reviews| 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 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1266 | 1266 |
| 1267 bool is_native() const { return NativeBit::decode(raw_ptr()->kind_tag_); } | 1267 bool is_native() const { return NativeBit::decode(raw_ptr()->kind_tag_); } |
| 1268 void set_is_native(bool value) const; | 1268 void set_is_native(bool value) const; |
| 1269 | 1269 |
| 1270 bool is_abstract() const { return AbstractBit::decode(raw_ptr()->kind_tag_); } | 1270 bool is_abstract() const { return AbstractBit::decode(raw_ptr()->kind_tag_); } |
| 1271 void set_is_abstract(bool value) const; | 1271 void set_is_abstract(bool value) const; |
| 1272 | 1272 |
| 1273 bool IsInlineable() const; | 1273 bool IsInlineable() const; |
| 1274 void set_is_inlinable(bool value) const; | 1274 void set_is_inlinable(bool value) const; |
| 1275 | 1275 |
| 1276 enum IntrinsicKind { | |
| 1277 kUnknownIntrinsic, // Initial value. | |
|
siva
2012/11/01 23:04:06
kUnknownIntrinsic = 0,
srdjan
2012/11/01 23:08:18
Done.
| |
| 1278 kIsIntrinsic, | |
| 1279 kIsNotIntrinsic, | |
| 1280 }; | |
| 1281 | |
| 1282 IntrinsicKind intrinsic_kind() const { | |
| 1283 return IntrinsicKindBits::decode(raw_ptr()->kind_tag_); | |
| 1284 } | |
| 1285 void set_intrinsic_kind(IntrinsicKind value) const; | |
| 1286 | |
| 1276 bool HasOptimizedCode() const; | 1287 bool HasOptimizedCode() const; |
| 1277 | 1288 |
| 1278 // Returns true if the argument counts are valid for calling this function. | 1289 // Returns true if the argument counts are valid for calling this function. |
| 1279 // Otherwise, it returns false and the reason (if error_message is not NULL). | 1290 // Otherwise, it returns false and the reason (if error_message is not NULL). |
| 1280 bool AreValidArgumentCounts(int num_arguments, | 1291 bool AreValidArgumentCounts(int num_arguments, |
| 1281 int num_named_arguments, | 1292 int num_named_arguments, |
| 1282 String* error_message) const; | 1293 String* error_message) const; |
| 1283 | 1294 |
| 1284 // Returns true if the total argument count and the names of optional | 1295 // Returns true if the total argument count and the names of optional |
| 1285 // arguments are valid for calling this function. | 1296 // arguments are valid for calling this function. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1395 static RawFunction* NewClosureFunction(const String& name, | 1406 static RawFunction* NewClosureFunction(const String& name, |
| 1396 const Function& parent, | 1407 const Function& parent, |
| 1397 intptr_t token_pos); | 1408 intptr_t token_pos); |
| 1398 | 1409 |
| 1399 static const int kCtorPhaseInit = 1 << 0; | 1410 static const int kCtorPhaseInit = 1 << 0; |
| 1400 static const int kCtorPhaseBody = 1 << 1; | 1411 static const int kCtorPhaseBody = 1 << 1; |
| 1401 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); | 1412 static const int kCtorPhaseAll = (kCtorPhaseInit | kCtorPhaseBody); |
| 1402 | 1413 |
| 1403 private: | 1414 private: |
| 1404 enum KindTagBits { | 1415 enum KindTagBits { |
| 1405 kStaticBit = 1, | 1416 kStaticBit = 0, |
| 1406 kConstBit, | 1417 kConstBit = 1, |
| 1407 kOptimizableBit, | 1418 kOptimizableBit = 2, |
| 1408 kInlinableBit, | 1419 kInlinableBit = 3, |
| 1409 kHasFinallyBit, | 1420 kHasFinallyBit = 4, |
| 1410 kNativeBit, | 1421 kNativeBit = 5, |
| 1411 kAbstractBit, | 1422 kAbstractBit = 6, |
| 1412 kExternalBit, | 1423 kExternalBit = 7, |
| 1413 kKindTagBit, | 1424 kIntrinsicTagBit = 8, |
| 1425 kIntrinsicTagSize = 2, | |
| 1426 kKindTagBit = 10, | |
| 1414 kKindTagSize = 4, | 1427 kKindTagSize = 4, |
| 1415 }; | 1428 }; |
| 1416 class StaticBit : public BitField<bool, kStaticBit, 1> {}; | 1429 class StaticBit : public BitField<bool, kStaticBit, 1> {}; |
| 1417 class ConstBit : public BitField<bool, kConstBit, 1> {}; | 1430 class ConstBit : public BitField<bool, kConstBit, 1> {}; |
| 1418 class OptimizableBit : public BitField<bool, kOptimizableBit, 1> {}; | 1431 class OptimizableBit : public BitField<bool, kOptimizableBit, 1> {}; |
| 1419 class InlinableBit : public BitField<bool, kInlinableBit, 1> {}; | 1432 class InlinableBit : public BitField<bool, kInlinableBit, 1> {}; |
| 1420 class HasFinallyBit : public BitField<bool, kHasFinallyBit, 1> {}; | 1433 class HasFinallyBit : public BitField<bool, kHasFinallyBit, 1> {}; |
| 1421 class NativeBit : public BitField<bool, kNativeBit, 1> {}; | 1434 class NativeBit : public BitField<bool, kNativeBit, 1> {}; |
| 1422 class AbstractBit : public BitField<bool, kAbstractBit, 1> {}; | 1435 class AbstractBit : public BitField<bool, kAbstractBit, 1> {}; |
| 1423 class ExternalBit : public BitField<bool, kExternalBit, 1> {}; | 1436 class ExternalBit : public BitField<bool, kExternalBit, 1> {}; |
| 1437 class IntrinsicKindBits : | |
| 1438 public BitField<Function::IntrinsicKind, | |
| 1439 kIntrinsicTagBit, kIntrinsicTagSize> {}; // NOLINT | |
| 1424 class KindBits : | 1440 class KindBits : |
| 1425 public BitField<RawFunction::Kind, kKindTagBit, kKindTagSize> {}; // NOLINT | 1441 public BitField<RawFunction::Kind, kKindTagBit, kKindTagSize> {}; // NOLINT |
| 1426 | 1442 |
| 1427 void set_name(const String& value) const; | 1443 void set_name(const String& value) const; |
| 1428 void set_kind(RawFunction::Kind value) const; | 1444 void set_kind(RawFunction::Kind value) const; |
| 1429 void set_is_static(bool value) const; | 1445 void set_is_static(bool value) const; |
| 1430 void set_is_const(bool value) const; | 1446 void set_is_const(bool value) const; |
| 1431 void set_is_external(bool value) const; | 1447 void set_is_external(bool value) const; |
| 1432 void set_parent_function(const Function& value) const; | 1448 void set_parent_function(const Function& value) const; |
| 1433 void set_owner(const Object& value) const; | 1449 void set_owner(const Object& value) const; |
| (...skipping 4297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5731 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5747 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5732 return false; | 5748 return false; |
| 5733 } | 5749 } |
| 5734 } | 5750 } |
| 5735 return true; | 5751 return true; |
| 5736 } | 5752 } |
| 5737 | 5753 |
| 5738 } // namespace dart | 5754 } // namespace dart |
| 5739 | 5755 |
| 5740 #endif // VM_OBJECT_H_ | 5756 #endif // VM_OBJECT_H_ |
| OLD | NEW |