Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: src/macro-assembler-arm.cc

Issue 10233: Fix CALL_NON_FUNCTION. If a builtin is not resolved at runtime (happened at b... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 } else { 811 } else {
812 ASSERT(flags == JUMP_JS); 812 ASSERT(flags == JUMP_JS);
813 Jump(code, RelocInfo::CODE_TARGET); 813 Jump(code, RelocInfo::CODE_TARGET);
814 } 814 }
815 815
816 if (!resolved) { 816 if (!resolved) {
817 const char* name = Builtins::GetName(id); 817 const char* name = Builtins::GetName(id);
818 int argc = Builtins::GetArgumentsCount(id); 818 int argc = Builtins::GetArgumentsCount(id);
819 uint32_t flags = 819 uint32_t flags =
820 Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | 820 Bootstrapper::FixupFlagsArgumentsCount::encode(argc) |
821 Bootstrapper::FixupFlagsIsPCRelative::encode(true); 821 Bootstrapper::FixupFlagsIsPCRelative::encode(true) |
822 Bootstrapper::FixupFlagsUseCodeObject::encode(false);
822 Unresolved entry = { pc_offset() - sizeof(Instr), flags, name }; 823 Unresolved entry = { pc_offset() - sizeof(Instr), flags, name };
823 unresolved_.Add(entry); 824 unresolved_.Add(entry);
824 } 825 }
825 } 826 }
826 827
827 828
828 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { 829 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) {
829 bool resolved; 830 bool resolved;
830 Handle<Code> code = ResolveBuiltin(id, &resolved); 831 Handle<Code> code = ResolveBuiltin(id, &resolved);
831 832
832 mov(target, Operand(code)); 833 mov(target, Operand(code));
833 if (!resolved) { 834 if (!resolved) {
834 const char* name = Builtins::GetName(id); 835 const char* name = Builtins::GetName(id);
835 int argc = Builtins::GetArgumentsCount(id); 836 int argc = Builtins::GetArgumentsCount(id);
836 uint32_t flags = 837 uint32_t flags =
837 Bootstrapper::FixupFlagsArgumentsCount::encode(argc) | 838 Bootstrapper::FixupFlagsArgumentsCount::encode(argc) |
838 Bootstrapper::FixupFlagsIsPCRelative::encode(true); 839 Bootstrapper::FixupFlagsIsPCRelative::encode(true) |
840 Bootstrapper::FixupFlagsUseCodeObject::encode(true);
839 Unresolved entry = { pc_offset() - sizeof(Instr), flags, name }; 841 Unresolved entry = { pc_offset() - sizeof(Instr), flags, name };
840 unresolved_.Add(entry); 842 unresolved_.Add(entry);
841 } 843 }
844
845 add(target, target, Operand(Code::kHeaderSize - kHeapObjectTag));
842 } 846 }
843 847
844 848
845 void MacroAssembler::Assert(Condition cc, const char* msg) { 849 void MacroAssembler::Assert(Condition cc, const char* msg) {
846 if (FLAG_debug_code) 850 if (FLAG_debug_code)
847 Check(cc, msg); 851 Check(cc, msg);
848 } 852 }
849 853
850 854
851 void MacroAssembler::Check(Condition cc, const char* msg) { 855 void MacroAssembler::Check(Condition cc, const char* msg) {
(...skipping 22 matching lines...) Expand all
874 #endif 878 #endif
875 mov(r0, Operand(p0)); 879 mov(r0, Operand(p0));
876 push(r0); 880 push(r0);
877 mov(r0, Operand(Smi::FromInt(p1 - p0))); 881 mov(r0, Operand(Smi::FromInt(p1 - p0)));
878 push(r0); 882 push(r0);
879 CallRuntime(Runtime::kAbort, 2); 883 CallRuntime(Runtime::kAbort, 2);
880 // will not return here 884 // will not return here
881 } 885 }
882 886
883 } } // namespace v8::internal 887 } } // namespace v8::internal
OLDNEW
« src/bootstrapper.cc ('K') | « src/codegen-arm.cc ('k') | src/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698