OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2846 sra(expected_reg, expected_reg, kSmiTagSize); | 2846 sra(expected_reg, expected_reg, kSmiTagSize); |
2847 lw(code_reg, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | 2847 lw(code_reg, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
2848 | 2848 |
2849 ParameterCount expected(expected_reg); | 2849 ParameterCount expected(expected_reg); |
2850 InvokeCode(code_reg, expected, actual, flag, call_wrapper, call_kind); | 2850 InvokeCode(code_reg, expected, actual, flag, call_wrapper, call_kind); |
2851 } | 2851 } |
2852 | 2852 |
2853 | 2853 |
2854 void MacroAssembler::InvokeFunction(JSFunction* function, | 2854 void MacroAssembler::InvokeFunction(JSFunction* function, |
2855 const ParameterCount& actual, | 2855 const ParameterCount& actual, |
2856 InvokeFlag flag) { | 2856 InvokeFlag flag, |
| 2857 CallKind call_kind) { |
2857 ASSERT(function->is_compiled()); | 2858 ASSERT(function->is_compiled()); |
2858 | 2859 |
2859 // Get the function and setup the context. | 2860 // Get the function and setup the context. |
2860 li(a1, Operand(Handle<JSFunction>(function))); | 2861 li(a1, Operand(Handle<JSFunction>(function))); |
2861 lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); | 2862 lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); |
2862 | 2863 |
2863 // Invoke the cached code. | 2864 // Invoke the cached code. |
2864 Handle<Code> code(function->code()); | 2865 Handle<Code> code(function->code()); |
2865 ParameterCount expected(function->shared()->formal_parameter_count()); | 2866 ParameterCount expected(function->shared()->formal_parameter_count()); |
2866 if (V8::UseCrankshaft()) { | 2867 if (V8::UseCrankshaft()) { |
2867 UNIMPLEMENTED_MIPS(); | 2868 UNIMPLEMENTED_MIPS(); |
2868 } else { | 2869 } else { |
2869 InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag); | 2870 InvokeCode(code, expected, actual, RelocInfo::CODE_TARGET, flag, call_kind); |
2870 } | 2871 } |
2871 } | 2872 } |
2872 | 2873 |
2873 | 2874 |
2874 void MacroAssembler::IsObjectJSObjectType(Register heap_object, | 2875 void MacroAssembler::IsObjectJSObjectType(Register heap_object, |
2875 Register map, | 2876 Register map, |
2876 Register scratch, | 2877 Register scratch, |
2877 Label* fail) { | 2878 Label* fail) { |
2878 lw(map, FieldMemOperand(heap_object, HeapObject::kMapOffset)); | 2879 lw(map, FieldMemOperand(heap_object, HeapObject::kMapOffset)); |
2879 IsInstanceJSObjectType(map, scratch, fail); | 2880 IsInstanceJSObjectType(map, scratch, fail); |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3341 return TryTailCallStub(&stub); | 3342 return TryTailCallStub(&stub); |
3342 } | 3343 } |
3343 | 3344 |
3344 | 3345 |
3345 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, | 3346 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, |
3346 InvokeFlag flag, | 3347 InvokeFlag flag, |
3347 const CallWrapper& call_wrapper) { | 3348 const CallWrapper& call_wrapper) { |
3348 GetBuiltinEntry(t9, id); | 3349 GetBuiltinEntry(t9, id); |
3349 if (flag == CALL_FUNCTION) { | 3350 if (flag == CALL_FUNCTION) { |
3350 call_wrapper.BeforeCall(CallSize(t9)); | 3351 call_wrapper.BeforeCall(CallSize(t9)); |
| 3352 SetCallKind(t1, CALL_AS_METHOD); |
3351 Call(t9); | 3353 Call(t9); |
3352 call_wrapper.AfterCall(); | 3354 call_wrapper.AfterCall(); |
3353 } else { | 3355 } else { |
3354 ASSERT(flag == JUMP_FUNCTION); | 3356 ASSERT(flag == JUMP_FUNCTION); |
| 3357 SetCallKind(t1, CALL_AS_METHOD); |
3355 Jump(t9); | 3358 Jump(t9); |
3356 } | 3359 } |
3357 } | 3360 } |
3358 | 3361 |
3359 | 3362 |
3360 void MacroAssembler::GetBuiltinFunction(Register target, | 3363 void MacroAssembler::GetBuiltinFunction(Register target, |
3361 Builtins::JavaScript id) { | 3364 Builtins::JavaScript id) { |
3362 // Load the builtins object into target register. | 3365 // Load the builtins object into target register. |
3363 lw(target, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 3366 lw(target, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
3364 lw(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset)); | 3367 lw(target, FieldMemOperand(target, GlobalObject::kBuiltinsOffset)); |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4039 opcode == BGTZL); | 4042 opcode == BGTZL); |
4040 opcode = (cond == eq) ? BEQ : BNE; | 4043 opcode = (cond == eq) ? BEQ : BNE; |
4041 instr = (instr & ~kOpcodeMask) | opcode; | 4044 instr = (instr & ~kOpcodeMask) | opcode; |
4042 masm_.emit(instr); | 4045 masm_.emit(instr); |
4043 } | 4046 } |
4044 | 4047 |
4045 | 4048 |
4046 } } // namespace v8::internal | 4049 } } // namespace v8::internal |
4047 | 4050 |
4048 #endif // V8_TARGET_ARCH_MIPS | 4051 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |