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

Side by Side Diff: src/hydrogen-instructions.h

Issue 20767002: Merge 15827, 15842, and 15912 into 3.19 (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.19
Patch Set: Final version Created 7 years, 5 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/hydrogen-gvn.cc ('k') | src/hydrogen-instructions.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 15 matching lines...) Expand all
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 28 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
29 #define V8_HYDROGEN_INSTRUCTIONS_H_ 29 #define V8_HYDROGEN_INSTRUCTIONS_H_
30 30
31 #include "v8.h" 31 #include "v8.h"
32 32
33 #include "allocation.h" 33 #include "allocation.h"
34 #include "code-stubs.h" 34 #include "code-stubs.h"
35 #include "data-flow.h" 35 #include "data-flow.h"
36 #include "deoptimizer.h"
36 #include "small-pointer-list.h" 37 #include "small-pointer-list.h"
37 #include "string-stream.h" 38 #include "string-stream.h"
38 #include "v8conversions.h" 39 #include "v8conversions.h"
39 #include "v8utils.h" 40 #include "v8utils.h"
40 #include "zone.h" 41 #include "zone.h"
41 42
42 namespace v8 { 43 namespace v8 {
43 namespace internal { 44 namespace internal {
44 45
45 // Forward declarations. 46 // Forward declarations.
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 V(PushArgument) \ 156 V(PushArgument) \
156 V(Random) \ 157 V(Random) \
157 V(RegExpLiteral) \ 158 V(RegExpLiteral) \
158 V(Return) \ 159 V(Return) \
159 V(Ror) \ 160 V(Ror) \
160 V(Sar) \ 161 V(Sar) \
161 V(SeqStringSetChar) \ 162 V(SeqStringSetChar) \
162 V(Shl) \ 163 V(Shl) \
163 V(Shr) \ 164 V(Shr) \
164 V(Simulate) \ 165 V(Simulate) \
165 V(SoftDeoptimize) \
166 V(StackCheck) \ 166 V(StackCheck) \
167 V(StoreContextSlot) \ 167 V(StoreContextSlot) \
168 V(StoreGlobalCell) \ 168 V(StoreGlobalCell) \
169 V(StoreGlobalGeneric) \ 169 V(StoreGlobalGeneric) \
170 V(StoreKeyed) \ 170 V(StoreKeyed) \
171 V(StoreKeyedGeneric) \ 171 V(StoreKeyedGeneric) \
172 V(StoreNamedField) \ 172 V(StoreNamedField) \
173 V(StoreNamedGeneric) \ 173 V(StoreNamedGeneric) \
174 V(StringAdd) \ 174 V(StringAdd) \
175 V(StringCharCodeAt) \ 175 V(StringCharCodeAt) \
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 HValue* related_value) 1475 HValue* related_value)
1476 : relation_(relation) { 1476 : relation_(relation) {
1477 SetOperandAt(0, constrained_value); 1477 SetOperandAt(0, constrained_value);
1478 SetOperandAt(1, related_value); 1478 SetOperandAt(1, related_value);
1479 } 1479 }
1480 1480
1481 NumericRelation relation_; 1481 NumericRelation relation_;
1482 }; 1482 };
1483 1483
1484 1484
1485 // We insert soft-deoptimize when we hit code with unknown typefeedback, 1485 class HDeoptimize: public HTemplateInstruction<0> {
1486 // so that we get a chance of re-optimizing with useful typefeedback.
1487 // HSoftDeoptimize does not end a basic block as opposed to HDeoptimize.
1488 class HSoftDeoptimize: public HTemplateInstruction<0> {
1489 public: 1486 public:
1487 explicit HDeoptimize(Deoptimizer::BailoutType type) : type_(type) {}
1488
1490 virtual Representation RequiredInputRepresentation(int index) { 1489 virtual Representation RequiredInputRepresentation(int index) {
1491 return Representation::None(); 1490 return Representation::None();
1492 } 1491 }
1493 1492
1494 DECLARE_CONCRETE_INSTRUCTION(SoftDeoptimize) 1493 Deoptimizer::BailoutType type() { return type_; }
1494
1495 DECLARE_CONCRETE_INSTRUCTION(Deoptimize)
1496
1497 private:
1498 Deoptimizer::BailoutType type_;
1495 }; 1499 };
1496 1500
1497 1501
1498 // Inserts an int3/stop break instruction for debugging purposes. 1502 // Inserts an int3/stop break instruction for debugging purposes.
1499 class HDebugBreak: public HTemplateInstruction<0> { 1503 class HDebugBreak: public HTemplateInstruction<0> {
1500 public: 1504 public:
1501 virtual Representation RequiredInputRepresentation(int index) { 1505 virtual Representation RequiredInputRepresentation(int index) {
1502 return Representation::None(); 1506 return Representation::None();
1503 } 1507 }
1504 1508
1505 DECLARE_CONCRETE_INSTRUCTION(DebugBreak) 1509 DECLARE_CONCRETE_INSTRUCTION(DebugBreak)
1506 }; 1510 };
1507 1511
1508 1512
1509 class HDeoptimize: public HControlInstruction {
1510 public:
1511 HDeoptimize(int environment_length,
1512 int first_local_index,
1513 int first_expression_index,
1514 Zone* zone)
1515 : values_(environment_length, zone),
1516 first_local_index_(first_local_index),
1517 first_expression_index_(first_expression_index) { }
1518
1519 virtual Representation RequiredInputRepresentation(int index) {
1520 return Representation::None();
1521 }
1522
1523 virtual int OperandCount() { return values_.length(); }
1524 virtual HValue* OperandAt(int index) const { return values_[index]; }
1525 virtual void PrintDataTo(StringStream* stream);
1526
1527 virtual int SuccessorCount() { return 0; }
1528 virtual HBasicBlock* SuccessorAt(int i) {
1529 UNREACHABLE();
1530 return NULL;
1531 }
1532 virtual void SetSuccessorAt(int i, HBasicBlock* block) {
1533 UNREACHABLE();
1534 }
1535
1536 void AddEnvironmentValue(HValue* value, Zone* zone) {
1537 values_.Add(NULL, zone);
1538 SetOperandAt(values_.length() - 1, value);
1539 }
1540 int first_local_index() { return first_local_index_; }
1541 int first_expression_index() { return first_expression_index_; }
1542
1543 DECLARE_CONCRETE_INSTRUCTION(Deoptimize)
1544
1545 enum UseEnvironment {
1546 kNoUses,
1547 kUseAll
1548 };
1549
1550 protected:
1551 virtual void InternalSetOperandAt(int index, HValue* value) {
1552 values_[index] = value;
1553 }
1554
1555 private:
1556 ZoneList<HValue*> values_;
1557 int first_local_index_;
1558 int first_expression_index_;
1559 };
1560
1561
1562 class HGoto: public HTemplateControlInstruction<1, 0> { 1513 class HGoto: public HTemplateControlInstruction<1, 0> {
1563 public: 1514 public:
1564 explicit HGoto(HBasicBlock* target) { 1515 explicit HGoto(HBasicBlock* target) {
1565 SetSuccessorAt(0, target); 1516 SetSuccessorAt(0, target);
1566 } 1517 }
1567 1518
1568 virtual Representation RequiredInputRepresentation(int index) { 1519 virtual Representation RequiredInputRepresentation(int index) {
1569 return Representation::None(); 1520 return Representation::None();
1570 } 1521 }
1571 1522
(...skipping 5036 matching lines...) Expand 10 before | Expand all | Expand 10 after
6608 virtual bool IsDeletable() const { return true; } 6559 virtual bool IsDeletable() const { return true; }
6609 }; 6560 };
6610 6561
6611 6562
6612 #undef DECLARE_INSTRUCTION 6563 #undef DECLARE_INSTRUCTION
6613 #undef DECLARE_CONCRETE_INSTRUCTION 6564 #undef DECLARE_CONCRETE_INSTRUCTION
6614 6565
6615 } } // namespace v8::internal 6566 } } // namespace v8::internal
6616 6567
6617 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6568 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen-gvn.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698