OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 __ ret(0); | 299 __ ret(0); |
300 } | 300 } |
301 | 301 |
302 | 302 |
303 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { | 303 void KeyedLoadIC::GenerateMiss(MacroAssembler* masm) { |
304 // ----------- S t a t e ------------- | 304 // ----------- S t a t e ------------- |
305 // -- rsp[0] : return address | 305 // -- rsp[0] : return address |
306 // -- rsp[8] : name | 306 // -- rsp[8] : name |
307 // -- rsp[16] : receiver | 307 // -- rsp[16] : receiver |
308 // ----------------------------------- | 308 // ----------------------------------- |
309 | 309 Generate(masm, ExternalReference(IC_Utility(kKeyedLoadIC_Miss))); |
310 Generate(masm, ExternalReference(Runtime::kKeyedGetProperty)); | |
311 } | 310 } |
312 | 311 |
313 | 312 |
314 bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) { | 313 bool KeyedLoadIC::PatchInlinedLoad(Address address, Object* map) { |
315 // Never patch the map in the map check, so the check always fails. | 314 // Never patch the map in the map check, so the check always fails. |
316 return false; | 315 return false; |
317 } | 316 } |
318 | 317 |
319 | 318 |
320 bool KeyedStoreIC::PatchInlinedStore(Address address, Object* map) { | 319 bool KeyedStoreIC::PatchInlinedStore(Address address, Object* map) { |
(...skipping 13 matching lines...) Expand all Loading... |
334 __ pop(rcx); | 333 __ pop(rcx); |
335 __ push(Operand(rsp, 1 * kPointerSize)); // receiver | 334 __ push(Operand(rsp, 1 * kPointerSize)); // receiver |
336 __ push(Operand(rsp, 1 * kPointerSize)); // key | 335 __ push(Operand(rsp, 1 * kPointerSize)); // key |
337 __ push(rax); // value | 336 __ push(rax); // value |
338 __ push(rcx); // return address | 337 __ push(rcx); // return address |
339 | 338 |
340 // Do tail-call to runtime routine. | 339 // Do tail-call to runtime routine. |
341 __ TailCallRuntime(f, 3); | 340 __ TailCallRuntime(f, 3); |
342 } | 341 } |
343 | 342 |
| 343 |
344 void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) { | 344 void KeyedStoreIC::GenerateExtendStorage(MacroAssembler* masm) { |
345 __ int3(); | 345 // ----------- S t a t e ------------- |
346 __ movq(rax, Immediate(0xdead1234)); | 346 // -- rax : value |
| 347 // -- rcx : transition map |
| 348 // -- rsp[0] : return address |
| 349 // -- rsp[8] : key |
| 350 // -- rsp[16] : receiver |
| 351 // ----------------------------------- |
| 352 |
| 353 __ pop(rbx); |
| 354 __ push(Operand(rsp, 1 * kPointerSize)); // receiver |
| 355 __ push(rcx); // transition map |
| 356 __ push(rax); // value |
| 357 __ push(rbx); // return address |
| 358 |
| 359 // Do tail-call to runtime routine. |
| 360 __ TailCallRuntime( |
| 361 ExternalReference(IC_Utility(kSharedStoreIC_ExtendStorage)), 3); |
347 } | 362 } |
348 | 363 |
349 | 364 |
350 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { | 365 void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm) { |
351 // ----------- S t a t e ------------- | 366 // ----------- S t a t e ------------- |
352 // -- rax : value | 367 // -- rax : value |
353 // -- rsp[0] : return address | 368 // -- rsp[0] : return address |
354 // -- rsp[8] : key | 369 // -- rsp[8] : key |
355 // -- rsp[16] : receiver | 370 // -- rsp[16] : receiver |
356 // ----------------------------------- | 371 // ----------------------------------- |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 // rbx: index (as a smi) | 468 // rbx: index (as a smi) |
454 __ movq(Operand(rcx, rbx, times_4, FixedArray::kHeaderSize - kHeapObjectTag), | 469 __ movq(Operand(rcx, rbx, times_4, FixedArray::kHeaderSize - kHeapObjectTag), |
455 rax); | 470 rax); |
456 // Update write barrier for the elements array address. | 471 // Update write barrier for the elements array address. |
457 __ movq(rdx, rax); | 472 __ movq(rdx, rax); |
458 __ RecordWrite(rcx, 0, rdx, rbx); | 473 __ RecordWrite(rcx, 0, rdx, rbx); |
459 __ ret(0); | 474 __ ret(0); |
460 } | 475 } |
461 | 476 |
462 | 477 |
463 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, | |
464 int index, | |
465 Map* transition, | |
466 String* name) { | |
467 UNIMPLEMENTED(); | |
468 return NULL; | |
469 } | |
470 | |
471 | |
472 void CallIC::Generate(MacroAssembler* masm, | 478 void CallIC::Generate(MacroAssembler* masm, |
473 int argc, | 479 int argc, |
474 ExternalReference const& f) { | 480 ExternalReference const& f) { |
475 // Get the receiver of the function from the stack; 1 ~ return address. | 481 // Get the receiver of the function from the stack; 1 ~ return address. |
476 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); | 482 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize)); |
477 // Get the name of the function to call from the stack. | 483 // Get the name of the function to call from the stack. |
478 // 2 ~ receiver, return address. | 484 // 2 ~ receiver, return address. |
479 __ movq(rbx, Operand(rsp, (argc + 2) * kPointerSize)); | 485 __ movq(rbx, Operand(rsp, (argc + 2) * kPointerSize)); |
480 | 486 |
481 // Enter an internal frame. | 487 // Enter an internal frame. |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 | 652 |
647 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 653 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
648 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); | 654 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); |
649 } | 655 } |
650 | 656 |
651 | 657 |
652 #undef __ | 658 #undef __ |
653 | 659 |
654 | 660 |
655 } } // namespace v8::internal | 661 } } // namespace v8::internal |
OLD | NEW |