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 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 HObjectAccess access, | 1130 HObjectAccess access, |
1131 HValue *val, | 1131 HValue *val, |
1132 Representation representation = Representation::Tagged()); | 1132 Representation representation = Representation::Tagged()); |
1133 | 1133 |
1134 HStoreNamedField* AddStoreMapConstant(HValue *object, Handle<Map>); | 1134 HStoreNamedField* AddStoreMapConstant(HValue *object, Handle<Map>); |
1135 | 1135 |
1136 HLoadNamedField* AddLoadElements(HValue *object, HValue *typecheck = NULL); | 1136 HLoadNamedField* AddLoadElements(HValue *object, HValue *typecheck = NULL); |
1137 | 1137 |
1138 HLoadNamedField* AddLoadFixedArrayLength(HValue *object); | 1138 HLoadNamedField* AddLoadFixedArrayLength(HValue *object); |
1139 | 1139 |
| 1140 void AddSoftDeoptimize(); |
| 1141 |
1140 class IfBuilder { | 1142 class IfBuilder { |
1141 public: | 1143 public: |
1142 explicit IfBuilder(HGraphBuilder* builder, | 1144 explicit IfBuilder(HGraphBuilder* builder, |
1143 int position = RelocInfo::kNoPosition); | 1145 int position = RelocInfo::kNoPosition); |
1144 IfBuilder(HGraphBuilder* builder, | 1146 IfBuilder(HGraphBuilder* builder, |
1145 HIfContinuation* continuation); | 1147 HIfContinuation* continuation); |
1146 | 1148 |
1147 ~IfBuilder() { | 1149 ~IfBuilder() { |
1148 if (!finished_) End(); | 1150 if (!finished_) End(); |
1149 } | 1151 } |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 ElementsKind to_elements_kind, | 1412 ElementsKind to_elements_kind, |
1411 HValue* length, | 1413 HValue* length, |
1412 HValue* capacity); | 1414 HValue* capacity); |
1413 | 1415 |
1414 HValue* BuildCloneShallowArray(HContext* context, | 1416 HValue* BuildCloneShallowArray(HContext* context, |
1415 HValue* boilerplate, | 1417 HValue* boilerplate, |
1416 AllocationSiteMode mode, | 1418 AllocationSiteMode mode, |
1417 ElementsKind kind, | 1419 ElementsKind kind, |
1418 int length); | 1420 int length); |
1419 | 1421 |
| 1422 HInstruction* BuildUnaryMathOp( |
| 1423 HValue* value, Handle<Type> type, Token::Value token); |
| 1424 |
1420 void BuildCompareNil( | 1425 void BuildCompareNil( |
1421 HValue* value, | 1426 HValue* value, |
1422 Handle<Type> type, | 1427 Handle<Type> type, |
1423 int position, | 1428 int position, |
1424 HIfContinuation* continuation); | 1429 HIfContinuation* continuation); |
1425 | 1430 |
1426 HValue* BuildCreateAllocationSiteInfo(HValue* previous_object, | 1431 HValue* BuildCreateAllocationSiteInfo(HValue* previous_object, |
1427 int previous_object_size, | 1432 int previous_object_size, |
1428 HValue* payload); | 1433 HValue* payload); |
1429 | 1434 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 explicit HOptimizedGraphBuilder(CompilationInfo* info); | 1502 explicit HOptimizedGraphBuilder(CompilationInfo* info); |
1498 | 1503 |
1499 virtual bool BuildGraph(); | 1504 virtual bool BuildGraph(); |
1500 | 1505 |
1501 // Simple accessors. | 1506 // Simple accessors. |
1502 BreakAndContinueScope* break_scope() const { return break_scope_; } | 1507 BreakAndContinueScope* break_scope() const { return break_scope_; } |
1503 void set_break_scope(BreakAndContinueScope* head) { break_scope_ = head; } | 1508 void set_break_scope(BreakAndContinueScope* head) { break_scope_ = head; } |
1504 | 1509 |
1505 bool inline_bailout() { return inline_bailout_; } | 1510 bool inline_bailout() { return inline_bailout_; } |
1506 | 1511 |
1507 void AddSoftDeoptimize(); | |
1508 | |
1509 void Bailout(const char* reason); | 1512 void Bailout(const char* reason); |
1510 | 1513 |
1511 HBasicBlock* CreateJoin(HBasicBlock* first, | 1514 HBasicBlock* CreateJoin(HBasicBlock* first, |
1512 HBasicBlock* second, | 1515 HBasicBlock* second, |
1513 BailoutId join_id); | 1516 BailoutId join_id); |
1514 | 1517 |
1515 FunctionState* function_state() const { return function_state_; } | 1518 FunctionState* function_state() const { return function_state_; } |
1516 | 1519 |
1517 void VisitDeclarations(ZoneList<Declaration*>* declarations); | 1520 void VisitDeclarations(ZoneList<Declaration*>* declarations); |
1518 | 1521 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 | 1683 |
1681 // Visit a list of expressions from left to right, each in a value context. | 1684 // Visit a list of expressions from left to right, each in a value context. |
1682 void VisitExpressions(ZoneList<Expression*>* exprs); | 1685 void VisitExpressions(ZoneList<Expression*>* exprs); |
1683 | 1686 |
1684 void PushAndAdd(HInstruction* instr); | 1687 void PushAndAdd(HInstruction* instr); |
1685 | 1688 |
1686 // Remove the arguments from the bailout environment and emit instructions | 1689 // Remove the arguments from the bailout environment and emit instructions |
1687 // to push them as outgoing parameters. | 1690 // to push them as outgoing parameters. |
1688 template <class Instruction> HInstruction* PreProcessCall(Instruction* call); | 1691 template <class Instruction> HInstruction* PreProcessCall(Instruction* call); |
1689 | 1692 |
1690 static Representation ToRepresentation(TypeInfo info); | |
1691 static Representation ToRepresentation(Handle<Type> type); | |
1692 | |
1693 void SetUpScope(Scope* scope); | 1693 void SetUpScope(Scope* scope); |
1694 virtual void VisitStatements(ZoneList<Statement*>* statements); | 1694 virtual void VisitStatements(ZoneList<Statement*>* statements); |
1695 | 1695 |
1696 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 1696 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
1697 AST_NODE_LIST(DECLARE_VISIT) | 1697 AST_NODE_LIST(DECLARE_VISIT) |
1698 #undef DECLARE_VISIT | 1698 #undef DECLARE_VISIT |
1699 | 1699 |
1700 // Helpers for flow graph construction. | 1700 // Helpers for flow graph construction. |
1701 enum GlobalPropertyAccess { | 1701 enum GlobalPropertyAccess { |
1702 kUseCell, | 1702 kUseCell, |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 EmbeddedVector<char, 64> filename_; | 2107 EmbeddedVector<char, 64> filename_; |
2108 HeapStringAllocator string_allocator_; | 2108 HeapStringAllocator string_allocator_; |
2109 StringStream trace_; | 2109 StringStream trace_; |
2110 int indent_; | 2110 int indent_; |
2111 }; | 2111 }; |
2112 | 2112 |
2113 | 2113 |
2114 } } // namespace v8::internal | 2114 } } // namespace v8::internal |
2115 | 2115 |
2116 #endif // V8_HYDROGEN_H_ | 2116 #endif // V8_HYDROGEN_H_ |
OLD | NEW |