| 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 | |
| 297 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( | 264 void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
| 298 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, | 265 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, |
| 299 int accessor_index, int expected_arguments, Register scratch) { | 266 int accessor_index, int expected_arguments, Register scratch) { |
| 300 // ----------- S t a t e ------------- | 267 // ----------- S t a t e ------------- |
| 301 // -- rax : receiver | 268 // -- rax : receiver |
| 302 // -- rcx : name | 269 // -- rcx : name |
| 303 // -- rsp[0] : return address | 270 // -- rsp[0] : return address |
| 304 // ----------------------------------- | 271 // ----------------------------------- |
| 305 { | 272 { |
| 306 FrameScope scope(masm, StackFrame::INTERNAL); | 273 FrameScope scope(masm, StackFrame::INTERNAL); |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 // Return the generated code. | 800 // Return the generated code. |
| 834 return GetCode(kind(), Code::NORMAL, name); | 801 return GetCode(kind(), Code::NORMAL, name); |
| 835 } | 802 } |
| 836 | 803 |
| 837 | 804 |
| 838 #undef __ | 805 #undef __ |
| 839 } // namespace internal | 806 } // namespace internal |
| 840 } // namespace v8 | 807 } // namespace v8 |
| 841 | 808 |
| 842 #endif // V8_TARGET_ARCH_X64 | 809 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |