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