OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 1298 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
1299 uint32_t bit_field_; | 1299 uint32_t bit_field_; |
1300 | 1300 |
1301 Major MajorKey() { return KeyedLoadElement; } | 1301 Major MajorKey() { return KeyedLoadElement; } |
1302 int MinorKey() { return bit_field_; } | 1302 int MinorKey() { return bit_field_; } |
1303 | 1303 |
1304 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); | 1304 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); |
1305 }; | 1305 }; |
1306 | 1306 |
1307 | 1307 |
| 1308 class KeyedStoreFastElementStub : public HydrogenCodeStub { |
| 1309 public: |
| 1310 KeyedStoreFastElementStub(bool is_js_array, |
| 1311 ElementsKind elements_kind, |
| 1312 KeyedAccessStoreMode mode) { |
| 1313 bit_field_ = ElementsKindBits::encode(elements_kind) | |
| 1314 IsJSArrayBits::encode(is_js_array) | |
| 1315 StoreModeBits::encode(mode); |
| 1316 } |
| 1317 |
| 1318 Major MajorKey() { return KeyedStoreElement; } |
| 1319 int MinorKey() { return bit_field_; } |
| 1320 |
| 1321 bool is_js_array() const { |
| 1322 return IsJSArrayBits::decode(bit_field_); |
| 1323 } |
| 1324 |
| 1325 ElementsKind elements_kind() const { |
| 1326 return ElementsKindBits::decode(bit_field_); |
| 1327 } |
| 1328 |
| 1329 KeyedAccessStoreMode store_mode() const { |
| 1330 return StoreModeBits::decode(bit_field_); |
| 1331 } |
| 1332 |
| 1333 virtual Handle<Code> GenerateCode(); |
| 1334 |
| 1335 virtual void InitializeInterfaceDescriptor( |
| 1336 Isolate* isolate, |
| 1337 CodeStubInterfaceDescriptor* descriptor); |
| 1338 |
| 1339 private: |
| 1340 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 1341 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {}; |
| 1342 class IsJSArrayBits: public BitField<bool, 12, 1> {}; |
| 1343 uint32_t bit_field_; |
| 1344 |
| 1345 DISALLOW_COPY_AND_ASSIGN(KeyedStoreFastElementStub); |
| 1346 }; |
| 1347 |
| 1348 |
1308 class TransitionElementsKindStub : public HydrogenCodeStub { | 1349 class TransitionElementsKindStub : public HydrogenCodeStub { |
1309 public: | 1350 public: |
1310 TransitionElementsKindStub(ElementsKind from_kind, | 1351 TransitionElementsKindStub(ElementsKind from_kind, |
1311 ElementsKind to_kind) { | 1352 ElementsKind to_kind) { |
1312 bit_field_ = FromKindBits::encode(from_kind) | | 1353 bit_field_ = FromKindBits::encode(from_kind) | |
1313 ToKindBits::encode(to_kind); | 1354 ToKindBits::encode(to_kind); |
1314 } | 1355 } |
1315 | 1356 |
1316 ElementsKind from_kind() const { | 1357 ElementsKind from_kind() const { |
1317 return FromKindBits::decode(bit_field_); | 1358 return FromKindBits::decode(bit_field_); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 | 1653 |
1613 // The current function entry hook. | 1654 // The current function entry hook. |
1614 static FunctionEntryHook entry_hook_; | 1655 static FunctionEntryHook entry_hook_; |
1615 | 1656 |
1616 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1657 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
1617 }; | 1658 }; |
1618 | 1659 |
1619 } } // namespace v8::internal | 1660 } } // namespace v8::internal |
1620 | 1661 |
1621 #endif // V8_CODE_STUBS_H_ | 1662 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |