OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 PrintF("CompareStub (cc %d), (strict %s)\n", | 323 PrintF("CompareStub (cc %d), (strict %s)\n", |
324 static_cast<int>(cc_), | 324 static_cast<int>(cc_), |
325 strict_ ? "true" : "false"); | 325 strict_ ? "true" : "false"); |
326 } | 326 } |
327 #endif | 327 #endif |
328 }; | 328 }; |
329 | 329 |
330 | 330 |
331 class CEntryStub : public CodeStub { | 331 class CEntryStub : public CodeStub { |
332 public: | 332 public: |
333 explicit CEntryStub(int result_size) : result_size_(result_size) { } | 333 explicit CEntryStub(int result_size, |
| 334 ExitFrame::Mode mode = ExitFrame::MODE_NORMAL) |
| 335 : result_size_(result_size), mode_(mode) { } |
334 | 336 |
335 void Generate(MacroAssembler* masm) { GenerateBody(masm, false); } | 337 void Generate(MacroAssembler* masm); |
336 | 338 |
337 protected: | 339 private: |
338 void GenerateBody(MacroAssembler* masm, bool is_debug_break); | |
339 void GenerateCore(MacroAssembler* masm, | 340 void GenerateCore(MacroAssembler* masm, |
340 Label* throw_normal_exception, | 341 Label* throw_normal_exception, |
341 Label* throw_termination_exception, | 342 Label* throw_termination_exception, |
342 Label* throw_out_of_memory_exception, | 343 Label* throw_out_of_memory_exception, |
343 ExitFrame::Mode mode, | |
344 bool do_gc, | 344 bool do_gc, |
345 bool always_allocate_scope); | 345 bool always_allocate_scope); |
346 void GenerateThrowTOS(MacroAssembler* masm); | 346 void GenerateThrowTOS(MacroAssembler* masm); |
347 void GenerateThrowUncatchable(MacroAssembler* masm, | 347 void GenerateThrowUncatchable(MacroAssembler* masm, |
348 UncatchableExceptionType type); | 348 UncatchableExceptionType type); |
349 private: | 349 |
350 // Number of pointers/values returned. | 350 // Number of pointers/values returned. |
351 int result_size_; | 351 int const result_size_; |
| 352 ExitFrame::Mode const mode_; |
| 353 |
| 354 // Minor key encoding |
| 355 class ExitFrameModeBits: public BitField<ExitFrame::Mode, 0, 1> {}; |
| 356 class IndirectResultBits: public BitField<bool, 1, 1> {}; |
352 | 357 |
353 Major MajorKey() { return CEntry; } | 358 Major MajorKey() { return CEntry; } |
354 // Minor key must differ if different result_size_ values means different | 359 // Minor key must differ if different result_size_ values means different |
355 // code is generated. | 360 // code is generated. |
356 int MinorKey(); | 361 int MinorKey(); |
357 | 362 |
358 const char* GetName() { return "CEntryStub"; } | 363 const char* GetName() { return "CEntryStub"; } |
359 }; | 364 }; |
360 | 365 |
361 | 366 |
(...skipping 16 matching lines...) Expand all Loading... |
378 Major MajorKey() { return NoCache; } | 383 Major MajorKey() { return NoCache; } |
379 int MinorKey() { return 0; } | 384 int MinorKey() { return 0; } |
380 const char* GetName() { return "ApiEntryStub"; } | 385 const char* GetName() { return "ApiEntryStub"; } |
381 // The accessor info associated with the function. | 386 // The accessor info associated with the function. |
382 Handle<AccessorInfo> info_; | 387 Handle<AccessorInfo> info_; |
383 // The function to be called. | 388 // The function to be called. |
384 ApiFunction* fun_; | 389 ApiFunction* fun_; |
385 }; | 390 }; |
386 | 391 |
387 | 392 |
388 // Mark the debugger statemet to be recognized bu debugger (by the MajorKey) | 393 // Mark the debugger statemet to be recognized by debugger (by the MajorKey) |
389 class DebugerStatementStub : public CodeStub { | 394 class DebugerStatementStub : public CodeStub { |
390 public: | 395 public: |
391 DebugerStatementStub() { } | 396 DebugerStatementStub() { } |
392 | 397 |
393 void Generate(MacroAssembler* masm); | 398 void Generate(MacroAssembler* masm); |
394 | 399 |
395 private: | 400 private: |
396 Major MajorKey() { return DebuggerStatement; } | 401 Major MajorKey() { return DebuggerStatement; } |
397 int MinorKey() { return 0; } | 402 int MinorKey() { return 0; } |
398 | 403 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 private: | 541 private: |
537 Major MajorKey() { return ToBoolean; } | 542 Major MajorKey() { return ToBoolean; } |
538 int MinorKey() { return 0; } | 543 int MinorKey() { return 0; } |
539 }; | 544 }; |
540 | 545 |
541 | 546 |
542 } // namespace internal | 547 } // namespace internal |
543 } // namespace v8 | 548 } // namespace v8 |
544 | 549 |
545 #endif // V8_CODEGEN_H_ | 550 #endif // V8_CODEGEN_H_ |
OLD | NEW |