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 3102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3113 | 3113 |
3114 | 3114 |
3115 void MacroAssembler::InvokeFunction(JSFunction* function, | 3115 void MacroAssembler::InvokeFunction(JSFunction* function, |
3116 const ParameterCount& actual, | 3116 const ParameterCount& actual, |
3117 InvokeFlag flag, | 3117 InvokeFlag flag, |
3118 const CallWrapper& call_wrapper, | 3118 const CallWrapper& call_wrapper, |
3119 CallKind call_kind) { | 3119 CallKind call_kind) { |
3120 // You can't call a function without a valid frame. | 3120 // You can't call a function without a valid frame. |
3121 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 3121 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
3122 | 3122 |
3123 ASSERT(function->is_compiled()); | |
3124 // Get the function and setup the context. | 3123 // Get the function and setup the context. |
3125 Move(rdi, Handle<JSFunction>(function)); | 3124 Move(rdi, Handle<JSFunction>(function)); |
3126 movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); | 3125 movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); |
3127 | 3126 |
3128 if (V8::UseCrankshaft()) { | 3127 // We call indirectly through the code field in the function to |
3129 // Since Crankshaft can recompile a function, we need to load | 3128 // allow recompilation to take effect without changing any of the |
3130 // the Code object every time we call the function. | 3129 // call sites. |
3131 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); | 3130 movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); |
3132 ParameterCount expected(function->shared()->formal_parameter_count()); | 3131 ParameterCount expected(function->shared()->formal_parameter_count()); |
3133 InvokeCode(rdx, expected, actual, flag, call_wrapper, call_kind); | 3132 InvokeCode(rdx, expected, actual, flag, call_wrapper, call_kind); |
3134 } else { | |
3135 // Invoke the cached code. | |
3136 Handle<Code> code(function->code()); | |
3137 ParameterCount expected(function->shared()->formal_parameter_count()); | |
3138 InvokeCode(code, | |
3139 expected, | |
3140 actual, | |
3141 RelocInfo::CODE_TARGET, | |
3142 flag, | |
3143 call_wrapper, | |
3144 call_kind); | |
3145 } | |
3146 } | 3133 } |
3147 | 3134 |
3148 | 3135 |
3149 void MacroAssembler::InvokePrologue(const ParameterCount& expected, | 3136 void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
3150 const ParameterCount& actual, | 3137 const ParameterCount& actual, |
3151 Handle<Code> code_constant, | 3138 Handle<Code> code_constant, |
3152 Register code_register, | 3139 Register code_register, |
3153 Label* done, | 3140 Label* done, |
3154 InvokeFlag flag, | 3141 InvokeFlag flag, |
3155 Label::Distance near_jump, | 3142 Label::Distance near_jump, |
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4327 | 4314 |
4328 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); | 4315 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); |
4329 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); | 4316 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); |
4330 | 4317 |
4331 bind(&done); | 4318 bind(&done); |
4332 } | 4319 } |
4333 | 4320 |
4334 } } // namespace v8::internal | 4321 } } // namespace v8::internal |
4335 | 4322 |
4336 #endif // V8_TARGET_ARCH_X64 | 4323 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |