Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: src/mips/frames-mips.cc

Issue 549079: Support for MIPS in architecture independent files.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
27
28
29 #include "v8.h"
30
31 #include "frames-inl.h"
32 #include "mips/assembler-mips-inl.h"
33
34 // FROM arm code
35 // Seems to be the same for all arch except for the StackFrame::Type ExitFrame:: GetStateForFramePointer function
36
37 namespace v8 {
38 namespace internal {
39
40
41 StackFrame::Type StackFrame::ComputeType(State* state) {
42 ASSERT(state->fp != NULL);
43 if (StandardFrame::IsArgumentsAdaptorFrame(state->fp)) {
44 return ARGUMENTS_ADAPTOR;
45 }
46 // The marker and function offsets overlap. If the marker isn't a
47 // smi then the frame is a JavaScript frame -- and the marker is
48 // really the function.
49 const int offset = StandardFrameConstants::kMarkerOffset;
50 Object* marker = Memory::Object_at(state->fp + offset);
51 if (!marker->IsSmi()) return JAVA_SCRIPT;
52 return static_cast<StackFrame::Type>(Smi::cast(marker)->value());
53 }
54
55
56 StackFrame::Type ExitFrame::GetStateForFramePointer(Address fp, State* state) {
57 if (fp == 0) return NONE;
58 // Compute frame type and stack pointer.
59 Address sp = fp + ExitFrameConstants::kSPDisplacement;
60 const int offset = ExitFrameConstants::kCodeOffset;
61 Object* code = Memory::Object_at(fp + offset);
62 bool is_debug_exit = code->IsSmi();
63 if (is_debug_exit) {
64 sp -= kNumJSCallerSaved * kPointerSize;
65 }
66 // Fill in the state.
67 state->sp = sp;
68 state->fp = fp;
69 state->pc_address = reinterpret_cast<Address*>(sp - 1 * kPointerSize);
70 return EXIT;
71 }
72
73
74 void ExitFrame::Iterate(ObjectVisitor* v) const {
75 // Do nothing
76 }
77
78
79 int JavaScriptFrame::GetProvidedParametersCount() const {
80 return ComputeParametersCount();
81 }
82
83
84 Address JavaScriptFrame::GetCallerStackPointer() const {
85 UNIMPLEMENTED_();
86 // int arguments;
87 // if (Heap::gc_state() != Heap::NOT_IN_GC || disable_heap_access_) {
88 // // The arguments for cooked frames are traversed as if they were
89 // // expression stack elements of the calling frame. The reason for
90 // // this rather strange decision is that we cannot access the
91 // // function during mark-compact GCs when the stack is cooked.
92 // // In fact accessing heap objects (like function->shared() below)
93 // // at all during GC is problematic.
94 // arguments = 0;
95 // } else {
96 // // Compute the number of arguments by getting the number of formal
97 // // parameters of the function. We must remember to take the
98 // // receiver into account (+1).
99 // JSFunction* function = JSFunction::cast(this->function());
100 // arguments = function->shared()->formal_parameter_count() + 1;
101 // }
102 // const int offset = StandardFrameConstants::kCallerSPOffset;
103 // return fp() + offset + (arguments * kPointerSize);
104 return static_cast<Address>(NULL); // UNIMPLEMENTED RETURN
105 }
106
107
108 Address ArgumentsAdaptorFrame::GetCallerStackPointer() const {
109 UNIMPLEMENTED_();
110 // const int arguments = Smi::cast(GetExpression(0))->value();
111 // const int offset = StandardFrameConstants::kCallerSPOffset;
112 // return fp() + offset + (arguments + 1) * kPointerSize;
113 return static_cast<Address>(NULL); // UNIMPLEMENTED RETURN
114 }
115
116
117 Address InternalFrame::GetCallerStackPointer() const {
118 UNIMPLEMENTED_();
119 // Internal frames have no arguments. The stack pointer of the
120 // caller is at a fixed offset from the frame pointer.
121 // return fp() + StandardFrameConstants::kCallerSPOffset;
122 return static_cast<Address>(NULL); // UNIMPLEMENTED RETURN
123 }
124
125
126 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698