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