| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HYDROGEN_H_ | 5 #ifndef V8_HYDROGEN_H_ |
| 6 #define V8_HYDROGEN_H_ | 6 #define V8_HYDROGEN_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 | 1468 |
| 1469 HLoadNamedField* AddLoadArrayLength(HValue *object, | 1469 HLoadNamedField* AddLoadArrayLength(HValue *object, |
| 1470 ElementsKind kind, | 1470 ElementsKind kind, |
| 1471 HValue *dependency = NULL); | 1471 HValue *dependency = NULL); |
| 1472 | 1472 |
| 1473 HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin); | 1473 HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin); |
| 1474 | 1474 |
| 1475 HValue* EnforceNumberType(HValue* number, Type* expected); | 1475 HValue* EnforceNumberType(HValue* number, Type* expected); |
| 1476 HValue* TruncateToNumber(HValue* value, Type** expected); | 1476 HValue* TruncateToNumber(HValue* value, Type** expected); |
| 1477 | 1477 |
| 1478 void FinishExitWithHardDeoptimization(Deoptimizer::DeoptReason reason); | 1478 void FinishExitWithHardDeoptimization(const char* reason); |
| 1479 | 1479 |
| 1480 void AddIncrementCounter(StatsCounter* counter); | 1480 void AddIncrementCounter(StatsCounter* counter); |
| 1481 | 1481 |
| 1482 class IfBuilder FINAL { | 1482 class IfBuilder FINAL { |
| 1483 public: | 1483 public: |
| 1484 // If using this constructor, Initialize() must be called explicitly! | 1484 // If using this constructor, Initialize() must be called explicitly! |
| 1485 IfBuilder(); | 1485 IfBuilder(); |
| 1486 | 1486 |
| 1487 explicit IfBuilder(HGraphBuilder* builder); | 1487 explicit IfBuilder(HGraphBuilder* builder); |
| 1488 IfBuilder(HGraphBuilder* builder, | 1488 IfBuilder(HGraphBuilder* builder, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 // if_finally.Else(); | 1616 // if_finally.Else(); |
| 1617 // // continues after else code of if_whatever or if_something. | 1617 // // continues after else code of if_whatever or if_something. |
| 1618 // ... | 1618 // ... |
| 1619 // if_finally.End(); | 1619 // if_finally.End(); |
| 1620 void JoinContinuation(HIfContinuation* continuation); | 1620 void JoinContinuation(HIfContinuation* continuation); |
| 1621 | 1621 |
| 1622 void Then(); | 1622 void Then(); |
| 1623 void Else(); | 1623 void Else(); |
| 1624 void End(); | 1624 void End(); |
| 1625 | 1625 |
| 1626 void Deopt(Deoptimizer::DeoptReason reason); | 1626 void Deopt(const char* reason); |
| 1627 void ThenDeopt(Deoptimizer::DeoptReason reason) { | 1627 void ThenDeopt(const char* reason) { |
| 1628 Then(); | 1628 Then(); |
| 1629 Deopt(reason); | 1629 Deopt(reason); |
| 1630 } | 1630 } |
| 1631 void ElseDeopt(Deoptimizer::DeoptReason reason) { | 1631 void ElseDeopt(const char* reason) { |
| 1632 Else(); | 1632 Else(); |
| 1633 Deopt(reason); | 1633 Deopt(reason); |
| 1634 } | 1634 } |
| 1635 | 1635 |
| 1636 void Return(HValue* value); | 1636 void Return(HValue* value); |
| 1637 | 1637 |
| 1638 private: | 1638 private: |
| 1639 void InitializeDontCreateBlocks(HGraphBuilder* builder); | 1639 void InitializeDontCreateBlocks(HGraphBuilder* builder); |
| 1640 | 1640 |
| 1641 HControlInstruction* AddCompare(HControlInstruction* compare); | 1641 HControlInstruction* AddCompare(HControlInstruction* compare); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1931 | 1931 |
| 1932 CompilationInfo* info_; | 1932 CompilationInfo* info_; |
| 1933 HGraph* graph_; | 1933 HGraph* graph_; |
| 1934 HBasicBlock* current_block_; | 1934 HBasicBlock* current_block_; |
| 1935 Scope* scope_; | 1935 Scope* scope_; |
| 1936 HSourcePosition position_; | 1936 HSourcePosition position_; |
| 1937 int start_position_; | 1937 int start_position_; |
| 1938 }; | 1938 }; |
| 1939 | 1939 |
| 1940 | 1940 |
| 1941 template <> | 1941 template<> |
| 1942 inline HDeoptimize* HGraphBuilder::Add<HDeoptimize>( | 1942 inline HDeoptimize* HGraphBuilder::Add<HDeoptimize>( |
| 1943 Deoptimizer::DeoptReason reason, Deoptimizer::BailoutType type) { | 1943 const char* reason, Deoptimizer::BailoutType type) { |
| 1944 if (type == Deoptimizer::SOFT) { | 1944 if (type == Deoptimizer::SOFT) { |
| 1945 isolate()->counters()->soft_deopts_requested()->Increment(); | 1945 isolate()->counters()->soft_deopts_requested()->Increment(); |
| 1946 if (FLAG_always_opt) return NULL; | 1946 if (FLAG_always_opt) return NULL; |
| 1947 } | 1947 } |
| 1948 if (current_block()->IsDeoptimizing()) return NULL; | 1948 if (current_block()->IsDeoptimizing()) return NULL; |
| 1949 HBasicBlock* after_deopt_block = CreateBasicBlock( | 1949 HBasicBlock* after_deopt_block = CreateBasicBlock( |
| 1950 current_block()->last_environment()); | 1950 current_block()->last_environment()); |
| 1951 HDeoptimize* instr = New<HDeoptimize>(reason, type, after_deopt_block); | 1951 HDeoptimize* instr = New<HDeoptimize>(reason, type, after_deopt_block); |
| 1952 if (type == Deoptimizer::SOFT) { | 1952 if (type == Deoptimizer::SOFT) { |
| 1953 isolate()->counters()->soft_deopts_inserted()->Increment(); | 1953 isolate()->counters()->soft_deopts_inserted()->Increment(); |
| 1954 } | 1954 } |
| 1955 FinishCurrentBlock(instr); | 1955 FinishCurrentBlock(instr); |
| 1956 set_current_block(after_deopt_block); | 1956 set_current_block(after_deopt_block); |
| 1957 return instr; | 1957 return instr; |
| 1958 } | 1958 } |
| 1959 | 1959 |
| 1960 | 1960 |
| 1961 template <> | 1961 template<> |
| 1962 inline HInstruction* HGraphBuilder::AddUncasted<HDeoptimize>( | 1962 inline HInstruction* HGraphBuilder::AddUncasted<HDeoptimize>( |
| 1963 Deoptimizer::DeoptReason reason, Deoptimizer::BailoutType type) { | 1963 const char* reason, Deoptimizer::BailoutType type) { |
| 1964 return Add<HDeoptimize>(reason, type); | 1964 return Add<HDeoptimize>(reason, type); |
| 1965 } | 1965 } |
| 1966 | 1966 |
| 1967 | 1967 |
| 1968 template<> | 1968 template<> |
| 1969 inline HSimulate* HGraphBuilder::Add<HSimulate>( | 1969 inline HSimulate* HGraphBuilder::Add<HSimulate>( |
| 1970 BailoutId id, | 1970 BailoutId id, |
| 1971 RemovableSimulate removable) { | 1971 RemovableSimulate removable) { |
| 1972 HSimulate* instr = current_block()->CreateSimulate(id, removable); | 1972 HSimulate* instr = current_block()->CreateSimulate(id, removable); |
| 1973 AddInstruction(instr); | 1973 AddInstruction(instr); |
| (...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2949 } | 2949 } |
| 2950 | 2950 |
| 2951 private: | 2951 private: |
| 2952 HGraphBuilder* builder_; | 2952 HGraphBuilder* builder_; |
| 2953 }; | 2953 }; |
| 2954 | 2954 |
| 2955 | 2955 |
| 2956 } } // namespace v8::internal | 2956 } } // namespace v8::internal |
| 2957 | 2957 |
| 2958 #endif // V8_HYDROGEN_H_ | 2958 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |