| 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 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } | 1240 bool CanTruncateToInt32() const { return CheckFlag(kTruncatingToInt32); } |
| 1241 | 1241 |
| 1242 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0; | 1242 virtual LInstruction* CompileToLithium(LChunkBuilder* builder) = 0; |
| 1243 | 1243 |
| 1244 #ifdef DEBUG | 1244 #ifdef DEBUG |
| 1245 virtual void Verify() V8_OVERRIDE; | 1245 virtual void Verify() V8_OVERRIDE; |
| 1246 #endif | 1246 #endif |
| 1247 | 1247 |
| 1248 virtual bool HasStackCheck() { return false; } | 1248 virtual bool IsCall() { return false; } |
| 1249 | 1249 |
| 1250 DECLARE_ABSTRACT_INSTRUCTION(Instruction) | 1250 DECLARE_ABSTRACT_INSTRUCTION(Instruction) |
| 1251 | 1251 |
| 1252 protected: | 1252 protected: |
| 1253 HInstruction(HType type = HType::Tagged()) | 1253 HInstruction(HType type = HType::Tagged()) |
| 1254 : HValue(type), | 1254 : HValue(type), |
| 1255 next_(NULL), | 1255 next_(NULL), |
| 1256 previous_(NULL), | 1256 previous_(NULL), |
| 1257 position_(RelocInfo::kNoPosition) { | 1257 position_(RelocInfo::kNoPosition) { |
| 1258 SetGVNFlag(kDependsOnOsrEntries); | 1258 SetGVNFlag(kDependsOnOsrEntries); |
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2236 } | 2236 } |
| 2237 | 2237 |
| 2238 virtual int argument_count() const { | 2238 virtual int argument_count() const { |
| 2239 return argument_count_; | 2239 return argument_count_; |
| 2240 } | 2240 } |
| 2241 | 2241 |
| 2242 virtual int argument_delta() const V8_OVERRIDE { | 2242 virtual int argument_delta() const V8_OVERRIDE { |
| 2243 return -argument_count(); | 2243 return -argument_count(); |
| 2244 } | 2244 } |
| 2245 | 2245 |
| 2246 virtual bool IsCall() V8_FINAL V8_OVERRIDE { return true; } |
| 2247 |
| 2246 private: | 2248 private: |
| 2247 int argument_count_; | 2249 int argument_count_; |
| 2248 }; | 2250 }; |
| 2249 | 2251 |
| 2250 | 2252 |
| 2251 class HUnaryCall : public HCall<1> { | 2253 class HUnaryCall : public HCall<1> { |
| 2252 public: | 2254 public: |
| 2253 HUnaryCall(HValue* value, int argument_count) | 2255 HUnaryCall(HValue* value, int argument_count) |
| 2254 : HCall<1>(argument_count) { | 2256 : HCall<1>(argument_count) { |
| 2255 SetOperandAt(0, value); | 2257 SetOperandAt(0, value); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2307 int argument_count) { | 2309 int argument_count) { |
| 2308 return new(zone) HInvokeFunction(context, function, | 2310 return new(zone) HInvokeFunction(context, function, |
| 2309 known_function, argument_count); | 2311 known_function, argument_count); |
| 2310 } | 2312 } |
| 2311 | 2313 |
| 2312 HValue* context() { return first(); } | 2314 HValue* context() { return first(); } |
| 2313 HValue* function() { return second(); } | 2315 HValue* function() { return second(); } |
| 2314 Handle<JSFunction> known_function() { return known_function_; } | 2316 Handle<JSFunction> known_function() { return known_function_; } |
| 2315 int formal_parameter_count() const { return formal_parameter_count_; } | 2317 int formal_parameter_count() const { return formal_parameter_count_; } |
| 2316 | 2318 |
| 2317 virtual bool HasStackCheck() V8_FINAL V8_OVERRIDE { | |
| 2318 return !known_function().is_null() && | |
| 2319 (known_function()->code()->kind() == Code::FUNCTION || | |
| 2320 known_function()->code()->kind() == Code::OPTIMIZED_FUNCTION); | |
| 2321 } | |
| 2322 | |
| 2323 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction) | 2319 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction) |
| 2324 | 2320 |
| 2325 private: | 2321 private: |
| 2326 HInvokeFunction(HValue* context, HValue* function, int argument_count) | 2322 HInvokeFunction(HValue* context, HValue* function, int argument_count) |
| 2327 : HBinaryCall(context, function, argument_count) { | 2323 : HBinaryCall(context, function, argument_count) { |
| 2328 } | 2324 } |
| 2329 | 2325 |
| 2330 Handle<JSFunction> known_function_; | 2326 Handle<JSFunction> known_function_; |
| 2331 int formal_parameter_count_; | 2327 int formal_parameter_count_; |
| 2332 }; | 2328 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2345 return function_->code() == | 2341 return function_->code() == |
| 2346 function_->GetIsolate()->builtins()->builtin(Builtins::kFunctionApply); | 2342 function_->GetIsolate()->builtins()->builtin(Builtins::kFunctionApply); |
| 2347 } | 2343 } |
| 2348 | 2344 |
| 2349 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2345 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 2350 | 2346 |
| 2351 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 2347 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 2352 return Representation::None(); | 2348 return Representation::None(); |
| 2353 } | 2349 } |
| 2354 | 2350 |
| 2355 virtual bool HasStackCheck() V8_FINAL V8_OVERRIDE { | |
| 2356 return (function()->code()->kind() == Code::FUNCTION || | |
| 2357 function()->code()->kind() == Code::OPTIMIZED_FUNCTION); | |
| 2358 } | |
| 2359 | |
| 2360 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction) | 2351 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction) |
| 2361 | 2352 |
| 2362 private: | 2353 private: |
| 2363 HCallConstantFunction(Handle<JSFunction> function, int argument_count) | 2354 HCallConstantFunction(Handle<JSFunction> function, int argument_count) |
| 2364 : HCall<0>(argument_count), | 2355 : HCall<0>(argument_count), |
| 2365 function_(function), | 2356 function_(function), |
| 2366 formal_parameter_count_(function->shared()->formal_parameter_count()) {} | 2357 formal_parameter_count_(function->shared()->formal_parameter_count()) {} |
| 2367 | 2358 |
| 2368 Handle<JSFunction> function_; | 2359 Handle<JSFunction> function_; |
| 2369 int formal_parameter_count_; | 2360 int formal_parameter_count_; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2467 | 2458 |
| 2468 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2459 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 2469 | 2460 |
| 2470 Handle<JSFunction> target() const { return target_; } | 2461 Handle<JSFunction> target() const { return target_; } |
| 2471 int formal_parameter_count() const { return formal_parameter_count_; } | 2462 int formal_parameter_count() const { return formal_parameter_count_; } |
| 2472 | 2463 |
| 2473 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 2464 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 2474 return Representation::None(); | 2465 return Representation::None(); |
| 2475 } | 2466 } |
| 2476 | 2467 |
| 2477 virtual bool HasStackCheck() V8_FINAL V8_OVERRIDE { | |
| 2478 return (target()->code()->kind() == Code::FUNCTION || | |
| 2479 target()->code()->kind() == Code::OPTIMIZED_FUNCTION); | |
| 2480 } | |
| 2481 | |
| 2482 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal) | 2468 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal) |
| 2483 | 2469 |
| 2484 private: | 2470 private: |
| 2485 HCallKnownGlobal(Handle<JSFunction> target, int argument_count) | 2471 HCallKnownGlobal(Handle<JSFunction> target, int argument_count) |
| 2486 : HCall<0>(argument_count), | 2472 : HCall<0>(argument_count), |
| 2487 target_(target), | 2473 target_(target), |
| 2488 formal_parameter_count_(target->shared()->formal_parameter_count()) { } | 2474 formal_parameter_count_(target->shared()->formal_parameter_count()) { } |
| 2489 | 2475 |
| 2490 Handle<JSFunction> target_; | 2476 Handle<JSFunction> target_; |
| 2491 int formal_parameter_count_; | 2477 int formal_parameter_count_; |
| (...skipping 5038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7530 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7516 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7531 }; | 7517 }; |
| 7532 | 7518 |
| 7533 | 7519 |
| 7534 #undef DECLARE_INSTRUCTION | 7520 #undef DECLARE_INSTRUCTION |
| 7535 #undef DECLARE_CONCRETE_INSTRUCTION | 7521 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7536 | 7522 |
| 7537 } } // namespace v8::internal | 7523 } } // namespace v8::internal |
| 7538 | 7524 |
| 7539 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7525 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |