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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1008 | 1008 |
| 1009 protected: | 1009 protected: |
| 1010 virtual bool BuildGraph() = 0; | 1010 virtual bool BuildGraph() = 0; |
| 1011 | 1011 |
| 1012 HBasicBlock* CreateBasicBlock(HEnvironment* env); | 1012 HBasicBlock* CreateBasicBlock(HEnvironment* env); |
| 1013 HBasicBlock* CreateLoopHeaderBlock(); | 1013 HBasicBlock* CreateLoopHeaderBlock(); |
| 1014 | 1014 |
| 1015 HValue* BuildCheckNonSmi(HValue* object); | 1015 HValue* BuildCheckNonSmi(HValue* object); |
| 1016 HValue* BuildCheckMap(HValue* obj, Handle<Map> map); | 1016 HValue* BuildCheckMap(HValue* obj, Handle<Map> map); |
| 1017 | 1017 |
| 1018 static Representation ToRepresentation(TypeInfo info); | |
| 1019 static Representation ToRepresentation(Handle<Type> type); | |
|
danno
2013/06/27 13:31:06
Shouldn't this method be on the Type class?
oliv
2013/06/27 17:20:48
I only pulled this method up from the OptimizedGra
| |
| 1020 | |
| 1018 // Building common constructs | 1021 // Building common constructs |
| 1019 HInstruction* BuildExternalArrayElementAccess( | 1022 HInstruction* BuildExternalArrayElementAccess( |
| 1020 HValue* external_elements, | 1023 HValue* external_elements, |
| 1021 HValue* checked_key, | 1024 HValue* checked_key, |
| 1022 HValue* val, | 1025 HValue* val, |
| 1023 HValue* dependency, | 1026 HValue* dependency, |
| 1024 ElementsKind elements_kind, | 1027 ElementsKind elements_kind, |
| 1025 bool is_store); | 1028 bool is_store); |
| 1026 | 1029 |
| 1027 HInstruction* BuildFastElementAccess( | 1030 HInstruction* BuildFastElementAccess( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1071 HStoreNamedField* AddStore( | 1074 HStoreNamedField* AddStore( |
| 1072 HValue *object, | 1075 HValue *object, |
| 1073 HObjectAccess access, | 1076 HObjectAccess access, |
| 1074 HValue *val, | 1077 HValue *val, |
| 1075 Representation representation = Representation::Tagged()); | 1078 Representation representation = Representation::Tagged()); |
| 1076 | 1079 |
| 1077 HStoreNamedField* AddStoreMapConstant(HValue *object, Handle<Map>); | 1080 HStoreNamedField* AddStoreMapConstant(HValue *object, Handle<Map>); |
| 1078 | 1081 |
| 1079 HLoadNamedField* AddLoadElements(HValue *object, HValue *typecheck = NULL); | 1082 HLoadNamedField* AddLoadElements(HValue *object, HValue *typecheck = NULL); |
| 1080 | 1083 |
| 1084 void AddSoftDeoptimize(); | |
| 1085 | |
| 1081 class IfBuilder { | 1086 class IfBuilder { |
| 1082 public: | 1087 public: |
| 1083 explicit IfBuilder(HGraphBuilder* builder, | 1088 explicit IfBuilder(HGraphBuilder* builder, |
| 1084 int position = RelocInfo::kNoPosition); | 1089 int position = RelocInfo::kNoPosition); |
| 1085 IfBuilder(HGraphBuilder* builder, | 1090 IfBuilder(HGraphBuilder* builder, |
| 1086 HIfContinuation* continuation); | 1091 HIfContinuation* continuation); |
| 1087 | 1092 |
| 1088 ~IfBuilder() { | 1093 ~IfBuilder() { |
| 1089 if (!finished_) End(); | 1094 if (!finished_) End(); |
| 1090 } | 1095 } |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1353 ElementsKind to_elements_kind, | 1358 ElementsKind to_elements_kind, |
| 1354 HValue* length, | 1359 HValue* length, |
| 1355 HValue* capacity); | 1360 HValue* capacity); |
| 1356 | 1361 |
| 1357 HValue* BuildCloneShallowArray(HContext* context, | 1362 HValue* BuildCloneShallowArray(HContext* context, |
| 1358 HValue* boilerplate, | 1363 HValue* boilerplate, |
| 1359 AllocationSiteMode mode, | 1364 AllocationSiteMode mode, |
| 1360 ElementsKind kind, | 1365 ElementsKind kind, |
| 1361 int length); | 1366 int length); |
| 1362 | 1367 |
| 1368 HInstruction* BuildSub(HValue* value, Handle<Type> type, HValue* context); | |
| 1369 HInstruction* BuildBitNot(HValue* value, Handle<Type> type); | |
| 1370 | |
| 1363 void BuildCompareNil( | 1371 void BuildCompareNil( |
| 1364 HValue* value, | 1372 HValue* value, |
| 1365 Handle<Type> type, | 1373 Handle<Type> type, |
| 1366 int position, | 1374 int position, |
| 1367 HIfContinuation* continuation); | 1375 HIfContinuation* continuation); |
| 1368 | 1376 |
| 1369 HValue* BuildCreateAllocationSiteInfo(HValue* previous_object, | 1377 HValue* BuildCreateAllocationSiteInfo(HValue* previous_object, |
| 1370 int previous_object_size, | 1378 int previous_object_size, |
| 1371 HValue* payload); | 1379 HValue* payload); |
| 1372 | 1380 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1440 explicit HOptimizedGraphBuilder(CompilationInfo* info); | 1448 explicit HOptimizedGraphBuilder(CompilationInfo* info); |
| 1441 | 1449 |
| 1442 virtual bool BuildGraph(); | 1450 virtual bool BuildGraph(); |
| 1443 | 1451 |
| 1444 // Simple accessors. | 1452 // Simple accessors. |
| 1445 BreakAndContinueScope* break_scope() const { return break_scope_; } | 1453 BreakAndContinueScope* break_scope() const { return break_scope_; } |
| 1446 void set_break_scope(BreakAndContinueScope* head) { break_scope_ = head; } | 1454 void set_break_scope(BreakAndContinueScope* head) { break_scope_ = head; } |
| 1447 | 1455 |
| 1448 bool inline_bailout() { return inline_bailout_; } | 1456 bool inline_bailout() { return inline_bailout_; } |
| 1449 | 1457 |
| 1450 void AddSoftDeoptimize(); | |
| 1451 | |
| 1452 void Bailout(const char* reason); | 1458 void Bailout(const char* reason); |
| 1453 | 1459 |
| 1454 HBasicBlock* CreateJoin(HBasicBlock* first, | 1460 HBasicBlock* CreateJoin(HBasicBlock* first, |
| 1455 HBasicBlock* second, | 1461 HBasicBlock* second, |
| 1456 BailoutId join_id); | 1462 BailoutId join_id); |
| 1457 | 1463 |
| 1458 FunctionState* function_state() const { return function_state_; } | 1464 FunctionState* function_state() const { return function_state_; } |
| 1459 | 1465 |
| 1460 void VisitDeclarations(ZoneList<Declaration*>* declarations); | 1466 void VisitDeclarations(ZoneList<Declaration*>* declarations); |
| 1461 | 1467 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1625 void VisitExpressions(ZoneList<Expression*>* exprs); | 1631 void VisitExpressions(ZoneList<Expression*>* exprs); |
| 1626 | 1632 |
| 1627 void AddPhi(HPhi* phi); | 1633 void AddPhi(HPhi* phi); |
| 1628 | 1634 |
| 1629 void PushAndAdd(HInstruction* instr); | 1635 void PushAndAdd(HInstruction* instr); |
| 1630 | 1636 |
| 1631 // Remove the arguments from the bailout environment and emit instructions | 1637 // Remove the arguments from the bailout environment and emit instructions |
| 1632 // to push them as outgoing parameters. | 1638 // to push them as outgoing parameters. |
| 1633 template <class Instruction> HInstruction* PreProcessCall(Instruction* call); | 1639 template <class Instruction> HInstruction* PreProcessCall(Instruction* call); |
| 1634 | 1640 |
| 1635 static Representation ToRepresentation(TypeInfo info); | |
| 1636 static Representation ToRepresentation(Handle<Type> type); | |
| 1637 | |
| 1638 void SetUpScope(Scope* scope); | 1641 void SetUpScope(Scope* scope); |
| 1639 virtual void VisitStatements(ZoneList<Statement*>* statements); | 1642 virtual void VisitStatements(ZoneList<Statement*>* statements); |
| 1640 | 1643 |
| 1641 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); | 1644 #define DECLARE_VISIT(type) virtual void Visit##type(type* node); |
| 1642 AST_NODE_LIST(DECLARE_VISIT) | 1645 AST_NODE_LIST(DECLARE_VISIT) |
| 1643 #undef DECLARE_VISIT | 1646 #undef DECLARE_VISIT |
| 1644 | 1647 |
| 1645 // Helpers for flow graph construction. | 1648 // Helpers for flow graph construction. |
| 1646 enum GlobalPropertyAccess { | 1649 enum GlobalPropertyAccess { |
| 1647 kUseCell, | 1650 kUseCell, |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2051 EmbeddedVector<char, 64> filename_; | 2054 EmbeddedVector<char, 64> filename_; |
| 2052 HeapStringAllocator string_allocator_; | 2055 HeapStringAllocator string_allocator_; |
| 2053 StringStream trace_; | 2056 StringStream trace_; |
| 2054 int indent_; | 2057 int indent_; |
| 2055 }; | 2058 }; |
| 2056 | 2059 |
| 2057 | 2060 |
| 2058 } } // namespace v8::internal | 2061 } } // namespace v8::internal |
| 2059 | 2062 |
| 2060 #endif // V8_HYDROGEN_H_ | 2063 #endif // V8_HYDROGEN_H_ |
| OLD | NEW |