OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 // We have to return the passed value, not the return value of the setter. | 254 // We have to return the passed value, not the return value of the setter. |
255 __ Pop(rax); | 255 __ Pop(rax); |
256 | 256 |
257 // Restore context register. | 257 // Restore context register. |
258 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 258 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
259 } | 259 } |
260 __ ret(0); | 260 __ ret(0); |
261 } | 261 } |
262 | 262 |
263 | 263 |
| 264 static void LoadIC_PushArgs(MacroAssembler* masm) { |
| 265 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 266 Register name = LoadDescriptor::NameRegister(); |
| 267 |
| 268 DCHECK(!rbx.is(receiver) && !rbx.is(name)); |
| 269 |
| 270 __ PopReturnAddressTo(rbx); |
| 271 __ Push(receiver); |
| 272 __ Push(name); |
| 273 __ PushReturnAddressFrom(rbx); |
| 274 } |
| 275 |
| 276 |
| 277 void NamedLoadHandlerCompiler::GenerateSlow(MacroAssembler* masm) { |
| 278 // Return address is on the stack. |
| 279 LoadIC_PushArgs(masm); |
| 280 |
| 281 // Do tail-call to runtime routine. |
| 282 ExternalReference ref(IC_Utility(IC::kLoadIC_Slow), masm->isolate()); |
| 283 __ TailCallExternalReference(ref, 2, 1); |
| 284 } |
| 285 |
| 286 |
| 287 void ElementHandlerCompiler::GenerateLoadSlow(MacroAssembler* masm) { |
| 288 // Return address is on the stack. |
| 289 LoadIC_PushArgs(masm); |
| 290 |
| 291 // Do tail-call to runtime routine. |
| 292 ExternalReference ref(IC_Utility(IC::kKeyedLoadIC_Slow), masm->isolate()); |
| 293 __ TailCallExternalReference(ref, 2, 1); |
| 294 } |
| 295 |
| 296 |
264 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( | 297 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
265 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, | 298 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, |
266 int accessor_index, int expected_arguments, Register scratch) { | 299 int accessor_index, int expected_arguments, Register scratch) { |
267 // ----------- S t a t e ------------- | 300 // ----------- S t a t e ------------- |
268 // -- rax : receiver | 301 // -- rax : receiver |
269 // -- rcx : name | 302 // -- rcx : name |
270 // -- rsp[0] : return address | 303 // -- rsp[0] : return address |
271 // ----------------------------------- | 304 // ----------------------------------- |
272 { | 305 { |
273 FrameScope scope(masm, StackFrame::INTERNAL); | 306 FrameScope scope(masm, StackFrame::INTERNAL); |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 // Return the generated code. | 833 // Return the generated code. |
801 return GetCode(kind(), Code::NORMAL, name); | 834 return GetCode(kind(), Code::NORMAL, name); |
802 } | 835 } |
803 | 836 |
804 | 837 |
805 #undef __ | 838 #undef __ |
806 } // namespace internal | 839 } // namespace internal |
807 } // namespace v8 | 840 } // namespace v8 |
808 | 841 |
809 #endif // V8_TARGET_ARCH_X64 | 842 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |