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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 | 408 |
409 __ bind(&miss); | 409 __ bind(&miss); |
410 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1); | 410 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1); |
411 GenerateLoadMiss(masm(), Code::LOAD_IC); | 411 GenerateLoadMiss(masm(), Code::LOAD_IC); |
412 | 412 |
413 // Return the generated code. | 413 // Return the generated code. |
414 return GetCode(NORMAL, name); | 414 return GetCode(NORMAL, name); |
415 } | 415 } |
416 | 416 |
417 | 417 |
418 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { | |
419 UNIMPLEMENTED(); | |
420 return NULL; | |
421 } | |
422 | |
423 | |
424 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, | |
425 JSObject* object, | |
426 JSObject* holder, | |
427 AccessorInfo* callback) { | |
428 UNIMPLEMENTED(); | |
429 return NULL; | |
430 } | |
431 | |
432 | |
433 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, | |
434 JSObject* object, | |
435 JSObject* holder, | |
436 Object* callback) { | |
437 UNIMPLEMENTED(); | |
438 return NULL; | |
439 } | |
440 | |
441 | |
442 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { | |
443 UNIMPLEMENTED(); | |
444 return NULL; | |
445 } | |
446 | |
447 | |
448 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* object, | |
449 JSObject* holder, | |
450 String* name) { | |
451 UNIMPLEMENTED(); | |
452 return NULL; | |
453 } | |
454 | |
455 | |
456 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) { | |
457 UNIMPLEMENTED(); | |
458 return NULL; | |
459 } | |
460 | |
461 | |
462 | |
463 Object* StoreStubCompiler::CompileStoreCallback(JSObject* a, | 418 Object* StoreStubCompiler::CompileStoreCallback(JSObject* a, |
464 AccessorInfo* b, | 419 AccessorInfo* b, |
465 String* c) { | 420 String* c) { |
466 // TODO(X64): Implement a real stub. | 421 // TODO(X64): Implement a real stub. |
467 return Failure::InternalError(); | 422 return Failure::InternalError(); |
468 } | 423 } |
469 | 424 |
470 | 425 |
471 Object* StoreStubCompiler::CompileStoreField(JSObject* object, | 426 Object* StoreStubCompiler::CompileStoreField(JSObject* object, |
472 int index, | 427 int index, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 | 523 |
569 __ bind(&miss); | 524 __ bind(&miss); |
570 __ DecrementCounter(&Counters::keyed_load_field, 1); | 525 __ DecrementCounter(&Counters::keyed_load_field, 1); |
571 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 526 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
572 | 527 |
573 // Return the generated code. | 528 // Return the generated code. |
574 return GetCode(FIELD, name); | 529 return GetCode(FIELD, name); |
575 } | 530 } |
576 | 531 |
577 | 532 |
| 533 Object* KeyedLoadStubCompiler::CompileLoadArrayLength(String* name) { |
| 534 // TODO(X64): Implement a real stub. |
| 535 return Failure::InternalError(); |
| 536 } |
| 537 |
| 538 Object* KeyedLoadStubCompiler::CompileLoadCallback(String* name, |
| 539 JSObject* object, |
| 540 JSObject* holder, |
| 541 AccessorInfo* callback) { |
| 542 // TODO(X64): Implement a real stub. |
| 543 return Failure::InternalError(); |
| 544 } |
| 545 |
| 546 Object* KeyedLoadStubCompiler::CompileLoadConstant(String* name, |
| 547 JSObject* object, |
| 548 JSObject* holder, |
| 549 Object* callback) { |
| 550 // TODO(X64): Implement a real stub. |
| 551 return Failure::InternalError(); |
| 552 } |
| 553 |
| 554 |
| 555 Object* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { |
| 556 // TODO(X64): Implement a real stub. |
| 557 return Failure::InternalError(); |
| 558 } |
| 559 |
| 560 Object* KeyedLoadStubCompiler::CompileLoadInterceptor(JSObject* object, |
| 561 JSObject* holder, |
| 562 String* name) { |
| 563 // TODO(X64): Implement a real stub. |
| 564 return Failure::InternalError(); |
| 565 } |
| 566 |
| 567 Object* KeyedLoadStubCompiler::CompileLoadStringLength(String* name) { |
| 568 // TODO(X64): Implement a real stub. |
| 569 return Failure::InternalError(); |
| 570 } |
| 571 |
| 572 |
| 573 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, |
| 574 int index, |
| 575 Map* transition, |
| 576 String* name) { |
| 577 // ----------- S t a t e ------------- |
| 578 // -- rax : value |
| 579 // -- rsp[0] : return address |
| 580 // -- rsp[8] : key |
| 581 // -- rsp[16] : receiver |
| 582 // ----------------------------------- |
| 583 Label miss; |
| 584 |
| 585 __ IncrementCounter(&Counters::keyed_store_field, 1); |
| 586 |
| 587 // Get the name from the stack. |
| 588 __ movq(rcx, Operand(rsp, 1 * kPointerSize)); |
| 589 // Check that the name has not changed. |
| 590 __ Cmp(rcx, Handle<String>(name)); |
| 591 __ j(not_equal, &miss); |
| 592 |
| 593 // Get the object from the stack. |
| 594 __ movq(rbx, Operand(rsp, 2 * kPointerSize)); |
| 595 |
| 596 // Generate store field code. Trashes the name register. |
| 597 GenerateStoreField(masm(), |
| 598 Builtins::KeyedStoreIC_ExtendStorage, |
| 599 object, |
| 600 index, |
| 601 transition, |
| 602 rbx, rcx, rdx, |
| 603 &miss); |
| 604 |
| 605 // Handle store cache miss. |
| 606 __ bind(&miss); |
| 607 __ DecrementCounter(&Counters::keyed_store_field, 1); |
| 608 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss)); |
| 609 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 610 |
| 611 // Return the generated code. |
| 612 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
| 613 } |
| 614 |
| 615 |
578 // TODO(1241006): Avoid having lazy compile stubs specialized by the | 616 // TODO(1241006): Avoid having lazy compile stubs specialized by the |
579 // number of arguments. It is not needed anymore. | 617 // number of arguments. It is not needed anymore. |
580 Object* StubCompiler::CompileLazyCompile(Code::Flags flags) { | 618 Object* StubCompiler::CompileLazyCompile(Code::Flags flags) { |
581 // Enter an internal frame. | 619 // Enter an internal frame. |
582 __ EnterInternalFrame(); | 620 __ EnterInternalFrame(); |
583 | 621 |
584 // Push a copy of the function onto the stack. | 622 // Push a copy of the function onto the stack. |
585 __ push(rdi); | 623 __ push(rdi); |
586 | 624 |
587 __ push(rdi); // function is also the parameter to the runtime call | 625 __ push(rdi); // function is also the parameter to the runtime call |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 | 935 |
898 // Return the value (register rax). | 936 // Return the value (register rax). |
899 __ ret(0); | 937 __ ret(0); |
900 } | 938 } |
901 | 939 |
902 | 940 |
903 #undef __ | 941 #undef __ |
904 | 942 |
905 | 943 |
906 } } // namespace v8::internal | 944 } } // namespace v8::internal |
OLD | NEW |