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 2271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2282 | 2282 |
2283 private: | 2283 private: |
2284 HCallNamed(HValue* context, Handle<String> name, int argument_count) | 2284 HCallNamed(HValue* context, Handle<String> name, int argument_count) |
2285 : HUnaryCall(context, argument_count), name_(name) { | 2285 : HUnaryCall(context, argument_count), name_(name) { |
2286 } | 2286 } |
2287 | 2287 |
2288 Handle<String> name_; | 2288 Handle<String> name_; |
2289 }; | 2289 }; |
2290 | 2290 |
2291 | 2291 |
| 2292 enum CallMode { |
| 2293 NORMAL_CALL, |
| 2294 TAIL_CALL |
| 2295 }; |
| 2296 |
| 2297 |
2292 class HCallFunction V8_FINAL : public HBinaryCall { | 2298 class HCallFunction V8_FINAL : public HBinaryCall { |
2293 public: | 2299 public: |
2294 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallFunction, HValue*, int); | 2300 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallFunction, HValue*, int); |
| 2301 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3( |
| 2302 HCallFunction, HValue*, int, CallMode); |
| 2303 |
| 2304 bool IsTailCall() const { return call_mode_ == TAIL_CALL; } |
2295 | 2305 |
2296 HValue* context() { return first(); } | 2306 HValue* context() { return first(); } |
2297 HValue* function() { return second(); } | 2307 HValue* function() { return second(); } |
2298 | 2308 |
2299 DECLARE_CONCRETE_INSTRUCTION(CallFunction) | 2309 DECLARE_CONCRETE_INSTRUCTION(CallFunction) |
2300 | 2310 |
| 2311 virtual int argument_delta() const V8_OVERRIDE { |
| 2312 if (IsTailCall()) return 0; |
| 2313 return -argument_count(); |
| 2314 } |
| 2315 |
2301 private: | 2316 private: |
2302 HCallFunction(HValue* context, HValue* function, int argument_count) | 2317 HCallFunction(HValue* context, |
2303 : HBinaryCall(context, function, argument_count) { | 2318 HValue* function, |
| 2319 int argument_count, |
| 2320 CallMode mode = NORMAL_CALL) |
| 2321 : HBinaryCall(context, function, argument_count), call_mode_(mode) { |
2304 } | 2322 } |
| 2323 CallMode call_mode_; |
2305 }; | 2324 }; |
2306 | 2325 |
2307 | 2326 |
2308 class HCallGlobal V8_FINAL : public HUnaryCall { | 2327 class HCallGlobal V8_FINAL : public HUnaryCall { |
2309 public: | 2328 public: |
2310 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallGlobal, Handle<String>, int); | 2329 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallGlobal, Handle<String>, int); |
2311 | 2330 |
2312 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2331 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
2313 | 2332 |
2314 HValue* context() { return value(); } | 2333 HValue* context() { return value(); } |
(...skipping 4861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7176 virtual HType CalculateInferredType() V8_OVERRIDE { | 7195 virtual HType CalculateInferredType() V8_OVERRIDE { |
7177 return HType::Tagged(); | 7196 return HType::Tagged(); |
7178 } | 7197 } |
7179 | 7198 |
7180 HValue* value() { return OperandAt(0); } | 7199 HValue* value() { return OperandAt(0); } |
7181 HValue* map() { return OperandAt(1); } | 7200 HValue* map() { return OperandAt(1); } |
7182 | 7201 |
7183 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue) | 7202 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue) |
7184 | 7203 |
7185 protected: | 7204 protected: |
| 7205 virtual int RedefinedOperandIndex() { return 0; } |
| 7206 |
7186 virtual bool DataEquals(HValue* other) V8_OVERRIDE { | 7207 virtual bool DataEquals(HValue* other) V8_OVERRIDE { |
7187 return true; | 7208 return true; |
7188 } | 7209 } |
7189 | 7210 |
7190 private: | 7211 private: |
7191 HCheckMapValue(HValue* value, | 7212 HCheckMapValue(HValue* value, |
7192 HValue* map) { | 7213 HValue* map) { |
7193 SetOperandAt(0, value); | 7214 SetOperandAt(0, value); |
7194 SetOperandAt(1, map); | 7215 SetOperandAt(1, map); |
7195 set_representation(Representation::Tagged()); | 7216 set_representation(Representation::Tagged()); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7300 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7321 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7301 }; | 7322 }; |
7302 | 7323 |
7303 | 7324 |
7304 #undef DECLARE_INSTRUCTION | 7325 #undef DECLARE_INSTRUCTION |
7305 #undef DECLARE_CONCRETE_INSTRUCTION | 7326 #undef DECLARE_CONCRETE_INSTRUCTION |
7306 | 7327 |
7307 } } // namespace v8::internal | 7328 } } // namespace v8::internal |
7308 | 7329 |
7309 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7330 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |