OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 5406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5417 // The name handler is counted as an argument. | 5417 // The name handler is counted as an argument. |
5418 StackArgumentsAccessor args(rbp, PropertyCallbackArguments::kArgsLength); | 5418 StackArgumentsAccessor args(rbp, PropertyCallbackArguments::kArgsLength); |
5419 Operand return_value_operand = args.GetArgumentOperand( | 5419 Operand return_value_operand = args.GetArgumentOperand( |
5420 PropertyCallbackArguments::kArgsLength - 1 - | 5420 PropertyCallbackArguments::kArgsLength - 1 - |
5421 PropertyCallbackArguments::kReturnValueOffset); | 5421 PropertyCallbackArguments::kReturnValueOffset); |
5422 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, | 5422 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, |
5423 kStackSpace, nullptr, return_value_operand, NULL); | 5423 kStackSpace, nullptr, return_value_operand, NULL); |
5424 } | 5424 } |
5425 | 5425 |
5426 | 5426 |
| 5427 void AtomicsLoadStub::Generate(MacroAssembler* masm) { |
| 5428 Register object = rdx; |
| 5429 Register index = rax; |
| 5430 Label table, i8, u8, i16, u16, i32, u32, f32, f64, u8c; |
| 5431 |
| 5432 __ int3(); |
| 5433 __ movp(rax, FieldOperand(object, JSTypedArray::kBufferOffset)); |
| 5434 __ movp(rax, FieldOperand(object, JSArrayBuffer::kBackingStoreOffset)); |
| 5435 |
| 5436 __ movp(rcx, FieldOperand(object, JSObject::kElementsOffset)); |
| 5437 __ movp(rcx, FieldOperand(rcx, HeapObject::kMapOffset)); |
| 5438 __ movzxbl(rcx, FieldOperand(rcx, Map::kInstanceTypeOffset)); |
| 5439 __ subb(rcx, Immediate(static_cast<int8_t>(FIXED_INT8_ARRAY_TYPE))); |
| 5440 __ Assert(below, kOffsetOutOfRange); |
| 5441 __ leaq(kScratchRegister, Operand(&table)); |
| 5442 __ jmp(Operand(kScratchRegister, rcx, times_8, 0)); |
| 5443 |
| 5444 __ bind(&i8); |
| 5445 __ movl(rax, Immediate(1)); |
| 5446 __ Integer32ToSmi(rax, rax); |
| 5447 __ Ret(); |
| 5448 |
| 5449 __ bind(&u8); |
| 5450 __ movl(rax, Immediate(2)); |
| 5451 __ Integer32ToSmi(rax, rax); |
| 5452 __ Ret(); |
| 5453 |
| 5454 __ bind(&i16); |
| 5455 __ movl(rax, Immediate(3)); |
| 5456 __ Integer32ToSmi(rax, rax); |
| 5457 __ Ret(); |
| 5458 |
| 5459 __ bind(&u16); |
| 5460 __ movl(rax, Immediate(4)); |
| 5461 __ Integer32ToSmi(rax, rax); |
| 5462 __ Ret(); |
| 5463 |
| 5464 __ bind(&i32); |
| 5465 __ movl(rax, Immediate(5)); |
| 5466 __ Integer32ToSmi(rax, rax); |
| 5467 __ Ret(); |
| 5468 |
| 5469 __ bind(&u32); |
| 5470 __ movl(rax, Immediate(6)); |
| 5471 __ Integer32ToSmi(rax, rax); |
| 5472 __ Ret(); |
| 5473 |
| 5474 __ bind(&f32); |
| 5475 __ Abort(kNoReason); |
| 5476 |
| 5477 __ bind(&f64); |
| 5478 __ Abort(kNoReason); |
| 5479 |
| 5480 __ bind(&u8c); |
| 5481 __ movl(rax, Immediate(7)); |
| 5482 __ Integer32ToSmi(rax, rax); |
| 5483 __ Ret(); |
| 5484 |
| 5485 __ bind(&table); |
| 5486 __ dq(&i8); |
| 5487 __ dq(&u8); |
| 5488 __ dq(&i16); |
| 5489 __ dq(&u16); |
| 5490 __ dq(&i32); |
| 5491 __ dq(&u32); |
| 5492 __ dq(&f32); |
| 5493 __ dq(&f64); |
| 5494 __ dq(&u8c); |
| 5495 |
| 5496 __ Ret(); |
| 5497 } |
| 5498 |
| 5499 |
5427 #undef __ | 5500 #undef __ |
5428 | 5501 |
5429 } // namespace internal | 5502 } // namespace internal |
5430 } // namespace v8 | 5503 } // namespace v8 |
5431 | 5504 |
5432 #endif // V8_TARGET_ARCH_X64 | 5505 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |