OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize); | 58 state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize); |
59 // Determine frame type. | 59 // Determine frame type. |
60 if (Memory::Address_at(fp + ExitFrameConstants::kDebugMarkOffset) != 0) { | 60 if (Memory::Address_at(fp + ExitFrameConstants::kDebugMarkOffset) != 0) { |
61 return EXIT_DEBUG; | 61 return EXIT_DEBUG; |
62 } else { | 62 } else { |
63 return EXIT; | 63 return EXIT; |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 int JavaScriptFrame::GetProvidedParametersCount() const { | 67 int JavaScriptFrame::GetProvidedParametersCount() const { |
68 UNIMPLEMENTED(); | 68 return ComputeParametersCount(); |
69 return 0; | |
70 } | |
71 | |
72 byte* ArgumentsAdaptorFrame::GetCallerStackPointer() const { | |
73 UNIMPLEMENTED(); | |
74 return NULL; | |
75 } | 69 } |
76 | 70 |
77 | 71 |
78 void ExitFrame::Iterate(ObjectVisitor* a) const { | 72 void ExitFrame::Iterate(ObjectVisitor* a) const { |
79 UNIMPLEMENTED(); | 73 // Exit frames on X64 do not contain any pointers. The arguments |
| 74 // are traversed as part of the expression stack of the calling |
| 75 // frame. |
80 } | 76 } |
81 | 77 |
82 byte* InternalFrame::GetCallerStackPointer() const { | 78 byte* InternalFrame::GetCallerStackPointer() const { |
83 // Internal frames have no arguments. The stack pointer of the | 79 // Internal frames have no arguments. The stack pointer of the |
84 // caller is at a fixed offset from the frame pointer. | 80 // caller is at a fixed offset from the frame pointer. |
85 return fp() + StandardFrameConstants::kCallerSPOffset; | 81 return fp() + StandardFrameConstants::kCallerSPOffset; |
86 } | 82 } |
87 | 83 |
88 byte* JavaScriptFrame::GetCallerStackPointer() const { | 84 byte* JavaScriptFrame::GetCallerStackPointer() const { |
89 UNIMPLEMENTED(); | 85 int arguments; |
90 return NULL; | 86 if (Heap::gc_state() != Heap::NOT_IN_GC || disable_heap_access_) { |
| 87 // The arguments for cooked frames are traversed as if they were |
| 88 // expression stack elements of the calling frame. The reason for |
| 89 // this rather strange decision is that we cannot access the |
| 90 // function during mark-compact GCs when the stack is cooked. |
| 91 // In fact accessing heap objects (like function->shared() below) |
| 92 // at all during GC is problematic. |
| 93 arguments = 0; |
| 94 } else { |
| 95 // Compute the number of arguments by getting the number of formal |
| 96 // parameters of the function. We must remember to take the |
| 97 // receiver into account (+1). |
| 98 JSFunction* function = JSFunction::cast(this->function()); |
| 99 arguments = function->shared()->formal_parameter_count() + 1; |
| 100 } |
| 101 const int offset = StandardFrameConstants::kCallerSPOffset; |
| 102 return fp() + offset + (arguments * kPointerSize); |
91 } | 103 } |
92 | 104 |
93 | 105 |
| 106 byte* ArgumentsAdaptorFrame::GetCallerStackPointer() const { |
| 107 const int arguments = Smi::cast(GetExpression(0))->value(); |
| 108 const int offset = StandardFrameConstants::kCallerSPOffset; |
| 109 return fp() + offset + (arguments + 1) * kPointerSize; |
| 110 } |
| 111 |
| 112 |
94 } } // namespace v8::internal | 113 } } // namespace v8::internal |
OLD | NEW |