OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 ParameterCount expected(0); | 866 ParameterCount expected(0); |
867 InvokeCode(Handle<Code>(code), expected, expected, | 867 InvokeCode(Handle<Code>(code), expected, expected, |
868 RelocInfo::CODE_TARGET, flag); | 868 RelocInfo::CODE_TARGET, flag); |
869 | 869 |
870 const char* name = Builtins::GetName(id); | 870 const char* name = Builtins::GetName(id); |
871 int argc = Builtins::GetArgumentsCount(id); | 871 int argc = Builtins::GetArgumentsCount(id); |
872 | 872 |
873 if (!resolved) { | 873 if (!resolved) { |
874 uint32_t flags = | 874 uint32_t flags = |
875 Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | | 875 Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | |
876 Bootstrapper::FixupFlagsIsPCRelative::encode(true); | 876 Bootstrapper::FixupFlagsIsPCRelative::encode(true) | |
| 877 Bootstrapper::FixupFlagsUseCodeObject::encode(false); |
877 Unresolved entry = { pc_offset() - sizeof(int32_t), flags, name }; | 878 Unresolved entry = { pc_offset() - sizeof(int32_t), flags, name }; |
878 unresolved_.Add(entry); | 879 unresolved_.Add(entry); |
879 } | 880 } |
880 } | 881 } |
881 | 882 |
882 | 883 |
883 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { | 884 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { |
884 bool resolved; | 885 bool resolved; |
885 Handle<Code> code = ResolveBuiltin(id, &resolved); | 886 Handle<Code> code = ResolveBuiltin(id, &resolved); |
886 | 887 |
887 const char* name = Builtins::GetName(id); | 888 const char* name = Builtins::GetName(id); |
888 int argc = Builtins::GetArgumentsCount(id); | 889 int argc = Builtins::GetArgumentsCount(id); |
889 | 890 |
890 mov(Operand(target), Immediate(code)); | 891 mov(Operand(target), Immediate(code)); |
891 if (!resolved) { | 892 if (!resolved) { |
892 uint32_t flags = | 893 uint32_t flags = |
893 Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | | 894 Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | |
894 Bootstrapper::FixupFlagsIsPCRelative::encode(false); | 895 Bootstrapper::FixupFlagsIsPCRelative::encode(false) | |
| 896 Bootstrapper::FixupFlagsUseCodeObject::encode(true);; |
895 Unresolved entry = { pc_offset() - sizeof(int32_t), flags, name }; | 897 Unresolved entry = { pc_offset() - sizeof(int32_t), flags, name }; |
896 unresolved_.Add(entry); | 898 unresolved_.Add(entry); |
897 } | 899 } |
898 add(Operand(target), Immediate(Code::kHeaderSize - kHeapObjectTag)); | 900 add(Operand(target), Immediate(Code::kHeaderSize - kHeapObjectTag)); |
899 } | 901 } |
900 | 902 |
901 | 903 |
902 Handle<Code> MacroAssembler::ResolveBuiltin(Builtins::JavaScript id, | 904 Handle<Code> MacroAssembler::ResolveBuiltin(Builtins::JavaScript id, |
903 bool* resolved) { | 905 bool* resolved) { |
904 // Move the builtin function into the temporary function slot by | 906 // Move the builtin function into the temporary function slot by |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 // Indicate that code has changed. | 1007 // Indicate that code has changed. |
1006 CPU::FlushICache(address_, size_); | 1008 CPU::FlushICache(address_, size_); |
1007 | 1009 |
1008 // Check that the code was patched as expected. | 1010 // Check that the code was patched as expected. |
1009 ASSERT(masm_.pc_ == address_ + size_); | 1011 ASSERT(masm_.pc_ == address_ + size_); |
1010 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1012 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1011 } | 1013 } |
1012 | 1014 |
1013 | 1015 |
1014 } } // namespace v8::internal | 1016 } } // namespace v8::internal |
OLD | NEW |