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 7482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7493 void* GetDataStartAddress() const; | 7493 void* GetDataStartAddress() const; |
| 7494 static RawJSRegExp* FromDataStartAddress(void* data); | 7494 static RawJSRegExp* FromDataStartAddress(void* data); |
| 7495 const char* Flags() const; | 7495 const char* Flags() const; |
| 7496 | 7496 |
| 7497 virtual bool CanonicalizeEquals(const Instance& other) const; | 7497 virtual bool CanonicalizeEquals(const Instance& other) const; |
| 7498 | 7498 |
| 7499 static const intptr_t kBytesPerElement = 1; | 7499 static const intptr_t kBytesPerElement = 1; |
| 7500 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; | 7500 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
| 7501 | 7501 |
| 7502 static intptr_t InstanceSize() { | 7502 static intptr_t InstanceSize() { |
| 7503 ASSERT(sizeof(RawJSRegExp) == OFFSET_OF_RETURNED_VALUE(RawJSRegExp, data)); | 7503 ASSERT(sizeof(RawJSRegExp) == OFFSET_OF_RETURNED_VALUE(RawJSRegExp, data)); |
|
Vyacheslav Egorov (Google)
2015/04/08 21:14:07
dead assertion, in raw_object.h also dead member
Ivan Posva
2015/04/08 23:31:45
Done.
| |
| 7504 if (FLAG_use_jscre) { | |
| 7505 return 0; | |
| 7506 } | |
| 7507 return RoundedAllocationSize(sizeof(RawJSRegExp)); | 7504 return RoundedAllocationSize(sizeof(RawJSRegExp)); |
| 7508 } | 7505 } |
| 7509 | 7506 |
| 7510 static intptr_t InstanceSize(intptr_t len) { | 7507 static intptr_t InstanceSize(intptr_t len) { |
|
Vyacheslav Egorov (Google)
2015/04/08 21:14:07
Dead code.
Ivan Posva
2015/04/08 23:31:45
Done.
| |
| 7511 ASSERT(0 <= len && len <= kMaxElements); | 7508 ASSERT(0 <= len && len <= kMaxElements); |
| 7512 return RoundedAllocationSize( | 7509 return RoundedAllocationSize( |
| 7513 sizeof(RawJSRegExp) + (len * kBytesPerElement)); | 7510 sizeof(RawJSRegExp) + (len * kBytesPerElement)); |
| 7514 } | 7511 } |
| 7515 | 7512 |
| 7516 static RawJSRegExp* New(intptr_t length, Heap::Space space = Heap::kNew); | 7513 static RawJSRegExp* New(intptr_t length, Heap::Space space = Heap::kNew); |
|
Vyacheslav Egorov (Google)
2015/04/08 21:14:07
Length is a dead variable (always 0 now).
Ivan Posva
2015/04/08 23:31:45
Adjusted the remaining pieces in the VM dealing wi
| |
| 7517 | 7514 |
| 7518 private: | 7515 private: |
| 7519 void set_type(RegExType type) const { | 7516 void set_type(RegExType type) const { |
| 7520 StoreNonPointer(&raw_ptr()->type_flags_, | 7517 StoreNonPointer(&raw_ptr()->type_flags_, |
| 7521 TypeBits::update(type, raw_ptr()->type_flags_)); | 7518 TypeBits::update(type, raw_ptr()->type_flags_)); |
| 7522 } | 7519 } |
| 7523 void set_flags(intptr_t value) const { | 7520 void set_flags(intptr_t value) const { |
| 7524 StoreNonPointer(&raw_ptr()->type_flags_, | 7521 StoreNonPointer(&raw_ptr()->type_flags_, |
| 7525 FlagsBits::update(value, raw_ptr()->type_flags_)); | 7522 FlagsBits::update(value, raw_ptr()->type_flags_)); |
| 7526 } | 7523 } |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7794 | 7791 |
| 7795 | 7792 |
| 7796 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7793 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 7797 intptr_t index) { | 7794 intptr_t index) { |
| 7798 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7795 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 7799 } | 7796 } |
| 7800 | 7797 |
| 7801 } // namespace dart | 7798 } // namespace dart |
| 7802 | 7799 |
| 7803 #endif // VM_OBJECT_H_ | 7800 #endif // VM_OBJECT_H_ |
| OLD | NEW |