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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 friend class StackFrameIterator; | 428 friend class StackFrameIterator; |
429 }; | 429 }; |
430 | 430 |
431 | 431 |
432 // Arguments adaptor frames are automatically inserted below | 432 // Arguments adaptor frames are automatically inserted below |
433 // JavaScript frames when the actual number of parameters does not | 433 // JavaScript frames when the actual number of parameters does not |
434 // match the formal number of parameters. | 434 // match the formal number of parameters. |
435 class ArgumentsAdaptorFrame: public JavaScriptFrame { | 435 class ArgumentsAdaptorFrame: public JavaScriptFrame { |
436 public: | 436 public: |
437 // This sentinel value is temporarily used to distinguish arguments | |
438 // adaptor frames from ordinary JavaScript frames. If a frame has | |
439 // the sentinel as its context, it is an arguments adaptor frame. It | |
440 // must be tagged as a small integer to avoid GC issues. Crud. | |
441 enum { | |
442 SENTINEL = (1 << kSmiTagSize) | kSmiTag, | |
443 NON_SENTINEL = ~SENTINEL | |
444 }; | |
445 | |
446 virtual Type type() const { return ARGUMENTS_ADAPTOR; } | 437 virtual Type type() const { return ARGUMENTS_ADAPTOR; } |
447 | 438 |
448 // Determine the code for the frame. | 439 // Determine the code for the frame. |
449 virtual Code* code() const; | 440 virtual Code* code() const; |
450 | 441 |
451 static ArgumentsAdaptorFrame* cast(StackFrame* frame) { | 442 static ArgumentsAdaptorFrame* cast(StackFrame* frame) { |
452 ASSERT(frame->is_arguments_adaptor()); | 443 ASSERT(frame->is_arguments_adaptor()); |
453 return static_cast<ArgumentsAdaptorFrame*>(frame); | 444 return static_cast<ArgumentsAdaptorFrame*>(frame); |
454 } | 445 } |
455 | 446 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 JavaScriptFrame* FindJavaScriptFrame(int n); | 669 JavaScriptFrame* FindJavaScriptFrame(int n); |
679 | 670 |
680 private: | 671 private: |
681 StackFrameIterator iterator_; | 672 StackFrameIterator iterator_; |
682 }; | 673 }; |
683 | 674 |
684 | 675 |
685 } } // namespace v8::internal | 676 } } // namespace v8::internal |
686 | 677 |
687 #endif // V8_FRAMES_H_ | 678 #endif // V8_FRAMES_H_ |
OLD | NEW |