Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: src/code-stubs.h

Issue 12221064: Implement many KeyedStoreStubs using Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Final review feedback Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ast.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; 1305 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
1306 uint32_t bit_field_; 1306 uint32_t bit_field_;
1307 1307
1308 Major MajorKey() { return KeyedLoadElement; } 1308 Major MajorKey() { return KeyedLoadElement; }
1309 int MinorKey() { return bit_field_; } 1309 int MinorKey() { return bit_field_; }
1310 1310
1311 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); 1311 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub);
1312 }; 1312 };
1313 1313
1314 1314
1315 class KeyedStoreFastElementStub : public HydrogenCodeStub {
1316 public:
1317 KeyedStoreFastElementStub(bool is_js_array,
1318 ElementsKind elements_kind,
1319 KeyedAccessStoreMode mode) {
1320 bit_field_ = ElementsKindBits::encode(elements_kind) |
1321 IsJSArrayBits::encode(is_js_array) |
1322 StoreModeBits::encode(mode);
1323 }
1324
1325 Major MajorKey() { return KeyedStoreElement; }
1326 int MinorKey() { return bit_field_; }
1327
1328 bool is_js_array() const {
1329 return IsJSArrayBits::decode(bit_field_);
1330 }
1331
1332 ElementsKind elements_kind() const {
1333 return ElementsKindBits::decode(bit_field_);
1334 }
1335
1336 KeyedAccessStoreMode store_mode() const {
1337 return StoreModeBits::decode(bit_field_);
1338 }
1339
1340 virtual Handle<Code> GenerateCode();
1341
1342 virtual void InitializeInterfaceDescriptor(
1343 Isolate* isolate,
1344 CodeStubInterfaceDescriptor* descriptor);
1345
1346 private:
1347 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
1348 class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {};
1349 class IsJSArrayBits: public BitField<bool, 12, 1> {};
1350 uint32_t bit_field_;
1351
1352 DISALLOW_COPY_AND_ASSIGN(KeyedStoreFastElementStub);
1353 };
1354
1355
1315 class TransitionElementsKindStub : public HydrogenCodeStub { 1356 class TransitionElementsKindStub : public HydrogenCodeStub {
1316 public: 1357 public:
1317 TransitionElementsKindStub(ElementsKind from_kind, 1358 TransitionElementsKindStub(ElementsKind from_kind,
1318 ElementsKind to_kind) { 1359 ElementsKind to_kind) {
1319 bit_field_ = FromKindBits::encode(from_kind) | 1360 bit_field_ = FromKindBits::encode(from_kind) |
1320 ToKindBits::encode(to_kind); 1361 ToKindBits::encode(to_kind);
1321 } 1362 }
1322 1363
1323 ElementsKind from_kind() const { 1364 ElementsKind from_kind() const {
1324 return FromKindBits::decode(bit_field_); 1365 return FromKindBits::decode(bit_field_);
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 1660
1620 // The current function entry hook. 1661 // The current function entry hook.
1621 static FunctionEntryHook entry_hook_; 1662 static FunctionEntryHook entry_hook_;
1622 1663
1623 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 1664 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
1624 }; 1665 };
1625 1666
1626 } } // namespace v8::internal 1667 } } // namespace v8::internal
1627 1668
1628 #endif // V8_CODE_STUBS_H_ 1669 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698