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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // Testers. | 376 // Testers. |
377 virtual bool is_standard() const { return true; } | 377 virtual bool is_standard() const { return true; } |
378 | 378 |
379 // Accessors. | 379 // Accessors. |
380 inline Object* context() const; | 380 inline Object* context() const; |
381 | 381 |
382 // Access the expressions in the stack frame including locals. | 382 // Access the expressions in the stack frame including locals. |
383 inline Object* GetExpression(int index) const; | 383 inline Object* GetExpression(int index) const; |
384 inline void SetExpression(int index, Object* value); | 384 inline void SetExpression(int index, Object* value); |
385 int ComputeExpressionsCount() const; | 385 int ComputeExpressionsCount() const; |
| 386 static Object* GetExpression(Address fp, int index); |
386 | 387 |
387 virtual void SetCallerFp(Address caller_fp); | 388 virtual void SetCallerFp(Address caller_fp); |
388 | 389 |
389 static StandardFrame* cast(StackFrame* frame) { | 390 static StandardFrame* cast(StackFrame* frame) { |
390 ASSERT(frame->is_standard()); | 391 ASSERT(frame->is_standard()); |
391 return static_cast<StandardFrame*>(frame); | 392 return static_cast<StandardFrame*>(frame); |
392 } | 393 } |
393 | 394 |
394 protected: | 395 protected: |
395 explicit StandardFrame(StackFrameIterator* iterator) | 396 explicit StandardFrame(StackFrameIterator* iterator) |
396 : StackFrame(iterator) { } | 397 : StackFrame(iterator) { } |
397 | 398 |
398 virtual void ComputeCallerState(State* state) const; | 399 virtual void ComputeCallerState(State* state) const; |
399 | 400 |
400 // Accessors. | 401 // Accessors. |
401 inline Address caller_fp() const; | 402 inline Address caller_fp() const; |
402 inline Address caller_pc() const; | 403 inline Address caller_pc() const; |
403 | 404 |
404 // Computes the address of the PC field in the standard frame given | 405 // Computes the address of the PC field in the standard frame given |
405 // by the provided frame pointer. | 406 // by the provided frame pointer. |
406 static inline Address ComputePCAddress(Address fp); | 407 static inline Address ComputePCAddress(Address fp); |
407 | 408 |
408 // Iterate over expression stack including stack handlers, locals, | 409 // Iterate over expression stack including stack handlers, locals, |
409 // and parts of the fixed part including context and code fields. | 410 // and parts of the fixed part including context and code fields. |
410 void IterateExpressions(ObjectVisitor* v) const; | 411 void IterateExpressions(ObjectVisitor* v) const; |
411 | 412 |
412 // Returns the address of the n'th expression stack element. | 413 // Returns the address of the n'th expression stack element. |
413 Address GetExpressionAddress(int n) const; | 414 Address GetExpressionAddress(int n) const; |
| 415 static Address GetExpressionAddress(Address fp, int n); |
414 | 416 |
415 // Determines if the n'th expression stack element is in a stack | 417 // Determines if the n'th expression stack element is in a stack |
416 // handler or not. Requires traversing all handlers in this frame. | 418 // handler or not. Requires traversing all handlers in this frame. |
417 bool IsExpressionInsideHandler(int n) const; | 419 bool IsExpressionInsideHandler(int n) const; |
418 | 420 |
419 // Determines if the standard frame for the given frame pointer is | 421 // Determines if the standard frame for the given frame pointer is |
420 // an arguments adaptor frame. | 422 // an arguments adaptor frame. |
421 static inline bool IsArgumentsAdaptorFrame(Address fp); | 423 static inline bool IsArgumentsAdaptorFrame(Address fp); |
422 | 424 |
423 // Determines if the standard frame for the given frame pointer is a | 425 // Determines if the standard frame for the given frame pointer is a |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 return GetNumberOfIncomingArguments(); | 478 return GetNumberOfIncomingArguments(); |
477 } | 479 } |
478 | 480 |
479 // Check if this frame is a constructor frame invoked through 'new'. | 481 // Check if this frame is a constructor frame invoked through 'new'. |
480 bool IsConstructor() const; | 482 bool IsConstructor() const; |
481 | 483 |
482 // Check if this frame has "adapted" arguments in the sense that the | 484 // Check if this frame has "adapted" arguments in the sense that the |
483 // actual passed arguments are available in an arguments adaptor | 485 // actual passed arguments are available in an arguments adaptor |
484 // frame below it on the stack. | 486 // frame below it on the stack. |
485 inline bool has_adapted_arguments() const; | 487 inline bool has_adapted_arguments() const; |
| 488 int GetArgumentsLength() const; |
486 | 489 |
487 // Garbage collection support. | 490 // Garbage collection support. |
488 virtual void Iterate(ObjectVisitor* v) const; | 491 virtual void Iterate(ObjectVisitor* v) const; |
489 | 492 |
490 // Printing support. | 493 // Printing support. |
491 virtual void Print(StringStream* accumulator, | 494 virtual void Print(StringStream* accumulator, |
492 PrintMode mode, | 495 PrintMode mode, |
493 int index) const; | 496 int index) const; |
494 | 497 |
495 // Determine the code for the frame. | 498 // Determine the code for the frame. |
496 virtual Code* unchecked_code() const; | 499 virtual Code* unchecked_code() const; |
497 | 500 |
| 501 // Returns the levels of inlining for this frame. |
| 502 virtual int GetInlineCount() { return 1; } |
| 503 |
498 // Return a list with JSFunctions of this frame. | 504 // Return a list with JSFunctions of this frame. |
499 virtual void GetFunctions(List<JSFunction*>* functions); | 505 virtual void GetFunctions(List<JSFunction*>* functions); |
500 | 506 |
501 // Build a list with summaries for this frame including all inlined frames. | 507 // Build a list with summaries for this frame including all inlined frames. |
502 virtual void Summarize(List<FrameSummary>* frames); | 508 virtual void Summarize(List<FrameSummary>* frames); |
503 | 509 |
504 static JavaScriptFrame* cast(StackFrame* frame) { | 510 static JavaScriptFrame* cast(StackFrame* frame) { |
505 ASSERT(frame->is_java_script()); | 511 ASSERT(frame->is_java_script()); |
506 return static_cast<JavaScriptFrame*>(frame); | 512 return static_cast<JavaScriptFrame*>(frame); |
507 } | 513 } |
(...skipping 18 matching lines...) Expand all Loading... |
526 }; | 532 }; |
527 | 533 |
528 | 534 |
529 class OptimizedFrame : public JavaScriptFrame { | 535 class OptimizedFrame : public JavaScriptFrame { |
530 public: | 536 public: |
531 virtual Type type() const { return OPTIMIZED; } | 537 virtual Type type() const { return OPTIMIZED; } |
532 | 538 |
533 // GC support. | 539 // GC support. |
534 virtual void Iterate(ObjectVisitor* v) const; | 540 virtual void Iterate(ObjectVisitor* v) const; |
535 | 541 |
| 542 virtual int GetInlineCount(); |
| 543 |
536 // Return a list with JSFunctions of this frame. | 544 // Return a list with JSFunctions of this frame. |
537 // The functions are ordered bottom-to-top (i.e. functions.last() | 545 // The functions are ordered bottom-to-top (i.e. functions.last() |
538 // is the top-most activation) | 546 // is the top-most activation) |
539 virtual void GetFunctions(List<JSFunction*>* functions); | 547 virtual void GetFunctions(List<JSFunction*>* functions); |
540 | 548 |
541 virtual void Summarize(List<FrameSummary>* frames); | 549 virtual void Summarize(List<FrameSummary>* frames); |
542 | 550 |
543 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index); | 551 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index); |
544 | 552 |
545 protected: | 553 protected: |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 }; | 869 }; |
862 | 870 |
863 | 871 |
864 // Reads all frames on the current stack and copies them into the current | 872 // Reads all frames on the current stack and copies them into the current |
865 // zone memory. | 873 // zone memory. |
866 Vector<StackFrame*> CreateStackMap(); | 874 Vector<StackFrame*> CreateStackMap(); |
867 | 875 |
868 } } // namespace v8::internal | 876 } } // namespace v8::internal |
869 | 877 |
870 #endif // V8_FRAMES_H_ | 878 #endif // V8_FRAMES_H_ |
OLD | NEW |