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