OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 V(Goto) \ | 94 V(Goto) \ |
95 V(HasCachedArrayIndexAndBranch) \ | 95 V(HasCachedArrayIndexAndBranch) \ |
96 V(HasInstanceTypeAndBranch) \ | 96 V(HasInstanceTypeAndBranch) \ |
97 V(In) \ | 97 V(In) \ |
98 V(InstanceOf) \ | 98 V(InstanceOf) \ |
99 V(InstanceOfKnownGlobal) \ | 99 V(InstanceOfKnownGlobal) \ |
100 V(InstructionGap) \ | 100 V(InstructionGap) \ |
101 V(Integer32ToDouble) \ | 101 V(Integer32ToDouble) \ |
102 V(InvokeFunction) \ | 102 V(InvokeFunction) \ |
103 V(IsConstructCallAndBranch) \ | 103 V(IsConstructCallAndBranch) \ |
104 V(IsNullAndBranch) \ | 104 V(IsNilAndBranch) \ |
105 V(IsObjectAndBranch) \ | 105 V(IsObjectAndBranch) \ |
106 V(IsSmiAndBranch) \ | 106 V(IsSmiAndBranch) \ |
107 V(IsUndetectableAndBranch) \ | 107 V(IsUndetectableAndBranch) \ |
108 V(JSArrayLength) \ | 108 V(JSArrayLength) \ |
109 V(Label) \ | 109 V(Label) \ |
110 V(LazyBailout) \ | 110 V(LazyBailout) \ |
111 V(LoadContextSlot) \ | 111 V(LoadContextSlot) \ |
112 V(LoadElements) \ | 112 V(LoadElements) \ |
113 V(LoadExternalArrayPointer) \ | 113 V(LoadExternalArrayPointer) \ |
114 V(LoadFunctionPrototype) \ | 114 V(LoadFunctionPrototype) \ |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 explicit LCmpConstantEqAndBranch(LOperand* left) { | 608 explicit LCmpConstantEqAndBranch(LOperand* left) { |
609 inputs_[0] = left; | 609 inputs_[0] = left; |
610 } | 610 } |
611 | 611 |
612 DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, | 612 DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, |
613 "cmp-constant-eq-and-branch") | 613 "cmp-constant-eq-and-branch") |
614 DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) | 614 DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) |
615 }; | 615 }; |
616 | 616 |
617 | 617 |
618 class LIsNullAndBranch: public LControlInstruction<1, 1> { | 618 class LIsNilAndBranch: public LControlInstruction<1, 1> { |
619 public: | 619 public: |
620 LIsNullAndBranch(LOperand* value, LOperand* temp) { | 620 LIsNilAndBranch(LOperand* value, LOperand* temp) { |
621 inputs_[0] = value; | 621 inputs_[0] = value; |
622 temps_[0] = temp; | 622 temps_[0] = temp; |
623 } | 623 } |
624 | 624 |
625 DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch") | 625 DECLARE_CONCRETE_INSTRUCTION(IsNilAndBranch, "is-nil-and-branch") |
626 DECLARE_HYDROGEN_ACCESSOR(IsNullAndBranch) | 626 DECLARE_HYDROGEN_ACCESSOR(IsNilAndBranch) |
627 | 627 |
628 bool is_strict() const { return hydrogen()->is_strict(); } | 628 EqualityKind kind() const { return hydrogen()->kind(); } |
| 629 NilValue nil() const { return hydrogen()->nil(); } |
629 | 630 |
630 virtual void PrintDataTo(StringStream* stream); | 631 virtual void PrintDataTo(StringStream* stream); |
631 }; | 632 }; |
632 | 633 |
633 | 634 |
634 class LIsObjectAndBranch: public LControlInstruction<1, 1> { | 635 class LIsObjectAndBranch: public LControlInstruction<1, 1> { |
635 public: | 636 public: |
636 LIsObjectAndBranch(LOperand* value, LOperand* temp) { | 637 LIsObjectAndBranch(LOperand* value, LOperand* temp) { |
637 inputs_[0] = value; | 638 inputs_[0] = value; |
638 temps_[0] = temp; | 639 temps_[0] = temp; |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic") | 1224 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic") |
1224 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric) | 1225 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric) |
1225 | 1226 |
1226 LOperand* context() { return inputs_[0]; } | 1227 LOperand* context() { return inputs_[0]; } |
1227 LOperand* global_object() { return inputs_[1]; } | 1228 LOperand* global_object() { return inputs_[1]; } |
1228 Handle<Object> name() const { return hydrogen()->name(); } | 1229 Handle<Object> name() const { return hydrogen()->name(); } |
1229 bool for_typeof() const { return hydrogen()->for_typeof(); } | 1230 bool for_typeof() const { return hydrogen()->for_typeof(); } |
1230 }; | 1231 }; |
1231 | 1232 |
1232 | 1233 |
1233 class LStoreGlobalCell: public LTemplateInstruction<0, 1, 0> { | 1234 class LStoreGlobalCell: public LTemplateInstruction<0, 1, 2> { |
1234 public: | 1235 public: |
1235 explicit LStoreGlobalCell(LOperand* value) { | 1236 explicit LStoreGlobalCell(LOperand* value, LOperand* temp1, LOperand* temp2) { |
1236 inputs_[0] = value; | 1237 inputs_[0] = value; |
| 1238 temps_[0] = temp1; |
| 1239 temps_[1] = temp2; |
1237 } | 1240 } |
1238 | 1241 |
1239 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") | 1242 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") |
1240 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) | 1243 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) |
1241 }; | 1244 }; |
1242 | 1245 |
1243 | 1246 |
1244 class LStoreGlobalGeneric: public LTemplateInstruction<0, 3, 0> { | 1247 class LStoreGlobalGeneric: public LTemplateInstruction<0, 3, 0> { |
1245 public: | 1248 public: |
1246 LStoreGlobalGeneric(LOperand* context, | 1249 LStoreGlobalGeneric(LOperand* context, |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1791 LOperand* string() { return inputs_[0]; } | 1794 LOperand* string() { return inputs_[0]; } |
1792 }; | 1795 }; |
1793 | 1796 |
1794 | 1797 |
1795 class LCheckFunction: public LTemplateInstruction<0, 1, 0> { | 1798 class LCheckFunction: public LTemplateInstruction<0, 1, 0> { |
1796 public: | 1799 public: |
1797 explicit LCheckFunction(LOperand* value) { | 1800 explicit LCheckFunction(LOperand* value) { |
1798 inputs_[0] = value; | 1801 inputs_[0] = value; |
1799 } | 1802 } |
1800 | 1803 |
| 1804 LOperand* value() { return inputs_[0]; } |
| 1805 |
1801 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") | 1806 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") |
1802 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) | 1807 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) |
1803 }; | 1808 }; |
1804 | 1809 |
1805 | 1810 |
1806 class LCheckInstanceType: public LTemplateInstruction<0, 1, 1> { | 1811 class LCheckInstanceType: public LTemplateInstruction<0, 1, 1> { |
1807 public: | 1812 public: |
1808 LCheckInstanceType(LOperand* value, LOperand* temp) { | 1813 LCheckInstanceType(LOperand* value, LOperand* temp) { |
1809 inputs_[0] = value; | 1814 inputs_[0] = value; |
1810 temps_[0] = temp; | 1815 temps_[0] = temp; |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2063 | 2068 |
2064 class LChunkBuilder; | 2069 class LChunkBuilder; |
2065 class LChunk: public ZoneObject { | 2070 class LChunk: public ZoneObject { |
2066 public: | 2071 public: |
2067 LChunk(CompilationInfo* info, HGraph* graph) | 2072 LChunk(CompilationInfo* info, HGraph* graph) |
2068 : spill_slot_count_(0), | 2073 : spill_slot_count_(0), |
2069 info_(info), | 2074 info_(info), |
2070 graph_(graph), | 2075 graph_(graph), |
2071 instructions_(32), | 2076 instructions_(32), |
2072 pointer_maps_(8), | 2077 pointer_maps_(8), |
| 2078 num_double_slots_(0), |
2073 inlined_closures_(1) { } | 2079 inlined_closures_(1) { } |
2074 | 2080 |
2075 void AddInstruction(LInstruction* instruction, HBasicBlock* block); | 2081 void AddInstruction(LInstruction* instruction, HBasicBlock* block); |
2076 LConstantOperand* DefineConstantOperand(HConstant* constant); | 2082 LConstantOperand* DefineConstantOperand(HConstant* constant); |
2077 Handle<Object> LookupLiteral(LConstantOperand* operand) const; | 2083 Handle<Object> LookupLiteral(LConstantOperand* operand) const; |
2078 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; | 2084 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; |
2079 | 2085 |
2080 int GetNextSpillIndex(bool is_double); | 2086 int GetNextSpillIndex(bool is_double); |
2081 LOperand* GetNextSpillSlot(bool is_double); | 2087 LOperand* GetNextSpillSlot(bool is_double); |
2082 | 2088 |
2083 int ParameterAt(int index); | 2089 int ParameterAt(int index); |
2084 int GetParameterStackSlot(int index) const; | 2090 int GetParameterStackSlot(int index) const; |
2085 int spill_slot_count() const { return spill_slot_count_; } | 2091 int spill_slot_count() const { return spill_slot_count_; } |
| 2092 int num_double_slots() const { return num_double_slots_; } |
| 2093 |
2086 CompilationInfo* info() const { return info_; } | 2094 CompilationInfo* info() const { return info_; } |
2087 HGraph* graph() const { return graph_; } | 2095 HGraph* graph() const { return graph_; } |
2088 const ZoneList<LInstruction*>* instructions() const { return &instructions_; } | 2096 const ZoneList<LInstruction*>* instructions() const { return &instructions_; } |
2089 void AddGapMove(int index, LOperand* from, LOperand* to); | 2097 void AddGapMove(int index, LOperand* from, LOperand* to); |
2090 LGap* GetGapAt(int index) const; | 2098 LGap* GetGapAt(int index) const; |
2091 bool IsGapAt(int index) const; | 2099 bool IsGapAt(int index) const; |
2092 int NearestGapPos(int index) const; | 2100 int NearestGapPos(int index) const; |
2093 void MarkEmptyBlocks(); | 2101 void MarkEmptyBlocks(); |
2094 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } | 2102 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } |
2095 LLabel* GetLabel(int block_id) const { | 2103 LLabel* GetLabel(int block_id) const { |
(...skipping 21 matching lines...) Expand all Loading... |
2117 void AddInlinedClosure(Handle<JSFunction> closure) { | 2125 void AddInlinedClosure(Handle<JSFunction> closure) { |
2118 inlined_closures_.Add(closure); | 2126 inlined_closures_.Add(closure); |
2119 } | 2127 } |
2120 | 2128 |
2121 private: | 2129 private: |
2122 int spill_slot_count_; | 2130 int spill_slot_count_; |
2123 CompilationInfo* info_; | 2131 CompilationInfo* info_; |
2124 HGraph* const graph_; | 2132 HGraph* const graph_; |
2125 ZoneList<LInstruction*> instructions_; | 2133 ZoneList<LInstruction*> instructions_; |
2126 ZoneList<LPointerMap*> pointer_maps_; | 2134 ZoneList<LPointerMap*> pointer_maps_; |
| 2135 int num_double_slots_; |
2127 ZoneList<Handle<JSFunction> > inlined_closures_; | 2136 ZoneList<Handle<JSFunction> > inlined_closures_; |
2128 }; | 2137 }; |
2129 | 2138 |
2130 | 2139 |
2131 class LChunkBuilder BASE_EMBEDDED { | 2140 class LChunkBuilder BASE_EMBEDDED { |
2132 public: | 2141 public: |
2133 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2142 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2134 : chunk_(NULL), | 2143 : chunk_(NULL), |
2135 info_(info), | 2144 info_(info), |
2136 graph_(graph), | 2145 graph_(graph), |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2252 LInstruction* MarkAsCall( | 2261 LInstruction* MarkAsCall( |
2253 LInstruction* instr, | 2262 LInstruction* instr, |
2254 HInstruction* hinstr, | 2263 HInstruction* hinstr, |
2255 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 2264 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); |
2256 LInstruction* MarkAsSaveDoubles(LInstruction* instr); | 2265 LInstruction* MarkAsSaveDoubles(LInstruction* instr); |
2257 | 2266 |
2258 LInstruction* SetInstructionPendingDeoptimizationEnvironment( | 2267 LInstruction* SetInstructionPendingDeoptimizationEnvironment( |
2259 LInstruction* instr, int ast_id); | 2268 LInstruction* instr, int ast_id); |
2260 void ClearInstructionPendingDeoptimizationEnvironment(); | 2269 void ClearInstructionPendingDeoptimizationEnvironment(); |
2261 | 2270 |
2262 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env); | 2271 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env, |
| 2272 int* argument_index_accumulator); |
2263 | 2273 |
2264 void VisitInstruction(HInstruction* current); | 2274 void VisitInstruction(HInstruction* current); |
2265 | 2275 |
2266 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2276 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
2267 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); | 2277 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); |
2268 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2278 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
2269 LInstruction* DoArithmeticD(Token::Value op, | 2279 LInstruction* DoArithmeticD(Token::Value op, |
2270 HArithmeticBinaryOperation* instr); | 2280 HArithmeticBinaryOperation* instr); |
2271 LInstruction* DoArithmeticT(Token::Value op, | 2281 LInstruction* DoArithmeticT(Token::Value op, |
2272 HArithmeticBinaryOperation* instr); | 2282 HArithmeticBinaryOperation* instr); |
(...skipping 13 matching lines...) Expand all Loading... |
2286 | 2296 |
2287 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2297 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2288 }; | 2298 }; |
2289 | 2299 |
2290 #undef DECLARE_HYDROGEN_ACCESSOR | 2300 #undef DECLARE_HYDROGEN_ACCESSOR |
2291 #undef DECLARE_CONCRETE_INSTRUCTION | 2301 #undef DECLARE_CONCRETE_INSTRUCTION |
2292 | 2302 |
2293 } } // namespace v8::internal | 2303 } } // namespace v8::internal |
2294 | 2304 |
2295 #endif // V8_IA32_LITHIUM_IA32_H_ | 2305 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |