Chromium Code Reviews| 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 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1254 void AddSimulate(BailoutId id, RemovableSimulate removable = FIXED_SIMULATE); | 1254 void AddSimulate(BailoutId id, RemovableSimulate removable = FIXED_SIMULATE); |
| 1255 | 1255 |
| 1256 int position() const { return position_; } | 1256 int position() const { return position_; } |
| 1257 | 1257 |
| 1258 protected: | 1258 protected: |
| 1259 virtual bool BuildGraph() = 0; | 1259 virtual bool BuildGraph() = 0; |
| 1260 | 1260 |
| 1261 HBasicBlock* CreateBasicBlock(HEnvironment* env); | 1261 HBasicBlock* CreateBasicBlock(HEnvironment* env); |
| 1262 HBasicBlock* CreateLoopHeaderBlock(); | 1262 HBasicBlock* CreateLoopHeaderBlock(); |
| 1263 | 1263 |
| 1264 HValue* BuildGetElementsKind(HValue* object); | |
| 1265 | |
| 1264 HValue* BuildCheckHeapObject(HValue* object); | 1266 HValue* BuildCheckHeapObject(HValue* object); |
| 1265 HValue* BuildCheckMap(HValue* obj, Handle<Map> map); | 1267 HValue* BuildCheckMap(HValue* obj, Handle<Map> map); |
| 1266 HValue* BuildCheckString(HValue* string); | 1268 HValue* BuildCheckString(HValue* string); |
| 1267 HValue* BuildWrapReceiver(HValue* object, HValue* function); | 1269 HValue* BuildWrapReceiver(HValue* object, HValue* function); |
| 1268 | 1270 |
| 1269 // Building common constructs | 1271 // Building common constructs |
| 1270 HValue* BuildCheckForCapacityGrow(HValue* object, | 1272 HValue* BuildCheckForCapacityGrow(HValue* object, |
| 1271 HValue* elements, | 1273 HValue* elements, |
| 1272 ElementsKind kind, | 1274 ElementsKind kind, |
| 1273 HValue* length, | 1275 HValue* length, |
| 1274 HValue* key, | 1276 HValue* key, |
| 1275 bool is_js_array); | 1277 bool is_js_array); |
| 1276 | 1278 |
| 1277 HValue* BuildCopyElementsOnWrite(HValue* object, | 1279 HValue* BuildCopyElementsOnWrite(HValue* object, |
| 1278 HValue* elements, | 1280 HValue* elements, |
| 1279 ElementsKind kind, | 1281 ElementsKind kind, |
| 1280 HValue* length); | 1282 HValue* length); |
| 1281 | 1283 |
| 1282 void BuildTransitionElementsKind(HValue* object, | 1284 void BuildTransitionElementsKind(HValue* object, |
| 1283 HValue* map, | 1285 HValue* map, |
| 1284 ElementsKind from_kind, | 1286 ElementsKind from_kind, |
| 1285 ElementsKind to_kind, | 1287 ElementsKind to_kind, |
| 1286 bool is_jsarray); | 1288 bool is_jsarray); |
| 1287 | 1289 |
| 1288 HValue* BuildNumberToString(HValue* object, Handle<Type> type); | 1290 HValue* BuildNumberToString(HValue* object, Handle<Type> type); |
| 1289 | 1291 |
| 1292 void BuildReceiverCheck(HValue* receiver, | |
| 1293 int bit_field_mask); | |
| 1294 | |
| 1295 HValue* BuildHashToIndex(HValue *hash); | |
|
Toon Verwaest
2013/12/04 17:29:26
nit: move * to HValue.
danno
2014/06/06 15:43:51
Done.
| |
| 1296 | |
| 1297 // Checks a key value that's being used for a keyed element access context. If | |
| 1298 // the key is a index, i.e. a smi or a number in a unique string with a cached | |
| 1299 // numeric value, the "true" of the continuation is joined. Otherwise, | |
| 1300 // if the key is a name or a unique string, the "false" of the continuation is | |
| 1301 // joined. Otherwise, a deoptimization is triggered. In both paths of the | |
| 1302 // continuation, the key is pushed on the top of the environment. | |
| 1303 void BuildKeyedIndexCheck(HValue* key, | |
| 1304 HIfContinuation* join_continuation); | |
| 1305 | |
| 1306 // Checks the properties of an object if they are in dictionary case, in which | |
| 1307 // case "true" of continuation is taken, otherwise the "false" | |
| 1308 void BuildCheckForDictionaryProperties(HValue* object, | |
| 1309 HIfContinuation* continuation); | |
| 1310 | |
| 1311 void BuildGlobalInstanceTypeCheck(HValue* receiver); | |
| 1312 | |
| 1313 HValue* BuildKeyedLookupCacheHash(HValue* object, | |
| 1314 HValue* key); | |
| 1315 | |
| 1290 HValue* BuildUncheckedDictionaryElementLoad(HValue* receiver, | 1316 HValue* BuildUncheckedDictionaryElementLoad(HValue* receiver, |
| 1291 HValue* key); | 1317 HValue* elements, |
| 1318 HValue* key, | |
| 1319 HValue* hash); | |
| 1292 | 1320 |
| 1293 // Computes the size for a sequential string of the given length and encoding. | 1321 // Computes the size for a sequential string of the given length and encoding. |
| 1294 HValue* BuildSeqStringSizeFor(HValue* length, | 1322 HValue* BuildSeqStringSizeFor(HValue* length, |
| 1295 String::Encoding encoding); | 1323 String::Encoding encoding); |
| 1296 // Copies characters from one sequential string to another. | 1324 // Copies characters from one sequential string to another. |
| 1297 void BuildCopySeqStringChars(HValue* src, | 1325 void BuildCopySeqStringChars(HValue* src, |
| 1298 HValue* src_offset, | 1326 HValue* src_offset, |
| 1299 String::Encoding src_encoding, | 1327 String::Encoding src_encoding, |
| 1300 HValue* dst, | 1328 HValue* dst, |
| 1301 HValue* dst_offset, | 1329 HValue* dst_offset, |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1598 HInstruction* increment_; | 1626 HInstruction* increment_; |
| 1599 HPhi* phi_; | 1627 HPhi* phi_; |
| 1600 HBasicBlock* header_block_; | 1628 HBasicBlock* header_block_; |
| 1601 HBasicBlock* body_block_; | 1629 HBasicBlock* body_block_; |
| 1602 HBasicBlock* exit_block_; | 1630 HBasicBlock* exit_block_; |
| 1603 HBasicBlock* exit_trampoline_block_; | 1631 HBasicBlock* exit_trampoline_block_; |
| 1604 Direction direction_; | 1632 Direction direction_; |
| 1605 bool finished_; | 1633 bool finished_; |
| 1606 }; | 1634 }; |
| 1607 | 1635 |
| 1636 template <class A, class P1> | |
| 1637 void DeoptimizeIf(P1 p1, char* const reason) { | |
| 1638 IfBuilder builder(this); | |
| 1639 builder.If<A>(p1); | |
| 1640 builder.ThenDeopt(reason); | |
| 1641 } | |
| 1642 | |
| 1643 template <class A, class P1, class P2> | |
| 1644 void DeoptimizeIf(P1 p1, P2 p2, const char* reason) { | |
| 1645 IfBuilder builder(this); | |
| 1646 builder.If<A>(p1, p2); | |
| 1647 builder.ThenDeopt(reason); | |
| 1648 } | |
| 1649 | |
| 1650 template <class A, class P1, class P2, class P3> | |
| 1651 void DeoptimizeIf(P1 p1, P2 p2, P3 p3, const char* reason) { | |
| 1652 IfBuilder builder(this); | |
| 1653 builder.If<A>(p1, p2, p3); | |
| 1654 builder.ThenDeopt(reason); | |
| 1655 } | |
| 1656 | |
| 1608 HValue* BuildNewElementsCapacity(HValue* old_capacity); | 1657 HValue* BuildNewElementsCapacity(HValue* old_capacity); |
| 1609 | 1658 |
| 1610 void BuildNewSpaceArrayCheck(HValue* length, | 1659 void BuildNewSpaceArrayCheck(HValue* length, |
| 1611 ElementsKind kind); | 1660 ElementsKind kind); |
| 1612 | 1661 |
| 1613 class JSArrayBuilder V8_FINAL { | 1662 class JSArrayBuilder V8_FINAL { |
| 1614 public: | 1663 public: |
| 1615 JSArrayBuilder(HGraphBuilder* builder, | 1664 JSArrayBuilder(HGraphBuilder* builder, |
| 1616 ElementsKind kind, | 1665 ElementsKind kind, |
| 1617 HValue* allocation_site_payload, | 1666 HValue* allocation_site_payload, |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2630 } | 2679 } |
| 2631 | 2680 |
| 2632 private: | 2681 private: |
| 2633 HGraphBuilder* builder_; | 2682 HGraphBuilder* builder_; |
| 2634 }; | 2683 }; |
| 2635 | 2684 |
| 2636 | 2685 |
| 2637 } } // namespace v8::internal | 2686 } } // namespace v8::internal |
| 2638 | 2687 |
| 2639 #endif // V8_HYDROGEN_H_ | 2688 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |