OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // The marker and function offsets overlap. If the marker isn't a | 45 // The marker and function offsets overlap. If the marker isn't a |
46 // smi then the frame is a JavaScript frame -- and the marker is | 46 // smi then the frame is a JavaScript frame -- and the marker is |
47 // really the function. | 47 // really the function. |
48 const int offset = StandardFrameConstants::kMarkerOffset; | 48 const int offset = StandardFrameConstants::kMarkerOffset; |
49 Object* marker = Memory::Object_at(state->fp + offset); | 49 Object* marker = Memory::Object_at(state->fp + offset); |
50 if (!marker->IsSmi()) return JAVA_SCRIPT; | 50 if (!marker->IsSmi()) return JAVA_SCRIPT; |
51 return static_cast<StackFrame::Type>(Smi::cast(marker)->value()); | 51 return static_cast<StackFrame::Type>(Smi::cast(marker)->value()); |
52 } | 52 } |
53 | 53 |
54 | 54 |
55 StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) { | 55 Address ExitFrame::ComputeStackPointer(Address fp) { |
56 if (fp == 0) return NONE; | |
57 // Compute frame type and stack pointer. | |
58 Address sp = fp + ExitFrameConstants::kSPDisplacement; | 56 Address sp = fp + ExitFrameConstants::kSPDisplacement; |
59 const int offset = ExitFrameConstants::kCodeOffset; | 57 const int offset = ExitFrameConstants::kCodeOffset; |
60 Object* code = Memory::Object_at(fp + offset); | 58 Object* code = Memory::Object_at(fp + offset); |
61 bool is_debug_exit = code->IsSmi(); | 59 bool is_debug_exit = code->IsSmi(); |
62 if (is_debug_exit) { | 60 if (is_debug_exit) { |
63 sp -= kNumJSCallerSaved * kPointerSize; | 61 sp -= kNumJSCallerSaved * kPointerSize; |
64 } | 62 } |
65 // Fill in the state. | 63 return sp; |
66 state->sp = sp; | |
67 state->fp = fp; | |
68 state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize); | |
69 return EXIT; | |
70 } | 64 } |
71 | 65 |
72 | 66 |
73 void ExitFrame::Iterate(ObjectVisitor* v) const { | 67 void ExitFrame::Iterate(ObjectVisitor* v) const { |
74 // Do nothing | 68 // Do nothing |
75 } | 69 } |
76 | 70 |
77 | 71 |
78 int JavaScriptFrame::GetProvidedParametersCount() const { | 72 int JavaScriptFrame::GetProvidedParametersCount() const { |
79 return ComputeParametersCount(); | 73 return ComputeParametersCount(); |
(...skipping 13 matching lines...) Expand all Loading... |
93 | 87 |
94 | 88 |
95 Address InternalFrame::GetCallerStackPointer() const { | 89 Address InternalFrame::GetCallerStackPointer() const { |
96 return fp() + StandardFrameConstants::kCallerSPOffset; | 90 return fp() + StandardFrameConstants::kCallerSPOffset; |
97 } | 91 } |
98 | 92 |
99 | 93 |
100 } } // namespace v8::internal | 94 } } // namespace v8::internal |
101 | 95 |
102 #endif // V8_TARGET_ARCH_MIPS | 96 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |