Home | History | Annotate | Download | only in x64

Lines Matching refs:__

39 #define __ ACCESS_MASM(masm)
64 __ lea(offset, Operand(offset, offset, times_2, 0));
66 __ LoadAddress(kScratchRegister, key_offset);
72 __ cmpl(name, Operand(kScratchRegister, offset, scale_factor, 0));
73 __ j(not_equal, &miss);
77 __ movq(kScratchRegister,
79 __ cmpq(kScratchRegister, FieldOperand(receiver, HeapObject::kMapOffset));
80 __ j(not_equal, &miss);
83 __ LoadAddress(kScratchRegister, value_offset);
84 __ movq(kScratchRegister,
88 __ movl(offset, FieldOperand(kScratchRegister, Code::kFlagsOffset));
89 __ and_(offset, Immediate(~Code::kFlagsNotUsedInLookup));
90 __ cmpl(offset, Immediate(flags));
91 __ j(not_equal, &miss);
95 __ jmp(&miss);
97 __ jmp(&miss);
102 __ addq(kScratchRegister, Immediate(Code::kHeaderSize - kHeapObjectTag));
103 __ jmp(kScratchRegister);
105 __ bind(&miss);
122 __ IncrementCounter(counters->negative_lookups(), 1);
123 __ IncrementCounter(counters->negative_lookups_miss(), 1);
125 __ movq(r0, FieldOperand(receiver, HeapObject::kMapOffset));
131 __ testb(FieldOperand(r0, Map::kBitFieldOffset),
133 __ j(not_zero, miss_label);
136 __ CmpInstanceType(r0, FIRST_SPEC_OBJECT_TYPE);
137 __ j(below, miss_label);
141 __ movq(properties, FieldOperand(receiver, JSObject::kPropertiesOffset));
144 __ CompareRoot(FieldOperand(properties, HeapObject::kMapOffset),
146 __ j(not_equal, miss_label);
155 __ bind(&done);
156 __ DecrementCounter(counters->negative_lookups_miss(), 1);
190 __ IncrementCounter(counters->megamorphic_stub_cache_probes(), 1);
193 __ JumpIfSmi(receiver, &miss);
196 __ movl(scratch, FieldOperand(name, String::kHashFieldOffset));
198 __ addl(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
199 __ xor_(scratch, Immediate(flags));
202 __ and_(scratch, Immediate((kPrimaryTableSize - 1) << kHeapObjectTagSize));
208 __ movl(scratch, FieldOperand(name, String::kHashFieldOffset));
209 __ addl(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
210 __ xor_(scratch, Immediate(flags));
211 __ and_(scratch, Immediate((kPrimaryTableSize - 1) << kHeapObjectTagSize));
212 __ subl(scratch, name);
213 __ addl(scratch, Immediate(flags));
214 __ and_(scratch, Immediate((kSecondaryTableSize - 1) << kHeapObjectTagSize));
221 __ bind(&miss);
222 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1);
230 __ movq(prototype,
233 __ movq(prototype,
236 __ movq(prototype, Operand(prototype, Context::SlotOffset(index)));
238 __ movq(prototype,
241 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
252 __ Move(prototype, isolate->global());
253 __ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)),
255 __ j(not_equal, miss);
260 __ Move(prototype, Handle<Map>(function->initial_map()));
262 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
271 __ JumpIfSmi(receiver, miss_label);
274 __ CmpObjectType(receiver, JS_ARRAY_TYPE, scratch);
275 __ j(not_equal, miss_label);
278 __ movq(rax, FieldOperand(receiver, JSArray::kLengthOffset));
279 __ ret(0);
291 __ JumpIfSmi(receiver, smi);
294 __ movq(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
295 __ movzxbq(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset));
297 __ testl(scratch, Immediate(kNotStringTag));
298 __ j(not_zero, non_string_object);
316 __ movq(rax, FieldOperand(receiver, String::kLengthOffset));
317 __ ret(0);
321 __ bind(&check_wrapper);
322 __ cmpl(scratch1, Immediate(JS_VALUE_TYPE));
323 __ j(not_equal, miss);
327 __ movq(scratch2, FieldOperand(receiver, JSValue::kValueOffset));
329 __ movq(rax, FieldOperand(scratch2, String::kLengthOffset));
330 __ ret(0);
340 __ TryGetFunctionPrototype(receiver, result, miss_label);
341 if (!result.is(rax)) __ movq(rax, result);
342 __ ret(0);
359 __ movq(dst, FieldOperand(src, offset));
363 __ movq(dst, FieldOperand(src, JSObject::kPropertiesOffset));
364 __ movq(dst, FieldOperand(dst, offset));
374 __ push(name);
377 __ Move(kScratchRegister, interceptor);
378 __ push(kScratchRegister);
379 __ push(receiver);
380 __ push(holder);
381 __ push(FieldOperand(kScratchRegister, InterceptorInfo::kDataOffset));
396 __ Set(rax, 5);
397 __ LoadAddress(rbx, ref);
400 __ CallStub(&stub);
417 __ movq(scratch, Operand(rsp, 0));
418 __ subq(rsp, Immediate(kFastApiCallArguments * kPointerSize));
419 __ movq(Operand(rsp, 0), scratch);
420 __ Move(scratch, Smi::FromInt(0));
422 __ movq(Operand(rsp, i * kPointerSize), scratch);
437 __ movq(scratch, Operand(rsp, 0));
438 __ movq(Operand(rsp, kFastApiCallArguments * kPointerSize), scratch);
439 __ addq(rsp, Immediate(kPointerSize * kFastApiCallArguments));
462 __ LoadHeapObject(rdi, function);
463 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
466 __ movq(Operand(rsp, 2 * kPointerSize), rdi);
470 __ Move(rcx, api_call_info);
471 __ movq(rbx, FieldOperand(rcx, CallHandlerInfo::kDataOffset));
472 __ movq(Operand(rsp, 3 * kPointerSize), rbx);
474 __ Move(Operand(rsp, 3 * kPointerSize), call_data);
478 __ lea(rbx, Operand(rsp, 3 * kPointerSize));
491 __ PrepareCallApiFunction(kApiStackSpace);
493 __ movq(StackSpaceOperand(0), rbx); // v8::Arguments::implicit_args_.
494 __ addq(rbx, Immediate(argc * kPointerSize));
495 __ movq(StackSpaceOperand(1), rbx); // v8::Arguments::values_.
496 __ Set(StackSpaceOperand(2), argc); // v8::Arguments::length_.
498 __ Set(StackSpaceOperand(3), 0);
501 __ lea(arguments_arg, StackSpaceOperand(0));
505 __ CallApiFunctionAndReturn(function_address,
535 __ JumpIfSmi(receiver, miss);
578 __ IncrementCounter(counters->call_const_interceptor(), 1);
581 __ IncrementCounter(counters->call_const_interceptor_fast_api(), 1);
625 __ InvokeFunction(optimization.constant_function(), arguments_,
631 __ bind(&miss_cleanup);
633 __ jmp(miss_label);
637 __ bind(&regular_invoke);
659 __ push(name_);
663 __ CallExternalReference(
669 __ pop(name_);
681 __ push(holder); // Save the holder.
682 __ push(name_); // Save the name.
690 __ pop(name_); // Restore the name.
691 __ pop(receiver); // Restore the holder.
695 __ CompareRoot(rax, Heap::kNoInterceptorResultSentinelRootIndex);
696 __ j(not_equal, interceptor_succeeded);
711 __ Jump(code, RelocInfo::CODE_TARGET);
718 __ Jump(code, RelocInfo::CODE_TARGET);
735 __ CheckMap(receiver_reg, Handle<Map>(object->map()),
740 __ CheckAccessGlobalProxy(receiver_reg, scratch, miss_label);
751 __ pop(scratch); // Return address.
752 __ push(receiver_reg);
753 __ Push(transition);
754 __ push(rax);
755 __ push(scratch);
756 __ TailCallExternalReference(
767 __ Move(FieldOperand(receiver_reg, HeapObject::kMapOffset), transition);
778 __ movq(FieldOperand(receiver_reg, offset), rax);
782 __ movq(name_reg, rax);
783 __ RecordWriteField(
789 __ movq(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset));
790 __ movq(FieldOperand(scratch, offset), rax);
794 __ movq(name_reg, rax);
795 __ RecordWriteField(
800 __ ret(0);
815 __ Move(scratch, cell);
816 __ Cmp(FieldOperand(scratch, JSGlobalPropertyCell::kValueOffset),
818 __ j(not_equal, miss);
843 #undef __
844 #define __ ACCESS_MASM((masm()))
868 __ movq(Operand(rsp, kPointerSize), object_reg);
894 __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
896 __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
902 __ movq(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
904 __ CheckMap(reg, Handle<Map>(current_map),
911 __ CheckAccessGlobalProxy(reg, scratch2, miss);
918 __ movq(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
921 __ Move(reg, prototype);
926 __ movq(Operand(rsp, kPointerSize), reg);
938 __ CheckMap(reg, Handle<Map>(holder->map()),
944 __ CheckAccessGlobalProxy(reg, scratch1, miss);
967 __ JumpIfSmi(receiver, miss);
975 __ ret(0);
990 __ JumpIfSmi(receiver, miss);
998 __ pop(scratch2); // Get return address to place it below.
1000 __ push(receiver); // receiver
1001 __ push(reg); // holder
1003 __ Move(scratch1, callback);
1004 __ push(FieldOperand(scratch1, AccessorInfo::kDataOffset)); // data
1006 __ Push(Handle<Object>(callback->data()));
1008 __ push(name_reg); // name
1022 __ movq(name_arg, rsp);
1023 __ push(scratch2); // Restore return address.
1031 __ PrepareCallApiFunction(kArgStackSpace);
1032 __ lea(rax, Operand(name_arg, 3 * kPointerSize));
1035 __ movq(StackSpaceOperand(0), rax);
1039 __ lea(accessor_info_arg, StackSpaceOperand(0));
1042 __ CallApiFunctionAndReturn(getter_address, kStackSpace);
1056 __ JumpIfSmi(receiver, miss);
1063 __ LoadHeapObject(rax, value);
1064 __ ret(0);
1082 __ JumpIfSmi(receiver, miss);
1121 __ push(receiver);
1123 __ push(holder_reg);
1124 __ push(name_reg);
1138 __ CompareRoot(rax, Heap::kNoInterceptorResultSentinelRootIndex);
1139 __ j(equal, &interceptor_failed);
1141 __ ret(0);
1143 __ bind(&interceptor_failed);
1144 __ pop(name_reg);
1145 __ pop(holder_reg);
1147 __ pop(receiver);
1172 __ ret(0);
1184 __ pop(scratch2); // return address
1185 __ push(receiver);
1186 __ push(holder_reg);
1187 __ Move(holder_reg, callback);
1188 __ push(FieldOperand(holder_reg, AccessorInfo::kDataOffset));
1189 __ push(holder_reg);
1190 __ push(name_reg);
1191 __ push(scratch2); // restore return address
1196 __ TailCallExternalReference(ref, 5, 1);
1204 __ pop(scratch2); // save old return address
1207 __ push(scratch2); // restore old return address
1211 __ TailCallExternalReference(ref, 5, 1);
1218 __ Cmp(rcx, name);
1219 __ j(not_equal, miss);
1234 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1238 __ JumpIfSmi(rdx, miss);
1248 __ Move(rdi, cell);
1249 __ movq(rdi, FieldOperand(rdi, JSGlobalPropertyCell::kValueOffset));
1258 __ JumpIfSmi(rdi, miss);
1259 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rax);
1260 __ j(not_equal, miss);
1263 __ Move(rax, Handle<SharedFunctionInfo>(function->shared()));
1264 __ cmpq(FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset), rax);
1266 __ Cmp(rdi, function);
1268 __ j(not_equal, miss);
1277 __ Jump(code, RelocInfo::CODE_TARGET);
1300 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1303 __ JumpIfSmi(rdx, &miss);
1312 __ JumpIfSmi(rdi, &miss);
1313 __ CmpObjectType(rdi, JS_FUNCTION_TYPE, rbx);
1314 __ j(not_equal, &miss);
1319 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
1320 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
1327 __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION,
1331 __ bind(&miss);
1361 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1364 __ JumpIfSmi(rdx, &miss);
1371 __ movq(rax, FieldOperand(rdx, JSArray::kLengthOffset));
1372 __ ret((argc + 1) * kPointerSize);
1380 __ movq(rdi, FieldOperand(rdx, JSArray::kElementsOffset));
1383 __ Cmp(FieldOperand(rdi, HeapObject::kMapOffset),
1385 __ j(not_equal, &call_builtin);
1388 __ SmiToInteger32(rax, FieldOperand(rdx, JSArray::kLengthOffset));
1390 __ addl(rax, Immediate(argc));
1393 __ SmiToInteger32(rcx, FieldOperand(rdi, FixedArray::kLengthOffset));
1396 __ cmpl(rax, rcx);
1397 __ j(greater, &attempt_to_grow_elements);
1400 __ movq(rcx, Operand(rsp, argc * kPointerSize));
1401 __ JumpIfNotSmi(rcx, &with_write_barrier);
1404 __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax);
1407 __ movq(FieldOperand(rdi,
1413 __ Integer32ToSmi(rax, rax); // Return new length as smi.
1414 __ ret((argc + 1) * kPointerSize);
1416 __ bind(&with_write_barrier);
1418 __ movq(rbx, FieldOperand(rdx, HeapObject::kMapOffset));
1422 __ CheckFastObjectElements(rbx, &not_fast_object, Label::kNear);
1423 __ jmp(&fast_object);
1425 __ bind(&not_fast_object);
1426 __ CheckFastSmiOnlyElements(rbx, &call_builtin);
1429 __ movq(r9, rdi); // Backup rdi as it is going to be trashed.
1430 __ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS,
1436 __ movq(rdi, r9);
1437 __ bind(&fast_object);
1439 __ CheckFastObjectElements(rbx, &call_builtin);
1443 __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rax);
1446 __ lea(rdx, FieldOperand(rdi,
1449 __ movq(Operand(rdx, 0), rcx);
1451 __ RecordWrite(rdi, rdx, rcx, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
1454 __ Integer32ToSmi(rax, rax); // Return new length as smi.
1455 __ ret((argc + 1) * kPointerSize);
1457 __ bind(&attempt_to_grow_elements);
1459 __ jmp(&call_builtin);
1462 __ movq(rbx, Operand(rsp, argc * kPointerSize));
1466 __ JumpIfSmi(rbx, &no_fast_elements_check);
1467 __ movq(rcx, FieldOperand(rdx, HeapObject::kMapOffset));
1468 __ CheckFastObjectElements(rcx, &call_builtin, Label::kFar);
1469 __ bind(&no_fast_elements_check);
1478 __ Load(rcx, new_space_allocation_top);
1481 __ lea(rdx, FieldOperand(rdi,
1484 __ cmpq(rdx, rcx);
1485 __ j(not_equal, &call_builtin);
1486 __ addq(rcx, Immediate(kAllocationDelta * kPointerSize));
1489 __ cmpq(rcx, limit_operand);
1490 __ j(above, &call_builtin);
1493 __ Store(new_space_allocation_top, rcx);
1496 __ movq(Operand(rdx, 0), rbx);
1498 __ LoadRoot(kScratchRegister, Heap::kTheHoleValueRootIndex);
1500 __ movq(Operand(rdx, i * kPointerSize), kScratchRegister);
1508 __ RecordWrite(rdi, rdx, rbx, kDontSaveFPRegs, OMIT_REMEMBERED_SET);
1511 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1514 __ SmiAddConstant(FieldOperand(rdi, FixedArray::kLengthOffset),
1518 __ Integer32ToSmi(rax, rax);
1519 __ movq(FieldOperand(rdx, JSArray::kLengthOffset), rax);
1521 __ ret((argc + 1) * kPointerSize);
1524 __ bind(&call_builtin);
1525 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush,
1531 __ bind(&miss);
1561 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1564 __ JumpIfSmi(rdx, &miss);
1570 __ movq(rbx, FieldOperand(rdx, JSArray::kElementsOffset));
1573 __ CompareRoot(FieldOperand(rbx, HeapObject::kMapOffset),
1575 __ j(not_equal, &call_builtin);
1578 __ SmiToInteger32(rcx, FieldOperand(rdx, JSArray::kLengthOffset));
1579 __ subl(rcx, Immediate(1));
1580 __ j(negative, &return_undefined);
1583 __ LoadRoot(r9, Heap::kTheHoleValueRootIndex);
1584 __ movq(rax, FieldOperand(rbx,
1588 __ cmpq(rax, r9);
1590 __ j(equal, &call_builtin);
1593 __ Integer32ToSmiField(FieldOperand(rdx, JSArray::kLengthOffset), rcx);
1596 __ movq(FieldOperand(rbx,
1600 __ ret((argc + 1) * kPointerSize);
1602 __ bind(&return_undefined);
1603 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
1604 __ ret((argc + 1) * kPointerSize);
1606 __ bind(&call_builtin);
1607 __ TailCallExternalReference(
1612 __ bind(&miss);
1662 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize));
1664 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize));
1666 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1677 __ ret((argc + 1) * kPointerSize);
1683 __ bind(&index_out_of_range);
1684 __ LoadRoot(rax, Heap::kNanValueRootIndex);
1685 __ ret((argc + 1) * kPointerSize);
1688 __ bind(&miss);
1690 __ Move(rcx, name);
1691 __ bind(&name_miss);
1741 __ movq(receiver, Operand(rsp, (argc + 1) * kPointerSize));
1743 __ movq(index, Operand(rsp, (argc - 0) * kPointerSize));
1745 __ LoadRoot(index, Heap::kUndefinedValueRootIndex);
1757 __ ret((argc + 1) * kPointerSize);
1763 __ bind(&index_out_of_range);
1764 __ LoadRoot(rax, Heap::kEmptyStringRootIndex);
1765 __ ret((argc + 1) * kPointerSize);
1767 __ bind(&miss);
1769 __ Move(rcx, name);
1770 __ bind(&name_miss);
1801 __ movq(rdx, Operand(rsp, 2 * kPointerSize));
1802 __ JumpIfSmi(rdx, &miss);
1814 __ movq(code, Operand(rsp, 1 * kPointerSize));
1818 __ JumpIfNotSmi(code, &slow);
1821 __ SmiAndConstant(code, code, Smi::FromInt(0xffff));
1825 __ ret(2 * kPointerSize);
1832 __ bind(&slow);
1836 __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
1839 __ bind(&miss);
1882 __ movq(rdx, Operand(rsp, 2 * kPointerSize));
1883 __ JumpIfSmi(rdx, &miss);
1893 __ movq(rax, Operand(rsp, 1 * kPointerSize));
1898 __ JumpIfNotSmi(rax, &not_smi);
1899 __ SmiToInteger32(rax, rax);
1903 __ movl(rbx, rax);
1904 __ sarl(rbx, Immediate(kBitsPerInt - 1));
1907 __ xorl(rax, rbx);
1910 __ subl(rax, rbx);
1915 __ j(negative, &slow);
1918 __ Integer32ToSmi(rax, rax);
1919 __ ret(2 * kPointerSize);
1922 __ bind(&not_smi);
1923 __ CheckMap(rax, factory()->heap_number_map(), &slow, DONT_DO_SMI_CHECK);
1924 __ movq(rbx, FieldOperand(rax, HeapNumber::kValueOffset));
1931 __ movq(rdi, static_cast<int64_t>(HeapNumber::kSignMask) << sign_mask_shift,
1933 __ testq(rbx, rdi);
1934 __ j(not_zero, &negative_sign);
1935 __ ret(2 * kPointerSize);
1939 __ bind(&negative_sign);
1940 __ xor_(rbx, rdi);
1941 __ AllocateHeapNumber(rax, rdx, &slow);
1942 __ movq(FieldOperand(rax, HeapNumber::kValueOffset), rbx);
1943 __ ret(2 * kPointerSize);
1947 __ bind(&slow);
1951 __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
1954 __ bind(&miss);
1985 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
1988 __ JumpIfSmi(rdx, &miss_before_stack_reserved);
1991 __ IncrementCounter(counters->call_const(), 1);
1992 __ IncrementCounter(counters->call_const_fast_api(), 1);
1996 __ subq(rsp, Immediate(kFastApiCallArguments * kPointerSize));
2003 __ movq(rax, Operand(rsp, 3 * kPointerSize));
2004 __ movq(Operand(rsp, 0 * kPointerSize), rax);
2008 __ bind(&miss);
2009 __ addq(rsp, Immediate(kFastApiCallArguments * kPointerSize));
2011 __ bind(&miss_before_stack_reserved);
2047 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
2051 __ JumpIfSmi(rdx, &miss);
2061 __ IncrementCounter(counters->call_const(), 1);
2070 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
2071 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
2078 __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax);
2079 __ j(above_equal, &miss);
2089 __ jmp(&miss);
2097 __ JumpIfSmi(rdx, &fast);
2098 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rax);
2099 __ j(not_equal, &miss);
2100 __ bind(&fast);
2110 __ jmp(&miss);
2118 __ CompareRoot(rdx, Heap::kTrueValueRootIndex);
2119 __ j(equal, &fast);
2120 __ CompareRoot(rdx, Heap::kFalseValueRootIndex);
2121 __ j(not_equal, &miss);
2122 __ bind(&fast);
2132 __ jmp(&miss);
2140 __ InvokeFunction(function, arguments(), JUMP_FUNCTION,
2144 __ bind(&miss);
2174 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
2181 __ movq(rdx, Operand(rsp, (argc + 1) * kPointerSize));
2184 __ JumpIfSmi(rax, &miss);
2185 __ CmpObjectType(rax, JS_FUNCTION_TYPE, rbx);
2186 __ j(not_equal, &miss);
2191 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
2192 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
2196 __ movq(rdi, rax);
2200 __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION,
2204 __ bind(&miss);
2244 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset));
2245 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx);
2249 __ movq(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
2253 __ IncrementCounter(counters->call_global_inline(), 1);
2261 __ movq(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
2262 __ InvokeCode(rdx, expected, arguments(), JUMP_FUNCTION,
2266 __ bind(&miss);
2267 __ IncrementCounter(counters->call_global_inline_miss(), 1);
2291 __ bind(&miss);
2293 __ Jump(ic, RelocInfo::CODE_TARGET);
2313 __ CheckMap(rdx, Handle<Map>(object->map()), &miss,
2318 __ CheckAccessGlobalProxy(rdx, rbx, &miss);
2325 __ pop(rbx); // remove the return address
2326 __ push(rdx); // receiver
2327 __ Push(callback); // callback info
2328 __ push(rcx); // name
2329 __ push(rax); // value
2330 __ push(rbx); // restore return address
2335 __ TailCallExternalReference(store_callback_property, 4, 1);
2338 __ bind(&miss);
2340 __ Jump(ic, RelocInfo::CODE_TARGET);
2359 __ CheckMap(rdx, Handle<Map>(receiver->map()), &miss,
2364 __ CheckAccessGlobalProxy(rdx, rbx, &miss);
2371 __ pop(rbx); // remove the return address
2372 __ push(rdx); // receiver
2373 __ push(rcx); // name
2374 __ push(rax); // value
2375 __ Push(Smi::FromInt(strict_mode_));
2376 __ push(rbx); // restore return address
2381 __ TailCallExternalReference(store_ic_property, 4, 1);
2384 __ bind(&miss);
2386 __ Jump(ic, RelocInfo::CODE_TARGET);
2406 __ Cmp(FieldOperand(rdx, HeapObject::kMapOffset),
2408 __ j(not_equal, &miss);
2411 __ Move(rbx, cell);
2418 __ CompareRoot(cell_operand, Heap::kTheHoleValueRootIndex);
2419 __ j(equal, &miss);
2422 __ movq(cell_operand, rax);
2427 __ IncrementCounter(counters->named_store_global_inline(), 1);
2428 __ ret(0);
2431 __ bind(&miss);
2432 __ IncrementCounter(counters->named_store_global_inline_miss(), 1);
2434 __ Jump(ic, RelocInfo::CODE_TARGET);
2454 __ IncrementCounter(counters->keyed_store_field(), 1);
2457 __ Cmp(rcx, name);
2458 __ j(not_equal, &miss);
2464 __ bind(&miss);
2465 __ DecrementCounter(counters->keyed_store_field(), 1);
2467 __ Jump(ic, RelocInfo::CODE_TARGET);
2488 __ DispatchMap(rdx, receiver_map, stub, DO_SMI_CHECK);
2491 __ jmp(ic, RelocInfo::CODE_TARGET);
2509 __ JumpIfSmi(rdx, &miss, Label::kNear);
2511 __ movq(rdi, FieldOperand(rdx, HeapObject::kMapOffset));
2515 __ Cmp(rdi, receiver_maps->at(i));
2517 __ j(equal, handler_stubs->at(i), RelocInfo::CODE_TARGET);
2520 __ j(not_equal, &next_map, Label::kNear);
2521 __ movq(rbx, transitioned_maps->at(i), RelocInfo::EMBEDDED_OBJECT);
2522 __ jmp(handler_stubs->at(i), RelocInfo::CODE_TARGET);
2523 __ bind(&next_map);
2527 __ bind(&miss);
2529 __ jmp(ic, RelocInfo::CODE_TARGET);
2547 __ JumpIfSmi(rax, &miss);
2563 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
2564 __ ret(0);
2566 __ bind(&miss);
2586 __ bind(&miss);
2607 __ bind(&miss);
2627 __ bind(&miss);
2651 __ bind(&miss);
2673 __ JumpIfSmi(rax, &miss);
2677 __ Move(rbx, cell);
2678 __ movq(rbx, FieldOperand(rbx, JSGlobalPropertyCell::kValueOffset));
2682 __
2683 __ j(equal, &miss);
2685 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex);
2686 __ Check(not_equal, "DontDelete cells can't contain the hole");
2690 __ IncrementCounter(counters->named_load_global_stub(), 1);
2691 __ movq(rax, rbx);
2692 __ ret(0);
2694 __ bind(&miss);
2695 __ IncrementCounter(counters->named_load_global_stub_miss(), 1);
2715 __ IncrementCounter(counters->keyed_load_field(), 1);
2718 __ Cmp(rax, name);
2719 __ j(not_equal, &miss);
2723 __ bind(&miss);
2724 __ DecrementCounter(counters->keyed_load_field(), 1);
2744 __ IncrementCounter(counters->keyed_load_callback(), 1);
2747 __ Cmp(rax, name);
2748 __ j(not_equal, &miss);
2752 __ bind(&miss);
2753 __ DecrementCounter(counters->keyed_load_callback(), 1);
2774 __ IncrementCounter(counters->keyed_load_constant_function(), 1);
2777 __ Cmp(rax, name);
2778 __ j(not_equal, &miss);
2782 __ bind(&miss);
2783 __ DecrementCounter(counters->keyed_load_constant_function(), 1);
2802 __ IncrementCounter(counters->keyed_load_interceptor(), 1);
2805 __ Cmp(rax, name);
2806 __ j(not_equal, &miss);
2812 __ bind(&miss);
2813 __ DecrementCounter(counters->keyed_load_interceptor(), 1);
2831 __ IncrementCounter(counters->keyed_load_array_length(), 1);
2834 __ Cmp(rax, name);
2835 __ j(not_equal, &miss);
2838 __ bind(&miss);
2839 __ DecrementCounter(counters->keyed_load_array_length(), 1);
2857 __ IncrementCounter(counters->keyed_load_string_length(), 1);
2860 __ Cmp(rax, name);
2861 __ j(not_equal, &miss);
2864 __ bind(&miss);
2865 __ DecrementCounter(counters->keyed_load_string_length(), 1);
2883 __ IncrementCounter(counters->keyed_load_function_prototype(), 1);
2886 __ Cmp(rax, name);
2887 __ j(not_equal, &miss);
2890 __ bind(&miss);
2891 __ DecrementCounter(counters->keyed_load_function_prototype(), 1);
2909 __ DispatchMap(rdx, receiver_map, stub, DO_SMI_CHECK);
2912 __ jmp(ic, RelocInfo::CODE_TARGET);
2928 __ JumpIfSmi(rdx, &miss);
2931 __ movq(map_reg, FieldOperand(rdx, HeapObject::kMapOffset));
2935 __ Cmp(map_reg, receiver_maps->at(current));
2936 __ j(equal, handler_ics->at(current), RelocInfo::CODE_TARGET);
2939 __ bind(&miss);
2960 __ Move(r8, factory()->undefined_value());
2966 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset));
2967 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kDebugInfoOffset));
2968 __ cmpq(rbx, r8);
2969 __ j(not_equal, &generic_stub_call);
2973 __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
2976 __ JumpIfSmi(rbx, &generic_stub_call);
2977 __ CmpObjectType(rbx, MAP_TYPE, rcx);
2978 __ j(not_equal, &generic_stub_call);
2984 __ CmpInstanceType(rbx, JS_FUNCTION_TYPE);
2985 __ Assert(not_equal, "Function constructed by construct stub.");
2991 __ movzxbq(rcx, FieldOperand(rbx, Map::kInstanceSizeOffset));
2992 __ shl(rcx, Immediate(kPointerSizeLog2));
2993 __ AllocateInNewSpace(rcx, rdx, rcx, no_reg,
2999 __ movq(Operand(rdx, JSObject::kMapOffset), rbx);
3000 __ Move(rbx, factory()->empty_fixed_array());
3001 __ movq(Operand(rdx, JSObject::kPropertiesOffset), rbx);
3002 __ movq(Operand(rdx, JSObject::kElementsOffset), rbx);
3007 __ lea(r9, Operand(rdx, JSObject::kHeaderSize));
3010 __ lea(rcx, Operand(rsp, rax, times_pointer_size, 0));
3026 __ movq(rbx, r8);
3027 __ cmpq(rax, Immediate(arg_number));
3028 __ cmovq(above, rbx, Operand(rcx, arg_number * -kPointerSize));
3030 __ movq(Operand(r9, i * kPointerSize), rbx);
3034 __ Move(Operand(r9, i * kPointerSize), constant);
3043 __ movq(Operand(r9, i * kPointerSize), r8);
3049 __ movq(rbx, rax);
3050 __ movq(rax, rdx);
3051 __ or_(rax, Immediate(kHeapObjectTag));
3056 __ pop(rcx);
3057 __ lea(rsp, Operand(rsp, rbx, times_pointer_size, 1 * kPointerSize));
3058 __ push(rcx);
3060 __ IncrementCounter(counters->constructed_objects(), 1);
3061 __ IncrementCounter(counters->constructed_objects_stub(), 1);
3062 __ ret(0);
3066 __ bind(&generic_stub_call);
3068 __ Jump(code, RelocInfo::CODE_TARGET);
3075 #undef __
3076 #define __ ACCESS_MASM(masm)
3091 __ JumpIfNotSmi(rax, &miss_force_generic);
3092 __ SmiToInteger32(rbx, rax);
3093 __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
3100 __ LoadFromNumberDictionary(&slow, rcx, rax, rbx, r9, rdi, rax);
3101 __ ret(0);
3103 __ bind(&slow);
3111 __ jmp(slow_ic, RelocInfo::CODE_TARGET);
3113 __ bind(&miss_force_generic);
3121 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3138 __ JumpIfNotSmi(rax, &miss_force_generic);
3141 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
3142 __ SmiToInteger32(rcx, rax);
3143 __ cmpq(rax, FieldOperand(rbx, ExternalArray::kLengthOffset));
3145 __ j(above_equal, &miss_force_generic);
3151 __ movq(rbx, FieldOperand(rbx, ExternalArray::kExternalPointerOffset));
3155 __ movsxbq(rcx, Operand(rbx, rcx, times_1, 0));
3159 __ movzxbq(rcx, Operand(rbx, rcx, times_1, 0));
3162 __ movsxwq(rcx, Operand(rbx, rcx, times_2, 0));
3165 __ movzxwq(rcx, Operand(rbx, rcx, times_2, 0));
3168 __ movsxlq(rcx, Operand(rbx, rcx, times_4, 0));
3171 __ movl(rcx, Operand(rbx, rcx, times_4, 0));
3174 __ cvtss2sd(xmm0, Operand(rbx, rcx, times_4, 0));
3177 __ movsd(xmm0, Operand(rbx, rcx, times_8, 0));
3198 __ JumpIfUIntNotValidSmiValue(rcx, &box_int, Label::kNear);
3200 __ Integer32ToSmi(rax, rcx);
3201 __ ret(0);
3203 __ bind(&box_int);
3209 __ cvtqsi2sd(xmm0, rcx);
3211 __ AllocateHeapNumber(rcx, rbx, &slow);
3213 __ movsd(FieldOperand(rcx, HeapNumber::kValueOffset), xmm0);
3214 __ movq(rax, rcx);
3215 __ ret(0);
3220 __ AllocateHeapNumber(rcx, rbx, &slow);
3222 __ movsd(FieldOperand(rcx, HeapNumber::kValueOffset), xmm0);
3223 __ movq(rax, rcx);
3224 __ ret(0);
3226 __ Integer32ToSmi(rax, rcx);
3227 __ ret(0);
3231 __ bind(&slow);
3233 __ IncrementCounter(counters->keyed_load_external_array_slow(), 1);
3242 __ jmp(ic, RelocInfo::CODE_TARGET);
3245 __ bind(&miss_force_generic);
3254 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3273 __ JumpIfNotSmi(rcx, &miss_force_generic);
3276 __ movq(rbx, FieldOperand(rdx, JSObject::kElementsOffset));
3277 __ SmiToInteger32(rdi, rcx); // Untag the index.
3278 __ cmpq(rcx, FieldOperand(rbx, ExternalArray::kLengthOffset));
3280 __ j(above_equal, &miss_force_generic);
3292 __ JumpIfNotSmi(rax, &slow);
3294 __ JumpIfNotSmi(rax, &check_heap_number, Label::kNear);
3297 __ SmiToInteger32(rdx, rax);
3298 __ movq(rbx, FieldOperand(rbx, ExternalArray::kExternalPointerOffset));
3304 __ testl(rdx, Immediate(0xFFFFFF00));
3305 __ j(zero, &done, Label::kNear);
3306 __ setcc(negative, rdx); // 1 if negative, 0 if positive.
3307 __ decb(rdx); // 0 if negative, 255 if positive.
3308 __ bind(&done);
3310 __ movb(Operand(rbx, rdi, times_1, 0), rdx);
3314 __ movb(Operand(rbx, rdi, times_1, 0), rdx);
3318 __ movw(Operand(rbx, rdi, times_2, 0), rdx);
3322 __ movl(Operand(rbx, rdi, times_4, 0), rdx);
3326 __ cvtlsi2ss(xmm0, rdx);
3327 __ movss(Operand(rbx, rdi, times_4, 0), xmm0);
3331 __ cvtlsi2sd(xmm0, rdx);
3332 __ movsd(Operand(rbx, rdi, times_8, 0), xmm0);
3342 __ ret(0);
3346 __ bind(&check_heap_number);
3352 __ CmpObjectType(rax, HEAP_NUMBER_TYPE, kScratchRegister);
3353 __ j(not_equal, &slow);
3359 __ movsd(xmm0, FieldOperand(rax, HeapNumber::kValueOffset));
3360 __ movq(rbx, FieldOperand(rbx, ExternalArray::kExternalPointerOffset));
3365 __ cvtsd2ss(xmm0, xmm0);
3366 __ movss(Operand(rbx, rdi, times_4, 0), xmm0);
3367 __ ret(0);
3369 __ movsd(Operand(rbx, rdi, times_8, 0), xmm0);
3370 __ ret(0);
3384 __ cvttsd2si(rdx, xmm0);
3385 __ movb(Operand(rbx, rdi, times_1, 0), rdx);
3389 __ cvttsd2si(rdx, xmm0);
3390 __ movw(Operand(rbx, rdi, times_2, 0), rdx);
3396 __ cvttsd2siq(rdx, xmm0);
3397 __ movl(Operand(rbx, rdi, times_4, 0), rdx);
3410 __ ret(0);
3415 __ bind(&slow);
3425 __ jmp(ic, RelocInfo::CODE_TARGET);
3428 __ bind(&miss_force_generic);
3439 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3455 __ JumpIfNotSmi(rax, &miss_force_generic);
3458 __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
3459 __ AssertFastElements(rcx);
3462 __ SmiCompare(rax, FieldOperand(rcx, FixedArray::kLengthOffset));
3463 __ j(above_equal, &miss_force_generic);
3467 __ movq(rbx, FieldOperand(rcx,
3471 __ CompareRoot(rbx, Heap::kTheHoleValueRootIndex);
3472 __ j(equal, &miss_force_generic);
3473 __ movq(rax, rbx);
3474 __ ret(0);
3476 __ bind(&miss_force_generic);
3480 __ jmp(ic, RelocInfo::CODE_TARGET);
3497 __ JumpIfNotSmi(rax, &miss_force_generic);
3500 __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset));
3501 __ AssertFastElements(rcx);
3504 __ SmiCompare(rax, FieldOperand(rcx, FixedArray::kLengthOffset));
3505 __ j(above_equal, &miss_force_generic);
3508 __ SmiToInteger32(kScratchRegister, rax);
3510 __ cmpl(FieldOperand(rcx, kScratchRegister, times_8, offset),
3512 __ j(equal, &miss_force_generic);
3515 __ movsd(xmm0, FieldOperand(rcx, kScratchRegister, times_8,
3517 __ AllocateHeapNumber(rcx, rbx, &slow_allocate_heapnumber);
3519 __ movq(rax, rcx);
3520 __ movsd(FieldOperand(rcx, HeapNumber::kValueOffset), xmm0);
3521 __ ret(0);
3523 __ bind(&slow_allocate_heapnumber);
3526 __ jmp(slow_ic, RelocInfo::CODE_TARGET);
3528 __ bind(&miss_force_generic);
3531 __ jmp(miss_ic, RelocInfo::CODE_TARGET);
3553 __ JumpIfNotSmi(rcx, &miss_force_generic);
3556 __ JumpIfNotSmi(rax, &transition_elements_kind);
3560 __ movq(rdi, FieldOperand(rdx, JSObject::kElementsOffset));
3563 __ SmiCompare(rcx, FieldOperand(rdx, JSArray::kLengthOffset));
3565 __ j(above_equal, &grow);
3567 __ j(above_equal, &miss_force_generic);
3570 __ SmiCompare(rcx, FieldOperand(rdi, FixedArray::kLengthOffset));
3571 __ j(above_equal, &miss_force_generic);
3574 __ CompareRoot(FieldOperand(rdi, HeapObject::kMapOffset),
3576 __ j(not_equal, &miss_force_generic);
3578 __ bind(&finish_store);
3580 __ SmiToInteger32(rcx, rcx);
3581 __ movq(FieldOperand(rdi, rcx, times_pointer_size, FixedArray::kHeaderSize),
3586 __ SmiToInteger32(rcx, rcx);
3587 __ lea(rcx,
3589 __ movq(Operand(rcx, 0), rax);
3591 __ movq(rbx, rax);
3592 __ RecordWrite(rdi, rcx, rbx, kDontSaveFPRegs);
3596 __ ret(0);
3599 __ bind(&miss_force_generic);
3602 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
3604 __ bind(&transition_elements_kind);
3606 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
3610 __ bind(&grow);
3615 __ j(not_equal, &miss_force_generic);
3619 __ movq(rdi, FieldOperand(rdx, JSObject::kElementsOffset));
3620 __ CompareRoot(rdi, Heap::kEmptyFixedArrayRootIndex);
3621 __ j(not_equal, &check_capacity);
3624 __ AllocateInNewSpace(size, rdi, rbx, r8, &slow, TAG_OBJECT);
3631 __ Move(FieldOperand(rdi, JSObject::kMapOffset),
3633 __ Move(FieldOperand(rdi, FixedArray::kLengthOffset),
3635 __ LoadRoot(rbx, Heap::kTheHoleValueRootIndex);
3637 __ movq(FieldOperand(rdi, FixedArray::SizeFor(i)), rbx);
3641 __ movq(FieldOperand(rdi, FixedArray::SizeFor(0)), rax);
3644 __ movq(FieldOperand(rdx, JSObject::kElementsOffset), rdi);
3645 __ RecordWriteField(rdx, JSObject::kElementsOffset, rdi, rbx,
3649 __ Move(FieldOperand(rdx, JSArray::kLengthOffset), Smi::FromInt(1));
3650 __ ret(0);
3652 __ bind(&check_capacity);
3654 __ CompareRoot(FieldOperand(rdi, HeapObject::kMapOffset),
3656 __ j(equal, &miss_force_generic);
3663 __ cmpq(rcx, FieldOperand(rdi, FixedArray::kLengthOffset));
3664 __
3667 __ SmiAddConstant(FieldOperand(rdx, JSArray::kLengthOffset),
3669 __ jmp(&finish_store);
3671 __ bind(&slow);
3673 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
3695 __ JumpIfNotSmi(rcx, &miss_force_generic);
3698 __ movq(rdi, FieldOperand(rdx, JSObject::kElementsOffset));
3699 __ AssertFastElements(rdi);
3703 __ SmiCompare(rcx, FieldOperand(rdx, JSArray::kLengthOffset));
3705 __ j(above_equal, &grow);
3707 __ j(above_equal, &miss_force_generic);
3710 __ SmiCompare(rcx, FieldOperand(rdi, FixedDoubleArray::kLengthOffset));
3711 __ j(above_equal, &miss_force_generic);
3715 __ bind(&finish_store);
3716 __ SmiToInteger32(rcx, rcx);
3717 __ StoreNumberToDoubleElements(rax, rdi, rcx, xmm0,
3719 __ ret(0);
3722 __ bind(&miss_force_generic);
3725 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
3727 __ bind(&transition_elements_kind);
3729 __ Integer32ToSmi(rcx, rcx);
3731 __ jmp(ic_miss, RelocInfo::CODE_TARGET);
3735 __ bind(&grow);
3740 __ j(not_equal, &miss_force_generic);
3744 __ JumpIfSmi(rax, &value_is_smi);
3745 __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset),
3747 __ j(not_equal, &transition_elements_kind);
3748 __ bind(&value_is_smi);
3752 __ movq(rdi, FieldOperand(rdx, JSObject::kElementsOffset));
3753 __ CompareRoot(rdi, Heap::kEmptyFixedArrayRootIndex);
3754 __ j(not_equal, &check_capacity);
3757 __ AllocateInNewSpace(size, rdi, rbx, r8, &slow, TAG_OBJECT);
3765 __ Move(FieldOperand(rdi, JSObject::kMapOffset),
3767 __ Move(FieldOperand(rdi, FixedDoubleArray::kLengthOffset),
3771 __ movq(FieldOperand(rdx, JSObject::kElementsOffset), rdi);
3772 __ RecordWriteField(rdx, JSObject::kElementsOffset, rdi, rbx,
3776 __ Move(FieldOperand(rdx, JSArray::kLengthOffset), Smi::FromInt(1));
3777 __ movq(rdi, FieldOperand(rdx, JSObject::kElementsOffset));
3778 __ jmp(&finish_store);
3780 __ bind(&check_capacity);
3786 __ cmpq(rcx, FieldOperand(rdi, FixedDoubleArray::kLengthOffset));
3787 __ j(above_equal, &slow);
3790 __ SmiAddConstant(FieldOperand(rdx, JSArray::kLengthOffset),
3792 __ jmp(&finish_store);
3794 __ bind(&slow);
3796 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
3801 #undef __