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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 virtual int GetCodeKind() { return Code::STUB; } | 252 virtual int GetCodeKind() { return Code::STUB; } |
253 virtual int GetStubFlags() { return -1; } | 253 virtual int GetStubFlags() { return -1; } |
254 | 254 |
255 protected: | 255 protected: |
256 // Generates the assembler code for the stub. | 256 // Generates the assembler code for the stub. |
257 virtual void Generate(MacroAssembler* masm) = 0; | 257 virtual void Generate(MacroAssembler* masm) = 0; |
258 }; | 258 }; |
259 | 259 |
260 | 260 |
| 261 enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE }; |
| 262 |
261 struct CodeStubInterfaceDescriptor { | 263 struct CodeStubInterfaceDescriptor { |
262 CodeStubInterfaceDescriptor() | 264 CodeStubInterfaceDescriptor() |
263 : register_param_count_(-1), | 265 : register_param_count_(-1), |
264 stack_parameter_count_(NULL), | 266 stack_parameter_count_(NULL), |
265 extra_expression_stack_count_(0), | 267 function_mode_(NOT_JS_FUNCTION_STUB_MODE), |
266 register_params_(NULL) { } | 268 register_params_(NULL) { } |
267 int register_param_count_; | 269 int register_param_count_; |
268 const Register* stack_parameter_count_; | 270 const Register* stack_parameter_count_; |
269 int extra_expression_stack_count_; | 271 StubFunctionMode function_mode_; |
270 Register* register_params_; | 272 Register* register_params_; |
271 Address deoptimization_handler_; | 273 Address deoptimization_handler_; |
272 | 274 |
273 int environment_length() const { | 275 int environment_length() const { |
274 if (stack_parameter_count_ != NULL) { | 276 if (stack_parameter_count_ != NULL) { |
275 return register_param_count_ + 1; | 277 return register_param_count_ + 1; |
276 } | 278 } |
277 return register_param_count_; | 279 return register_param_count_; |
278 } | 280 } |
279 }; | 281 }; |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1594 void Generate(MacroAssembler* masm); | 1596 void Generate(MacroAssembler* masm); |
1595 | 1597 |
1596 bool fp_registers_; | 1598 bool fp_registers_; |
1597 | 1599 |
1598 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub); | 1600 DISALLOW_COPY_AND_ASSIGN(StoreArrayLiteralElementStub); |
1599 }; | 1601 }; |
1600 | 1602 |
1601 | 1603 |
1602 class StubFailureTrampolineStub : public PlatformCodeStub { | 1604 class StubFailureTrampolineStub : public PlatformCodeStub { |
1603 public: | 1605 public: |
1604 static const int kMaxExtraExpressionStackCount = 1; | 1606 explicit StubFailureTrampolineStub(StubFunctionMode function_mode) |
1605 | 1607 : function_mode_(function_mode) {} |
1606 explicit StubFailureTrampolineStub(int extra_expression_stack_count) | |
1607 : extra_expression_stack_count_(extra_expression_stack_count) {} | |
1608 | 1608 |
1609 virtual bool IsPregenerated() { return true; } | 1609 virtual bool IsPregenerated() { return true; } |
1610 | 1610 |
1611 static void GenerateAheadOfTime(Isolate* isolate); | 1611 static void GenerateAheadOfTime(Isolate* isolate); |
1612 | 1612 |
1613 private: | 1613 private: |
1614 Major MajorKey() { return StubFailureTrampoline; } | 1614 Major MajorKey() { return StubFailureTrampoline; } |
1615 int MinorKey() { return extra_expression_stack_count_; } | 1615 int MinorKey() { return static_cast<int>(function_mode_); } |
1616 | 1616 |
1617 void Generate(MacroAssembler* masm); | 1617 void Generate(MacroAssembler* masm); |
1618 | 1618 |
1619 int extra_expression_stack_count_; | 1619 StubFunctionMode function_mode_; |
1620 | 1620 |
1621 DISALLOW_COPY_AND_ASSIGN(StubFailureTrampolineStub); | 1621 DISALLOW_COPY_AND_ASSIGN(StubFailureTrampolineStub); |
1622 }; | 1622 }; |
1623 | 1623 |
1624 | 1624 |
1625 class ProfileEntryHookStub : public PlatformCodeStub { | 1625 class ProfileEntryHookStub : public PlatformCodeStub { |
1626 public: | 1626 public: |
1627 explicit ProfileEntryHookStub() {} | 1627 explicit ProfileEntryHookStub() {} |
1628 | 1628 |
1629 // The profile entry hook function is not allowed to cause a GC. | 1629 // The profile entry hook function is not allowed to cause a GC. |
(...skipping 20 matching lines...) Expand all Loading... |
1650 | 1650 |
1651 // The current function entry hook. | 1651 // The current function entry hook. |
1652 static FunctionEntryHook entry_hook_; | 1652 static FunctionEntryHook entry_hook_; |
1653 | 1653 |
1654 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1654 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
1655 }; | 1655 }; |
1656 | 1656 |
1657 } } // namespace v8::internal | 1657 } } // namespace v8::internal |
1658 | 1658 |
1659 #endif // V8_CODE_STUBS_H_ | 1659 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |