blob: 683b8626e549308921c8e5240e4f935577a23e17 [file] [log] [blame]
ager@chromium.org5c838252010-02-19 08:53:10 +00001// Copyright 2010 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#include "v8.h"
29
erik.corry@gmail.com9dfbea42010-05-21 12:58:28 +000030#if defined(V8_TARGET_ARCH_MIPS)
31
ager@chromium.org5c838252010-02-19 08:53:10 +000032#include "ic-inl.h"
33#include "codegen-inl.h"
34#include "stub-cache.h"
35
36namespace v8 {
37namespace internal {
38
39#define __ ACCESS_MASM(masm)
40
41
42void StubCache::GenerateProbe(MacroAssembler* masm,
43 Code::Flags flags,
44 Register receiver,
45 Register name,
46 Register scratch,
fschneider@chromium.orge03fb642010-11-01 12:34:09 +000047 Register extra,
48 Register extra2) {
ager@chromium.org5c838252010-02-19 08:53:10 +000049 UNIMPLEMENTED_MIPS();
50}
51
52
53void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
54 int index,
55 Register prototype) {
56 UNIMPLEMENTED_MIPS();
57}
58
59
60// Load a fast property out of a holder object (src). In-object properties
61// are loaded directly otherwise the property is loaded from the properties
62// fixed array.
63void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
64 Register dst, Register src,
65 JSObject* holder, int index) {
66 UNIMPLEMENTED_MIPS();
67}
68
69
70void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
71 Register receiver,
72 Register scratch,
73 Label* miss_label) {
74 UNIMPLEMENTED_MIPS();
75}
76
77
ager@chromium.org5c838252010-02-19 08:53:10 +000078void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm,
79 Register receiver,
80 Register scratch1,
81 Register scratch2,
82 Label* miss_label) {
83 UNIMPLEMENTED_MIPS();
84}
85
86
87// Generate StoreField code, value is passed in r0 register.
88// After executing generated code, the receiver_reg and name_reg
89// may be clobbered.
90void StubCompiler::GenerateStoreField(MacroAssembler* masm,
ager@chromium.org5c838252010-02-19 08:53:10 +000091 JSObject* object,
92 int index,
93 Map* transition,
94 Register receiver_reg,
95 Register name_reg,
96 Register scratch,
97 Label* miss_label) {
98 UNIMPLEMENTED_MIPS();
99}
100
101
102void StubCompiler::GenerateLoadMiss(MacroAssembler* masm, Code::Kind kind) {
103 UNIMPLEMENTED_MIPS();
104}
105
106
107#undef __
108#define __ ACCESS_MASM(masm())
109
110
ager@chromium.org5c838252010-02-19 08:53:10 +0000111void StubCompiler::GenerateLoadField(JSObject* object,
112 JSObject* holder,
113 Register receiver,
114 Register scratch1,
115 Register scratch2,
116 int index,
117 String* name,
118 Label* miss) {
119 UNIMPLEMENTED_MIPS();
120}
121
122
123void StubCompiler::GenerateLoadConstant(JSObject* object,
124 JSObject* holder,
125 Register receiver,
126 Register scratch1,
127 Register scratch2,
128 Object* value,
129 String* name,
130 Label* miss) {
131 UNIMPLEMENTED_MIPS();
132}
133
134
135bool StubCompiler::GenerateLoadCallback(JSObject* object,
136 JSObject* holder,
137 Register receiver,
138 Register name_reg,
139 Register scratch1,
140 Register scratch2,
141 AccessorInfo* callback,
142 String* name,
143 Label* miss,
144 Failure** failure) {
145 UNIMPLEMENTED_MIPS();
146 __ break_(0x470);
147 return false; // UNIMPLEMENTED RETURN
148}
149
150
151void StubCompiler::GenerateLoadInterceptor(JSObject* object,
152 JSObject* holder,
153 LookupResult* lookup,
154 Register receiver,
155 Register name_reg,
156 Register scratch1,
157 Register scratch2,
158 String* name,
159 Label* miss) {
160 UNIMPLEMENTED_MIPS();
161 __ break_(0x505);
162}
163
164
165Object* StubCompiler::CompileLazyCompile(Code::Flags flags) {
kmillikin@chromium.org5d8f0e62010-03-24 08:21:20 +0000166 // Registers:
167 // a1: function
168 // ra: return address
169
170 // Enter an internal frame.
171 __ EnterInternalFrame();
172 // Preserve the function.
173 __ Push(a1);
174 // Setup aligned call.
175 __ SetupAlignedCall(t0, 1);
176 // Push the function on the stack as the argument to the runtime function.
177 __ Push(a1);
178 // Call the runtime function
179 __ CallRuntime(Runtime::kLazyCompile, 1);
180 __ ReturnFromAlignedCall();
181 // Calculate the entry point.
182 __ addiu(t9, v0, Code::kHeaderSize - kHeapObjectTag);
183 // Restore saved function.
184 __ Pop(a1);
185 // Tear down temporary frame.
186 __ LeaveInternalFrame();
187 // Do a tail-call of the compiled function.
188 __ Jump(t9);
189
190 return GetCodeWithFlags(flags, "LazyCompileStub");
ager@chromium.org5c838252010-02-19 08:53:10 +0000191}
192
193
ager@chromium.orgce5e87b2010-03-10 10:24:18 +0000194Object* CallStubCompiler::CompileCallField(JSObject* object,
ager@chromium.org5c838252010-02-19 08:53:10 +0000195 JSObject* holder,
196 int index,
197 String* name) {
198 UNIMPLEMENTED_MIPS();
199 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
200}
201
202
kmillikin@chromium.org5d8f0e62010-03-24 08:21:20 +0000203Object* CallStubCompiler::CompileArrayPushCall(Object* object,
204 JSObject* holder,
205 JSFunction* function,
206 String* name,
207 CheckType check) {
208 UNIMPLEMENTED_MIPS();
209 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
210}
211
212
213Object* CallStubCompiler::CompileArrayPopCall(Object* object,
214 JSObject* holder,
215 JSFunction* function,
216 String* name,
217 CheckType check) {
218 UNIMPLEMENTED_MIPS();
219 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
220}
221
222
ager@chromium.org5c838252010-02-19 08:53:10 +0000223Object* CallStubCompiler::CompileCallConstant(Object* object,
224 JSObject* holder,
225 JSFunction* function,
226 String* name,
227 CheckType check) {
228 UNIMPLEMENTED_MIPS();
229 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
230}
231
232
ager@chromium.orgce5e87b2010-03-10 10:24:18 +0000233Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
ager@chromium.org5c838252010-02-19 08:53:10 +0000234 JSObject* holder,
235 String* name) {
236 UNIMPLEMENTED_MIPS();
237 __ break_(0x782);
238 return GetCode(INTERCEPTOR, name);
239}
240
241
242Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
243 GlobalObject* holder,
244 JSGlobalPropertyCell* cell,
245 JSFunction* function,
246 String* name) {
247 UNIMPLEMENTED_MIPS();
248 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
249}
250
251
252Object* StoreStubCompiler::CompileStoreField(JSObject* object,
253 int index,
254 Map* transition,
255 String* name) {
256 UNIMPLEMENTED_MIPS();
257 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
258}
259
260
261Object* StoreStubCompiler::CompileStoreCallback(JSObject* object,
262 AccessorInfo* callback,
263 String* name) {
264 UNIMPLEMENTED_MIPS();
265 __ break_(0x906);
266 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
267}
268
269
270Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* receiver,
271 String* name) {
272 UNIMPLEMENTED_MIPS();
273 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
274}
275
276
277Object* StoreStubCompiler::CompileStoreGlobal(GlobalObject* object,
278 JSGlobalPropertyCell* cell,
279 String* name) {
280 UNIMPLEMENTED_MIPS();
281 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
282}
283
284
285Object* LoadStubCompiler::CompileLoadField(JSObject* object,
286 JSObject* holder,
287 int index,
288 String* name) {
289 UNIMPLEMENTED_MIPS();
290 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
291}
292
293
294Object* LoadStubCompiler::CompileLoadCallback(String* name,
295 JSObject* object,
296 JSObject* holder,
297 AccessorInfo* callback) {
298 UNIMPLEMENTED_MIPS();
299 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
300}
301
302
303Object* LoadStubCompiler::CompileLoadConstant(JSObject* object,
304 JSObject* holder,
305 Object* value,
306 String* name) {
307 UNIMPLEMENTED_MIPS();
308 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
309}
310
311
312Object* LoadStubCompiler::CompileLoadInterceptor(JSObject* object,
313 JSObject* holder,
314 String* name) {
315 UNIMPLEMENTED_MIPS();
316 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
317}
318
319
320Object* LoadStubCompiler::CompileLoadGlobal(JSObject* object,
321 GlobalObject* holder,
322 JSGlobalPropertyCell* cell,
323 String* name,
324 bool is_dont_delete) {
325 UNIMPLEMENTED_MIPS();
326 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
327}
328
329
330Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
331 JSObject* receiver,
332 JSObject* holder,
333 int index) {
334 UNIMPLEMENTED_MIPS();
335 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
336}
337
338
339Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name,
340 JSObject* receiver,
341 JSObject* holder,
342 AccessorInfo* callback) {
343 UNIMPLEMENTED_MIPS();
344 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
345}
346
347
348Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name,
349 JSObject* receiver,
350 JSObject* holder,
351 Object* value) {
352 UNIMPLEMENTED_MIPS();
353 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
354}
355
356
357Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* receiver,
358 JSObject* holder,
359 String* name) {
360 UNIMPLEMENTED_MIPS();
361 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
362}
363
364
365Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) {
366 UNIMPLEMENTED_MIPS();
367 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
368}
369
370
371Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) {
372 UNIMPLEMENTED_MIPS();
373 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
374}
375
376
377// TODO(1224671): implement the fast case.
378Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) {
379 UNIMPLEMENTED_MIPS();
380 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
381}
382
383
384Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object,
385 int index,
386 Map* transition,
387 String* name) {
388 UNIMPLEMENTED_MIPS();
389 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
390}
391
392
393Object* ConstructStubCompiler::CompileConstructStub(
394 SharedFunctionInfo* shared) {
395 UNIMPLEMENTED_MIPS();
396 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
397}
398
399
vegorov@chromium.org0a4e9012011-01-24 12:33:13 +0000400Object* ExternalArrayStubCompiler::CompileKeyedLoadStub(
401 ExternalArrayType array_type, Code::Flags flags) {
402 UNIMPLEMENTED_MIPS();
403 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
404}
405
406
407Object* ExternalArrayStubCompiler::CompileKeyedStoreStub(
408 ExternalArrayType array_type, Code::Flags flags) {
409 UNIMPLEMENTED_MIPS();
410 return reinterpret_cast<Object*>(NULL); // UNIMPLEMENTED RETURN
411}
412
413
ager@chromium.org5c838252010-02-19 08:53:10 +0000414#undef __
415
416} } // namespace v8::internal
417
erik.corry@gmail.com9dfbea42010-05-21 12:58:28 +0000418#endif // V8_TARGET_ARCH_MIPS