OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 Code::Flags flags = Code::ComputeMonomorphicFlags( | 586 Code::Flags flags = Code::ComputeMonomorphicFlags( |
587 kind, extra_state, Code::CONSTANT_FUNCTION, argc, cache_holder); | 587 kind, extra_state, Code::CONSTANT_FUNCTION, argc, cache_holder); |
588 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), | 588 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), |
589 isolate_); | 589 isolate_); |
590 if (probe->IsCode()) return Handle<Code>::cast(probe); | 590 if (probe->IsCode()) return Handle<Code>::cast(probe); |
591 | 591 |
592 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); | 592 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); |
593 Handle<Code> code = | 593 Handle<Code> code = |
594 compiler.CompileCallConstant(object, holder, name, check, function); | 594 compiler.CompileCallConstant(object, holder, name, check, function); |
595 code->set_check_type(check); | 595 code->set_check_type(check); |
596 ASSERT_EQ(flags, code->flags()); | 596 ASSERT(flags == code->flags()); |
597 PROFILE(isolate_, | 597 PROFILE(isolate_, |
598 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); | 598 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); |
599 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); | 599 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); |
600 JSObject::UpdateMapCodeCache(stub_holder, name, code); | 600 JSObject::UpdateMapCodeCache(stub_holder, name, code); |
601 return code; | 601 return code; |
602 } | 602 } |
603 | 603 |
604 | 604 |
605 Handle<Code> StubCache::ComputeCallField(int argc, | 605 Handle<Code> StubCache::ComputeCallField(int argc, |
606 Code::Kind kind, | 606 Code::Kind kind, |
(...skipping 19 matching lines...) Expand all Loading... |
626 Code::Flags flags = Code::ComputeMonomorphicFlags( | 626 Code::Flags flags = Code::ComputeMonomorphicFlags( |
627 kind, extra_state, Code::FIELD, argc, cache_holder); | 627 kind, extra_state, Code::FIELD, argc, cache_holder); |
628 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), | 628 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), |
629 isolate_); | 629 isolate_); |
630 if (probe->IsCode()) return Handle<Code>::cast(probe); | 630 if (probe->IsCode()) return Handle<Code>::cast(probe); |
631 | 631 |
632 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); | 632 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); |
633 Handle<Code> code = | 633 Handle<Code> code = |
634 compiler.CompileCallField(Handle<JSObject>::cast(object), | 634 compiler.CompileCallField(Handle<JSObject>::cast(object), |
635 holder, index, name); | 635 holder, index, name); |
636 ASSERT_EQ(flags, code->flags()); | 636 ASSERT(flags == code->flags()); |
637 PROFILE(isolate_, | 637 PROFILE(isolate_, |
638 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); | 638 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); |
639 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); | 639 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); |
640 JSObject::UpdateMapCodeCache(stub_holder, name, code); | 640 JSObject::UpdateMapCodeCache(stub_holder, name, code); |
641 return code; | 641 return code; |
642 } | 642 } |
643 | 643 |
644 | 644 |
645 Handle<Code> StubCache::ComputeCallInterceptor(int argc, | 645 Handle<Code> StubCache::ComputeCallInterceptor(int argc, |
646 Code::Kind kind, | 646 Code::Kind kind, |
(...skipping 18 matching lines...) Expand all Loading... |
665 Code::Flags flags = Code::ComputeMonomorphicFlags( | 665 Code::Flags flags = Code::ComputeMonomorphicFlags( |
666 kind, extra_state, Code::INTERCEPTOR, argc, cache_holder); | 666 kind, extra_state, Code::INTERCEPTOR, argc, cache_holder); |
667 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), | 667 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), |
668 isolate_); | 668 isolate_); |
669 if (probe->IsCode()) return Handle<Code>::cast(probe); | 669 if (probe->IsCode()) return Handle<Code>::cast(probe); |
670 | 670 |
671 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); | 671 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); |
672 Handle<Code> code = | 672 Handle<Code> code = |
673 compiler.CompileCallInterceptor(Handle<JSObject>::cast(object), | 673 compiler.CompileCallInterceptor(Handle<JSObject>::cast(object), |
674 holder, name); | 674 holder, name); |
675 ASSERT_EQ(flags, code->flags()); | 675 ASSERT(flags == code->flags()); |
676 PROFILE(isolate(), | 676 PROFILE(isolate(), |
677 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); | 677 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); |
678 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); | 678 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); |
679 JSObject::UpdateMapCodeCache(stub_holder, name, code); | 679 JSObject::UpdateMapCodeCache(stub_holder, name, code); |
680 return code; | 680 return code; |
681 } | 681 } |
682 | 682 |
683 | 683 |
684 Handle<Code> StubCache::ComputeCallGlobal(int argc, | 684 Handle<Code> StubCache::ComputeCallGlobal(int argc, |
685 Code::Kind kind, | 685 Code::Kind kind, |
686 Code::ExtraICState extra_state, | 686 Code::ExtraICState extra_state, |
687 Handle<Name> name, | 687 Handle<Name> name, |
688 Handle<JSObject> receiver, | 688 Handle<JSObject> receiver, |
689 Handle<GlobalObject> holder, | 689 Handle<GlobalObject> holder, |
690 Handle<JSGlobalPropertyCell> cell, | 690 Handle<JSGlobalPropertyCell> cell, |
691 Handle<JSFunction> function) { | 691 Handle<JSFunction> function) { |
692 InlineCacheHolderFlag cache_holder = | 692 InlineCacheHolderFlag cache_holder = |
693 IC::GetCodeCacheForObject(*receiver, *holder); | 693 IC::GetCodeCacheForObject(*receiver, *holder); |
694 Handle<JSObject> stub_holder(IC::GetCodeCacheHolder( | 694 Handle<JSObject> stub_holder(IC::GetCodeCacheHolder( |
695 isolate_, *receiver, cache_holder)); | 695 isolate_, *receiver, cache_holder)); |
696 Code::Flags flags = Code::ComputeMonomorphicFlags( | 696 Code::Flags flags = Code::ComputeMonomorphicFlags( |
697 kind, extra_state, Code::NORMAL, argc, cache_holder); | 697 kind, extra_state, Code::NORMAL, argc, cache_holder); |
698 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), | 698 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), |
699 isolate_); | 699 isolate_); |
700 if (probe->IsCode()) return Handle<Code>::cast(probe); | 700 if (probe->IsCode()) return Handle<Code>::cast(probe); |
701 | 701 |
702 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); | 702 CallStubCompiler compiler(isolate(), argc, kind, extra_state, cache_holder); |
703 Handle<Code> code = | 703 Handle<Code> code = |
704 compiler.CompileCallGlobal(receiver, holder, cell, function, name); | 704 compiler.CompileCallGlobal(receiver, holder, cell, function, name); |
705 ASSERT_EQ(flags, code->flags()); | 705 ASSERT(flags == code->flags()); |
706 PROFILE(isolate(), | 706 PROFILE(isolate(), |
707 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); | 707 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); |
708 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); | 708 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); |
709 JSObject::UpdateMapCodeCache(stub_holder, name, code); | 709 JSObject::UpdateMapCodeCache(stub_holder, name, code); |
710 return code; | 710 return code; |
711 } | 711 } |
712 | 712 |
713 | 713 |
714 static void FillCache(Isolate* isolate, Handle<Code> code) { | 714 static void FillCache(Isolate* isolate, Handle<Code> code) { |
715 Handle<UnseededNumberDictionary> dictionary = | 715 Handle<UnseededNumberDictionary> dictionary = |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 Handle<FunctionTemplateInfo>( | 1987 Handle<FunctionTemplateInfo>( |
1988 FunctionTemplateInfo::cast(signature->receiver())); | 1988 FunctionTemplateInfo::cast(signature->receiver())); |
1989 } | 1989 } |
1990 } | 1990 } |
1991 | 1991 |
1992 is_simple_api_call_ = true; | 1992 is_simple_api_call_ = true; |
1993 } | 1993 } |
1994 | 1994 |
1995 | 1995 |
1996 } } // namespace v8::internal | 1996 } } // namespace v8::internal |
OLD | NEW |