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 14 matching lines...) Expand all Loading... |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "frames-inl.h" | 30 #include "frames-inl.h" |
31 | 31 |
32 namespace v8 { | 32 namespace v8 { |
33 namespace internal { | 33 namespace internal { |
34 | 34 |
35 StackFrame::Type ExitFrame::GetStateForFramePointer(unsigned char* a, | 35 |
36 StackFrame::State* b) { | 36 StackFrame::Type StackFrame::ComputeType(State* state) { |
37 // TODO(X64): UNIMPLEMENTED | 37 ASSERT(state->fp != NULL); |
38 return NONE; | 38 if (StandardFrame::IsArgumentsAdaptorFrame(state->fp)) { |
| 39 return ARGUMENTS_ADAPTOR; |
| 40 } |
| 41 // The marker and function offsets overlap. If the marker isn't a |
| 42 // smi then the frame is a JavaScript frame -- and the marker is |
| 43 // really the function. |
| 44 const int offset = StandardFrameConstants::kMarkerOffset; |
| 45 Object* marker = Memory::Object_at(state->fp + offset); |
| 46 if (!marker->IsSmi()) return JAVA_SCRIPT; |
| 47 return static_cast<StackFrame::Type>(Smi::cast(marker)->value()); |
| 48 } |
| 49 |
| 50 |
| 51 StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) { |
| 52 if (fp == 0) return NONE; |
| 53 // Compute the stack pointer. |
| 54 Address sp = Memory::Address_at(fp + ExitFrameConstants::kSPOffset); |
| 55 // Fill in the state. |
| 56 state->fp = fp; |
| 57 state->sp = sp; |
| 58 state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize); |
| 59 // Determine frame type. |
| 60 if (Memory::Address_at(fp + ExitFrameConstants::kDebugMarkOffset) != 0) { |
| 61 return EXIT_DEBUG; |
| 62 } else { |
| 63 return EXIT; |
| 64 } |
39 } | 65 } |
40 | 66 |
41 int JavaScriptFrame::GetProvidedParametersCount() const { | 67 int JavaScriptFrame::GetProvidedParametersCount() const { |
42 UNIMPLEMENTED(); | 68 UNIMPLEMENTED(); |
43 return 0; | 69 return 0; |
44 } | 70 } |
45 | 71 |
46 StackFrame::Type StackFrame::ComputeType(StackFrame::State* a) { | |
47 UNIMPLEMENTED(); | |
48 return NONE; | |
49 } | |
50 | |
51 byte* ArgumentsAdaptorFrame::GetCallerStackPointer() const { | 72 byte* ArgumentsAdaptorFrame::GetCallerStackPointer() const { |
52 UNIMPLEMENTED(); | 73 UNIMPLEMENTED(); |
53 return NULL; | 74 return NULL; |
54 } | 75 } |
55 | 76 |
56 | 77 |
57 void ExitFrame::Iterate(ObjectVisitor* a) const { | 78 void ExitFrame::Iterate(ObjectVisitor* a) const { |
58 UNIMPLEMENTED(); | 79 UNIMPLEMENTED(); |
59 } | 80 } |
60 | 81 |
61 byte* InternalFrame::GetCallerStackPointer() const { | 82 byte* InternalFrame::GetCallerStackPointer() const { |
62 UNIMPLEMENTED(); | 83 UNIMPLEMENTED(); |
63 return NULL; | 84 return NULL; |
64 } | 85 } |
65 | 86 |
66 byte* JavaScriptFrame::GetCallerStackPointer() const { | 87 byte* JavaScriptFrame::GetCallerStackPointer() const { |
67 UNIMPLEMENTED(); | 88 UNIMPLEMENTED(); |
68 return NULL; | 89 return NULL; |
69 } | 90 } |
70 | 91 |
71 | 92 |
72 } } // namespace v8::internal | 93 } } // namespace v8::internal |
OLD | NEW |