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 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1396 bool is_function_entry() { return type_ == kFunctionEntry; } | 1396 bool is_function_entry() { return type_ == kFunctionEntry; } |
1397 bool is_backwards_branch() { return type_ == kBackwardsBranch; } | 1397 bool is_backwards_branch() { return type_ == kBackwardsBranch; } |
1398 | 1398 |
1399 DECLARE_CONCRETE_INSTRUCTION(StackCheck) | 1399 DECLARE_CONCRETE_INSTRUCTION(StackCheck) |
1400 | 1400 |
1401 private: | 1401 private: |
1402 Type type_; | 1402 Type type_; |
1403 }; | 1403 }; |
1404 | 1404 |
1405 | 1405 |
| 1406 // Indicate whether we have to perform special handling on return from inlined |
| 1407 // functions. |
| 1408 enum ReturnHandlingFlag { |
| 1409 NORMAL_RETURN, // Normal function/method return. |
| 1410 DROP_EXTRA_ON_RETURN, // Drop an extra value from the environment. |
| 1411 CONSTRUCT_CALL_RETURN, // Either use allocated receiver or return value. |
| 1412 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. |
| 1413 }; |
| 1414 |
| 1415 |
1406 class HEnterInlined: public HTemplateInstruction<0> { | 1416 class HEnterInlined: public HTemplateInstruction<0> { |
1407 public: | 1417 public: |
1408 HEnterInlined(Handle<JSFunction> closure, | 1418 HEnterInlined(Handle<JSFunction> closure, |
1409 int arguments_count, | 1419 int arguments_count, |
1410 FunctionLiteral* function, | 1420 FunctionLiteral* function, |
1411 CallKind call_kind, | 1421 CallKind call_kind, |
1412 bool is_construct, | 1422 ReturnHandlingFlag return_handling, |
1413 Variable* arguments_var, | 1423 Variable* arguments_var, |
1414 ZoneList<HValue*>* arguments_values) | 1424 ZoneList<HValue*>* arguments_values) |
1415 : closure_(closure), | 1425 : closure_(closure), |
1416 arguments_count_(arguments_count), | 1426 arguments_count_(arguments_count), |
1417 function_(function), | 1427 function_(function), |
1418 call_kind_(call_kind), | 1428 call_kind_(call_kind), |
1419 is_construct_(is_construct), | 1429 return_handling_(return_handling), |
1420 arguments_var_(arguments_var), | 1430 arguments_var_(arguments_var), |
1421 arguments_values_(arguments_values) { | 1431 arguments_values_(arguments_values) { |
1422 } | 1432 } |
1423 | 1433 |
1424 virtual void PrintDataTo(StringStream* stream); | 1434 virtual void PrintDataTo(StringStream* stream); |
1425 | 1435 |
1426 Handle<JSFunction> closure() const { return closure_; } | 1436 Handle<JSFunction> closure() const { return closure_; } |
1427 int arguments_count() const { return arguments_count_; } | 1437 int arguments_count() const { return arguments_count_; } |
1428 FunctionLiteral* function() const { return function_; } | 1438 FunctionLiteral* function() const { return function_; } |
1429 CallKind call_kind() const { return call_kind_; } | 1439 CallKind call_kind() const { return call_kind_; } |
1430 bool is_construct() const { return is_construct_; } | 1440 ReturnHandlingFlag return_handling() const { return return_handling_; } |
1431 | 1441 |
1432 virtual Representation RequiredInputRepresentation(int index) { | 1442 virtual Representation RequiredInputRepresentation(int index) { |
1433 return Representation::None(); | 1443 return Representation::None(); |
1434 } | 1444 } |
1435 | 1445 |
1436 Variable* arguments_var() { return arguments_var_; } | 1446 Variable* arguments_var() { return arguments_var_; } |
1437 ZoneList<HValue*>* arguments_values() { return arguments_values_; } | 1447 ZoneList<HValue*>* arguments_values() { return arguments_values_; } |
1438 | 1448 |
1439 DECLARE_CONCRETE_INSTRUCTION(EnterInlined) | 1449 DECLARE_CONCRETE_INSTRUCTION(EnterInlined) |
1440 | 1450 |
1441 private: | 1451 private: |
1442 Handle<JSFunction> closure_; | 1452 Handle<JSFunction> closure_; |
1443 int arguments_count_; | 1453 int arguments_count_; |
1444 FunctionLiteral* function_; | 1454 FunctionLiteral* function_; |
1445 CallKind call_kind_; | 1455 CallKind call_kind_; |
1446 bool is_construct_; | 1456 ReturnHandlingFlag return_handling_; |
1447 Variable* arguments_var_; | 1457 Variable* arguments_var_; |
1448 ZoneList<HValue*>* arguments_values_; | 1458 ZoneList<HValue*>* arguments_values_; |
1449 }; | 1459 }; |
1450 | 1460 |
1451 | 1461 |
1452 class HLeaveInlined: public HTemplateInstruction<0> { | 1462 class HLeaveInlined: public HTemplateInstruction<0> { |
1453 public: | 1463 public: |
1454 explicit HLeaveInlined(bool arguments_pushed) | 1464 explicit HLeaveInlined(bool arguments_pushed) |
1455 : arguments_pushed_(arguments_pushed) { } | 1465 : arguments_pushed_(arguments_pushed) { } |
1456 | 1466 |
(...skipping 3783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5240 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); | 5250 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex); |
5241 }; | 5251 }; |
5242 | 5252 |
5243 | 5253 |
5244 #undef DECLARE_INSTRUCTION | 5254 #undef DECLARE_INSTRUCTION |
5245 #undef DECLARE_CONCRETE_INSTRUCTION | 5255 #undef DECLARE_CONCRETE_INSTRUCTION |
5246 | 5256 |
5247 } } // namespace v8::internal | 5257 } } // namespace v8::internal |
5248 | 5258 |
5249 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5259 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |