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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 Object* marker = Memory::Object_at(state->fp + offset); | 47 Object* marker = Memory::Object_at(state->fp + offset); |
48 if (!marker->IsSmi()) return JAVA_SCRIPT; | 48 if (!marker->IsSmi()) return JAVA_SCRIPT; |
49 return static_cast<StackFrame::Type>(Smi::cast(marker)->value()); | 49 return static_cast<StackFrame::Type>(Smi::cast(marker)->value()); |
50 } | 50 } |
51 | 51 |
52 | 52 |
53 StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) { | 53 StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) { |
54 if (fp == 0) return NONE; | 54 if (fp == 0) return NONE; |
55 // Compute frame type and stack pointer. | 55 // Compute frame type and stack pointer. |
56 Address sp = fp + ExitFrameConstants::kSPDisplacement; | 56 Address sp = fp + ExitFrameConstants::kSPDisplacement; |
57 const int offset = ExitFrameConstants::kCodeOffset; | 57 Type type; |
58 Object* code = Memory::Object_at(fp + offset); | 58 if (Memory::Address_at(fp + ExitFrameConstants::kDebugMarkOffset) != 0) { |
59 bool is_debug_exit = code->IsSmi(); | 59 type = EXIT_DEBUG; |
60 if (is_debug_exit) { | |
61 sp -= kNumJSCallerSaved * kPointerSize; | 60 sp -= kNumJSCallerSaved * kPointerSize; |
| 61 } else { |
| 62 type = EXIT; |
62 } | 63 } |
63 // Fill in the state. | 64 // Fill in the state. |
64 state->sp = sp; | 65 state->sp = sp; |
65 state->fp = fp; | 66 state->fp = fp; |
66 state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize); | 67 state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize); |
67 return EXIT; | 68 return type; |
68 } | 69 } |
69 | 70 |
70 | 71 |
71 void ExitFrame::Iterate(ObjectVisitor* v) const { | 72 void ExitFrame::Iterate(ObjectVisitor* v) const { |
72 v->VisitPointer(&code_slot()); | 73 // Do nothing |
73 // The arguments are traversed as part of the expression stack of | |
74 // the calling frame. | |
75 } | 74 } |
76 | 75 |
77 | 76 |
78 int JavaScriptFrame::GetProvidedParametersCount() const { | 77 int JavaScriptFrame::GetProvidedParametersCount() const { |
79 return ComputeParametersCount(); | 78 return ComputeParametersCount(); |
80 } | 79 } |
81 | 80 |
82 | 81 |
83 Address JavaScriptFrame::GetCallerStackPointer() const { | 82 Address JavaScriptFrame::GetCallerStackPointer() const { |
84 int arguments; | 83 int arguments; |
(...skipping 25 matching lines...) Expand all Loading... |
110 | 109 |
111 | 110 |
112 Address InternalFrame::GetCallerStackPointer() const { | 111 Address InternalFrame::GetCallerStackPointer() const { |
113 // Internal frames have no arguments. The stack pointer of the | 112 // Internal frames have no arguments. The stack pointer of the |
114 // caller is at a fixed offset from the frame pointer. | 113 // caller is at a fixed offset from the frame pointer. |
115 return fp() + StandardFrameConstants::kCallerSPOffset; | 114 return fp() + StandardFrameConstants::kCallerSPOffset; |
116 } | 115 } |
117 | 116 |
118 | 117 |
119 } } // namespace v8::internal | 118 } } // namespace v8::internal |
OLD | NEW |