Lines Matching full:__
25 #define __ ACCESS_MASM(masm) macro
28 __ pop(ecx); in Generate()
29 __ mov(MemOperand(esp, eax, times_4, 0), edi); in Generate()
30 __ push(edi); in Generate()
31 __ push(ebx); in Generate()
32 __ push(ecx); in Generate()
33 __ add(eax, Immediate(3)); in Generate()
34 __ TailCallRuntime(Runtime::kNewArray); in Generate()
62 __ push(descriptor.GetRegisterParameter(i)); in GenerateLightweightMiss()
64 __ CallExternalReference(miss, param_count); in GenerateLightweightMiss()
67 __ ret(0); in GenerateLightweightMiss()
75 __ pushad(); in Generate()
77 __ sub(esp, Immediate(kDoubleSize * XMMRegister::kMaxNumRegisters)); in Generate()
80 __ movsd(Operand(esp, i * kDoubleSize), reg); in Generate()
86 __ PrepareCallCFunction(argument_count, ecx); in Generate()
87 __ mov(Operand(esp, 0 * kPointerSize), in Generate()
89 __ CallCFunction( in Generate()
95 __ movsd(reg, Operand(esp, i * kDoubleSize)); in Generate()
97 __ add(esp, Immediate(kDoubleSize * XMMRegister::kMaxNumRegisters)); in Generate()
99 __ popad(); in Generate()
100 __ ret(0); in Generate()
163 __ push(scratch1); in Generate()
164 __ push(save_reg); in Generate()
167 __ mov(scratch1, mantissa_operand); in Generate()
171 __ fld_d(mantissa_operand); in Generate()
173 __ mov(ecx, exponent_operand); in Generate()
174 if (stash_exponent_copy) __ push(ecx); in Generate()
176 __ and_(ecx, HeapNumber::kExponentMask); in Generate()
177 __ shr(ecx, HeapNumber::kExponentShift); in Generate()
178 __ lea(result_reg, MemOperand(ecx, -HeapNumber::kExponentBias)); in Generate()
179 __ cmp(result_reg, Immediate(HeapNumber::kMantissaBits)); in Generate()
180 __ j(below, &process_64_bits); in Generate()
185 __ fstp(0); in Generate()
187 __ sub(ecx, Immediate(delta)); in Generate()
188 __ xor_(result_reg, result_reg); in Generate()
189 __ cmp(ecx, Immediate(31)); in Generate()
190 __ j(above, &done); in Generate()
191 __ shl_cl(scratch1); in Generate()
192 __ jmp(&check_negative); in Generate()
194 __ bind(&process_64_bits); in Generate()
200 __ sub(esp, Immediate(kDoubleSize / 2)); in Generate()
203 __ sub(esp, Immediate(kDoubleSize)); // Nolint. in Generate()
206 __ fisttp_d(Operand(esp, 0)); in Generate()
207 __ mov(result_reg, Operand(esp, 0)); // Load low word of answer as result in Generate()
208 __ add(esp, Immediate(kDoubleSize)); in Generate()
209 __ jmp(&done_no_stash); in Generate()
212 __ sub(ecx, Immediate(delta)); in Generate()
213 __ neg(ecx); in Generate()
215 __ mov(result_reg, MemOperand(esp, 0)); in Generate()
217 __ mov(result_reg, exponent_operand); in Generate()
219 __ and_(result_reg, in Generate()
221 __ add(result_reg, in Generate()
223 __ shrd_cl(scratch1, result_reg); in Generate()
224 __ shr_cl(result_reg); in Generate()
225 __ test(ecx, Immediate(32)); in Generate()
226 __ cmov(not_equal, scratch1, result_reg); in Generate()
230 __ bind(&check_negative); in Generate()
231 __ mov(result_reg, scratch1); in Generate()
232 __ neg(result_reg); in Generate()
234 __ cmp(MemOperand(esp, 0), Immediate(0)); in Generate()
236 __ cmp(exponent_operand, Immediate(0)); in Generate()
238 __ cmov(greater, result_reg, scratch1); in Generate()
241 __ bind(&done); in Generate()
243 __ add(esp, Immediate(kDoubleSize / 2)); in Generate()
245 __ bind(&done_no_stash); in Generate()
248 __ mov(final_result_reg, result_reg); in Generate()
250 __ pop(save_reg); in Generate()
251 __ pop(scratch1); in Generate()
252 __ ret(0); in Generate()
260 __ JumpIfSmi(number, &load_smi, Label::kNear); in LoadFloatOperand()
261 __ fld_d(FieldOperand(number, HeapNumber::kValueOffset)); in LoadFloatOperand()
262 __ jmp(&done, Label::kNear); in LoadFloatOperand()
264 __ bind(&load_smi); in LoadFloatOperand()
265 __ SmiUntag(number); in LoadFloatOperand()
266 __ push(number); in LoadFloatOperand()
267 __ fild_s(Operand(esp, 0)); in LoadFloatOperand()
268 __ pop(number); in LoadFloatOperand()
270 __ bind(&done); in LoadFloatOperand()
278 __ JumpIfSmi(edx, &load_smi_edx, Label::kNear); in LoadSSE2Operands()
280 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), factory->heap_number_map()); in LoadSSE2Operands()
281 __ j(not_equal, not_numbers); // Argument in edx is not a number. in LoadSSE2Operands()
282 __ movsd(xmm0, FieldOperand(edx, HeapNumber::kValueOffset)); in LoadSSE2Operands()
283 __ bind(&load_eax); in LoadSSE2Operands()
285 __ JumpIfSmi(eax, &load_smi_eax, Label::kNear); in LoadSSE2Operands()
286 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), factory->heap_number_map()); in LoadSSE2Operands()
287 __ j(equal, &load_float_eax, Label::kNear); in LoadSSE2Operands()
288 __ jmp(not_numbers); // Argument in eax is not a number. in LoadSSE2Operands()
289 __ bind(&load_smi_edx); in LoadSSE2Operands()
290 __ SmiUntag(edx); // Untag smi before converting to float. in LoadSSE2Operands()
291 __ Cvtsi2sd(xmm0, edx); in LoadSSE2Operands()
292 __ SmiTag(edx); // Retag smi for heap number overwriting test. in LoadSSE2Operands()
293 __ jmp(&load_eax); in LoadSSE2Operands()
294 __ bind(&load_smi_eax); in LoadSSE2Operands()
295 __ SmiUntag(eax); // Untag smi before converting to float. in LoadSSE2Operands()
296 __ Cvtsi2sd(xmm1, eax); in LoadSSE2Operands()
297 __ SmiTag(eax); // Retag smi for heap number overwriting test. in LoadSSE2Operands()
298 __ jmp(&done, Label::kNear); in LoadSSE2Operands()
299 __ bind(&load_float_eax); in LoadSSE2Operands()
300 __ movsd(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); in LoadSSE2Operands()
301 __ bind(&done); in LoadSSE2Operands()
311 __ JumpIfSmi(edx, &test_other, Label::kNear); in CheckFloatOperands()
312 __ mov(scratch, FieldOperand(edx, HeapObject::kMapOffset)); in CheckFloatOperands()
314 __ cmp(scratch, factory->heap_number_map()); in CheckFloatOperands()
315 __ j(not_equal, non_float); // argument in edx is not a number -> NaN in CheckFloatOperands()
317 __ bind(&test_other); in CheckFloatOperands()
318 __ JumpIfSmi(eax, &done, Label::kNear); in CheckFloatOperands()
319 __ mov(scratch, FieldOperand(eax, HeapObject::kMapOffset)); in CheckFloatOperands()
320 __ cmp(scratch, factory->heap_number_map()); in CheckFloatOperands()
321 __ j(not_equal, non_float); // argument in eax is not a number -> NaN in CheckFloatOperands()
324 __ bind(&done); in CheckFloatOperands()
340 __ mov(scratch, Immediate(1)); in Generate()
341 __ Cvtsi2sd(double_result, scratch); in Generate()
344 __ JumpIfNotSmi(exponent, &exponent_not_smi, Label::kNear); in Generate()
345 __ SmiUntag(exponent); in Generate()
346 __ jmp(&int_exponent); in Generate()
348 __ bind(&exponent_not_smi); in Generate()
349 __ movsd(double_exponent, in Generate()
355 __ DoubleToI(exponent, double_exponent, double_scratch, in Generate()
359 __ jmp(&int_exponent); in Generate()
361 __ bind(&try_arithmetic_simplification); in Generate()
363 __ cvttsd2si(exponent, Operand(double_exponent)); in Generate()
364 __ cmp(exponent, Immediate(0x1)); in Generate()
365 __ j(overflow, &call_runtime); in Generate()
369 __ bind(&fast_power); in Generate()
370 __ fnclex(); // Clear flags to catch exceptions later. in Generate()
372 __ sub(esp, Immediate(kDoubleSize)); in Generate()
373 __ movsd(Operand(esp, 0), double_exponent); in Generate()
374 __ fld_d(Operand(esp, 0)); // E in Generate()
375 __ movsd(Operand(esp, 0), double_base); in Generate()
376 __ fld_d(Operand(esp, 0)); // B, E in Generate()
381 __ fyl2x(); // X in Generate()
382 __ fld(0); // X, X in Generate()
383 __ frndint(); // rnd(X), X in Generate()
384 __ fsub(1); // rnd(X), X-rnd(X) in Generate()
385 __ fxch(1); // X - rnd(X), rnd(X) in Generate()
387 __ f2xm1(); // 2^(X-rnd(X)) - 1, rnd(X) in Generate()
388 __ fld1(); // 1, 2^(X-rnd(X)) - 1, rnd(X) in Generate()
389 __ faddp(1); // 2^(X-rnd(X)), rnd(X) in Generate()
391 __ fscale(); // 2^X, rnd(X) in Generate()
392 __ fstp(1); // 2^X in Generate()
394 __ fnstsw_ax(); in Generate()
395 __ test_b(eax, in Generate()
397 __ j(not_zero, &fast_power_failed, Label::kNear); in Generate()
398 __ fstp_d(Operand(esp, 0)); in Generate()
399 __ movsd(double_result, Operand(esp, 0)); in Generate()
400 __ add(esp, Immediate(kDoubleSize)); in Generate()
401 __ jmp(&done); in Generate()
403 __ bind(&fast_power_failed); in Generate()
404 __ fninit(); in Generate()
405 __ add(esp, Immediate(kDoubleSize)); in Generate()
406 __ jmp(&call_runtime); in Generate()
410 __ bind(&int_exponent); in Generate()
412 __ mov(scratch, exponent); // Back up exponent. in Generate()
413 __ movsd(double_scratch, double_base); // Back up base. in Generate()
414 __ movsd(double_scratch2, double_result); // Load double_exponent with 1. in Generate()
418 __ test(scratch, scratch); in Generate()
419 __ j(positive, &no_neg, Label::kNear); in Generate()
420 __ neg(scratch); in Generate()
421 __ bind(&no_neg); in Generate()
423 __ j(zero, &while_false, Label::kNear); in Generate()
424 __ shr(scratch, 1); in Generate()
427 __ j(above, &while_true, Label::kNear); in Generate()
428 __ movsd(double_result, double_scratch); in Generate()
429 __ j(zero, &while_false, Label::kNear); in Generate()
431 __ bind(&while_true); in Generate()
432 __ shr(scratch, 1); in Generate()
433 __ mulsd(double_scratch, double_scratch); in Generate()
434 __ j(above, &while_true, Label::kNear); in Generate()
435 __ mulsd(double_result, double_scratch); in Generate()
436 __ j(not_zero, &while_true); in Generate()
438 __ bind(&while_false); in Generate()
441 __ test(exponent, exponent); in Generate()
442 __ j(positive, &done); in Generate()
443 __ divsd(double_scratch2, double_result); in Generate()
444 __ movsd(double_result, double_scratch2); in Generate()
447 __ xorps(double_scratch2, double_scratch2); in Generate()
448 __ ucomisd(double_scratch2, double_result); // Result cannot be NaN. in Generate()
452 __ j(not_equal, &done); in Generate()
453 __ Cvtsi2sd(double_exponent, exponent); in Generate()
456 __ bind(&call_runtime); in Generate()
459 __ PrepareCallCFunction(4, scratch); in Generate()
460 __ movsd(Operand(esp, 0 * kDoubleSize), double_base); in Generate()
461 __ movsd(Operand(esp, 1 * kDoubleSize), double_exponent); in Generate()
462 __ CallCFunction(ExternalReference::power_double_double_function(isolate()), in Generate()
467 __ sub(esp, Immediate(kDoubleSize)); in Generate()
468 __ fstp_d(Operand(esp, 0)); in Generate()
469 __ movsd(double_result, Operand(esp, 0)); in Generate()
470 __ add(esp, Immediate(kDoubleSize)); in Generate()
472 __ bind(&done); in Generate()
473 __ ret(0); in Generate()
482 __ cmp(FieldOperand(receiver, JSFunction::kPrototypeOrInitialMapOffset), in Generate()
484 __ j(equal, &miss); in Generate()
485 __ TryGetFunctionPrototype(receiver, eax, ebx, &miss); in Generate()
486 __ ret(0); in Generate()
488 __ bind(&miss); in Generate()
516 __ ret(0); in Generate()
521 __ bind(&miss); in Generate()
532 __ TailCallRuntime(Runtime::kRegExpExec); in Generate()
555 __ mov(ebx, Operand::StaticVariable(address_of_regexp_stack_memory_size)); in Generate()
556 __ test(ebx, ebx); in Generate()
557 __ j(zero, &runtime); in Generate()
560 __ mov(eax, Operand(esp, kJSRegExpOffset)); in Generate()
562 __ JumpIfSmi(eax, &runtime); in Generate()
563 __ CmpObjectType(eax, JS_REGEXP_TYPE, ecx); in Generate()
564 __ j(not_equal, &runtime); in Generate()
567 __ mov(ecx, FieldOperand(eax, JSRegExp::kDataOffset)); in Generate()
569 __ test(ecx, Immediate(kSmiTagMask)); in Generate()
570 __ Check(not_zero, kUnexpectedTypeForRegExpDataFixedArrayExpected); in Generate()
571 __ CmpObjectType(ecx, FIXED_ARRAY_TYPE, ebx); in Generate()
572 __ Check(equal, kUnexpectedTypeForRegExpDataFixedArrayExpected); in Generate()
577 __ mov(ebx, FieldOperand(ecx, JSRegExp::kDataTagOffset)); in Generate()
578 __ cmp(ebx, Immediate(Smi::FromInt(JSRegExp::IRREGEXP))); in Generate()
579 __ j(not_equal, &runtime); in Generate()
583 __ mov(edx, FieldOperand(ecx, JSRegExp::kIrregexpCaptureCountOffset)); in Generate()
590 __ cmp(edx, Isolate::kJSRegexpStaticOffsetsVectorSize - 2); in Generate()
591 __ j(above, &runtime); in Generate()
594 __ Move(edi, Immediate(0)); in Generate()
595 __ mov(eax, Operand(esp, kSubjectOffset)); in Generate()
596 __ JumpIfSmi(eax, &runtime); in Generate()
597 __ mov(edx, eax); // Make a copy of the original subject string. in Generate()
624 __ bind(&check_underlying); in Generate()
626 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); in Generate()
627 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); in Generate()
629 __ and_(ebx, kIsNotStringMask | in Generate()
634 __ j(zero, &seq_two_byte_string); // Go to (9). in Generate()
638 __ and_(ebx, Immediate(kIsNotStringMask | in Generate()
641 __ j(zero, &seq_one_byte_string, Label::kNear); // Go to (5). in Generate()
650 __ cmp(ebx, Immediate(kExternalStringTag)); in Generate()
651 __ j(greater_equal, ¬_seq_nor_cons); // Go to (6). in Generate()
655 __ cmp(FieldOperand(eax, ConsString::kSecondOffset), factory->empty_string()); in Generate()
656 __ j(not_equal, &runtime); in Generate()
657 __ mov(eax, FieldOperand(eax, ConsString::kFirstOffset)); in Generate()
658 __ jmp(&check_underlying); in Generate()
664 __ bind(&seq_one_byte_string); in Generate()
668 __ mov(ebx, Operand(esp, kPreviousIndexOffset)); in Generate()
669 __ JumpIfNotSmi(ebx, &runtime); in Generate()
670 __ cmp(ebx, FieldOperand(edx, String::kLengthOffset)); in Generate()
671 __ j(above_equal, &runtime); in Generate()
672 __ mov(edx, FieldOperand(ecx, JSRegExp::kDataOneByteCodeOffset)); in Generate()
673 __ Move(ecx, Immediate(1)); // Type is one byte. in Generate()
676 __ bind(&check_code); in Generate()
681 __ JumpIfSmi(edx, &runtime); in Generate()
689 __ IncrementCounter(counters->regexp_entry_native(), 1); in Generate()
693 __ EnterApiExitFrame(kRegExpExecuteArguments); in Generate()
696 __ mov(Operand(esp, 8 * kPointerSize), in Generate()
700 __ mov(Operand(esp, 7 * kPointerSize), Immediate(1)); in Generate()
703 __ mov(esi, Operand::StaticVariable(address_of_regexp_stack_memory_address)); in Generate()
704 __ add(esi, Operand::StaticVariable(address_of_regexp_stack_memory_size)); in Generate()
705 __ mov(Operand(esp, 6 * kPointerSize), esi); in Generate()
709 __ mov(Operand(esp, 5 * kPointerSize), Immediate(0)); in Generate()
712 __ mov(Operand(esp, 4 * kPointerSize), in Generate()
717 __ SmiUntag(ebx); in Generate()
718 __ mov(Operand(esp, 1 * kPointerSize), ebx); in Generate()
725 __ mov(esi, Operand(ebp, kSubjectOffset + kPointerSize)); in Generate()
726 __ mov(Operand(esp, 0 * kPointerSize), esi); in Generate()
737 __ mov(esi, FieldOperand(esi, String::kLengthOffset)); in Generate()
738 __ add(esi, edi); // Calculate input end wrt offset. in Generate()
739 __ SmiUntag(edi); in Generate()
740 __ add(ebx, edi); // Calculate input start wrt offset. in Generate()
745 __ test(ecx, ecx); in Generate()
746 __ j(zero, &setup_two_byte, Label::kNear); in Generate()
747 __ SmiUntag(esi); in Generate()
748 __ lea(ecx, FieldOperand(eax, esi, times_1, SeqOneByteString::kHeaderSize)); in Generate()
749 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Argument 4. in Generate()
750 __ lea(ecx, FieldOperand(eax, ebx, times_1, SeqOneByteString::kHeaderSize)); in Generate()
751 __ mov(Operand(esp, 2 * kPointerSize), ecx); // Argument 3. in Generate()
752 __ jmp(&setup_rest, Label::kNear); in Generate()
754 __ bind(&setup_two_byte); in Generate()
757 __ lea(ecx, FieldOperand(eax, esi, times_1, SeqTwoByteString::kHeaderSize)); in Generate()
758 __ mov(Operand(esp, 3 * kPointerSize), ecx); // Argument 4. in Generate()
759 __ lea(ecx, FieldOperand(eax, ebx, times_2, SeqTwoByteString::kHeaderSize)); in Generate()
760 __ mov(Operand(esp, 2 * kPointerSize), ecx); // Argument 3. in Generate()
762 __ bind(&setup_rest); in Generate()
765 __ add(edx, Immediate(Code::kHeaderSize - kHeapObjectTag)); in Generate()
766 __ call(edx); in Generate()
769 __ LeaveApiExitFrame(true); in Generate()
773 __ cmp(eax, 1); in Generate()
776 __ j(equal, &success); in Generate()
778 __ cmp(eax, NativeRegExpMacroAssembler::FAILURE); in Generate()
779 __ j(equal, &failure); in Generate()
780 __ cmp(eax, NativeRegExpMacroAssembler::EXCEPTION); in Generate()
782 __ j(not_equal, &runtime); in Generate()
789 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); in Generate()
790 __ mov(eax, Operand::StaticVariable(pending_exception)); in Generate()
791 __ cmp(edx, eax); in Generate()
792 __ j(equal, &runtime); in Generate()
795 __ TailCallRuntime(Runtime::kRegExpExecReThrow); in Generate()
797 __ bind(&failure); in Generate()
799 __ mov(eax, factory->null_value()); in Generate()
800 __ ret(4 * kPointerSize); in Generate()
803 __ bind(&success); in Generate()
804 __ mov(eax, Operand(esp, kJSRegExpOffset)); in Generate()
805 __ mov(ecx, FieldOperand(eax, JSRegExp::kDataOffset)); in Generate()
806 __ mov(edx, FieldOperand(ecx, JSRegExp::kIrregexpCaptureCountOffset)); in Generate()
810 __ add(edx, Immediate(2)); // edx was a smi. in Generate()
814 __ mov(ebx, Operand(esp, kLastMatchInfoOffset)); in Generate()
815 __ JumpIfSmi(ebx, &runtime); in Generate()
817 __ mov(eax, FieldOperand(ebx, HeapObject::kMapOffset)); in Generate()
818 __ cmp(eax, factory->fixed_array_map()); in Generate()
819 __ j(not_equal, &runtime); in Generate()
822 __ mov(eax, FieldOperand(ebx, FixedArray::kLengthOffset)); in Generate()
823 __ SmiUntag(eax); in Generate()
824 __ sub(eax, Immediate(RegExpMatchInfo::kLastMatchOverhead)); in Generate()
825 __ cmp(edx, eax); in Generate()
826 __ j(greater, &runtime); in Generate()
831 __ SmiTag(edx); // Number of capture registers to smi. in Generate()
832 __ mov(FieldOperand(ebx, RegExpMatchInfo::kNumberOfCapturesOffset), edx); in Generate()
833 __ SmiUntag(edx); // Number of capture registers back from smi. in Generate()
835 __ mov(eax, Operand(esp, kSubjectOffset)); in Generate()
836 __ mov(ecx, eax); in Generate()
837 __ mov(FieldOperand(ebx, RegExpMatchInfo::kLastSubjectOffset), eax); in Generate()
838 __ RecordWriteField(ebx, RegExpMatchInfo::kLastSubjectOffset, eax, edi, in Generate()
840 __ mov(eax, ecx); in Generate()
841 __ mov(FieldOperand(ebx, RegExpMatchInfo::kLastInputOffset), eax); in Generate()
842 __ RecordWriteField(ebx, RegExpMatchInfo::kLastInputOffset, eax, edi, in Generate()
848 __ mov(ecx, Immediate(address_of_static_offsets_vector)); in Generate()
856 __ bind(&next_capture); in Generate()
857 __ sub(edx, Immediate(1)); in Generate()
858 __ j(negative, &done, Label::kNear); in Generate()
860 __ mov(edi, Operand(ecx, edx, times_int_size, 0)); in Generate()
861 __ SmiTag(edi); in Generate()
863 __ mov(FieldOperand(ebx, edx, times_pointer_size, in Generate()
866 __ jmp(&next_capture); in Generate()
867 __ bind(&done); in Generate()
870 __ mov(eax, ebx); in Generate()
871 __ ret(4 * kPointerSize); in Generate()
874 __ bind(&runtime); in Generate()
875 __ TailCallRuntime(Runtime::kRegExpExec); in Generate()
879 __ bind(¬_seq_nor_cons); in Generate()
881 __ j(greater, ¬_long_external, Label::kNear); // Go to (10). in Generate()
884 __ bind(&external_string); in Generate()
886 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); in Generate()
887 __ movzx_b(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); in Generate()
891 __ test_b(ebx, Immediate(kIsIndirectStringMask)); in Generate()
892 __ Assert(zero, kExternalStringExpectedButNotFound); in Generate()
894 __ mov(eax, FieldOperand(eax, ExternalString::kResourceDataOffset)); in Generate()
897 __ sub(eax, Immediate(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); in Generate()
900 __ test_b(ebx, Immediate(kStringEncodingMask)); in Generate()
901 __ j(not_zero, &seq_one_byte_string); // Go to (5). in Generate()
907 __ bind(&seq_two_byte_string); in Generate()
911 __ mov(ebx, Operand(esp, kPreviousIndexOffset)); in Generate()
912 __ JumpIfNotSmi(ebx, &runtime); in Generate()
913 __ cmp(ebx, FieldOperand(edx, String::kLengthOffset)); in Generate()
914 __ j(above_equal, &runtime); in Generate()
915 __ mov(edx, FieldOperand(ecx, JSRegExp::kDataUC16CodeOffset)); in Generate()
916 __ Move(ecx, Immediate(0)); // Type is two byte. in Generate()
917 __ jmp(&check_code); // Go to (E). in Generate()
920 __ bind(¬_long_external); in Generate()
923 __ test(ebx, Immediate(kIsNotStringMask | kShortExternalStringTag)); in Generate()
924 __ j(not_zero, &runtime); in Generate()
928 __ mov(edi, FieldOperand(eax, SlicedString::kOffsetOffset)); in Generate()
929 __ mov(eax, FieldOperand(eax, SlicedString::kParentOffset)); in Generate()
930 __ jmp(&check_underlying); // Go to (1). in Generate()
947 __ JumpIfNotSmi(input, fail); in CheckInputType()
949 __ JumpIfSmi(input, &ok); in CheckInputType()
950 __ cmp(FieldOperand(input, HeapObject::kMapOffset), in CheckInputType()
952 __ j(not_equal, fail); in CheckInputType()
956 __ bind(&ok); in CheckInputType()
964 __ JumpIfSmi(object, label); in BranchIfNotInternalizedString()
965 __ mov(scratch, FieldOperand(object, HeapObject::kMapOffset)); in BranchIfNotInternalizedString()
966 __ movzx_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); in BranchIfNotInternalizedString()
968 __ test(scratch, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); in BranchIfNotInternalizedString()
969 __ j(not_zero, label); in BranchIfNotInternalizedString()
983 __ mov(ecx, edx); in GenerateGeneric()
984 __ or_(ecx, eax); in GenerateGeneric()
985 __ JumpIfNotSmi(ecx, &non_smi, Label::kNear); in GenerateGeneric()
986 __ sub(edx, eax); // Return on the result of the subtraction. in GenerateGeneric()
987 __ j(no_overflow, &smi_done, Label::kNear); in GenerateGeneric()
988 __ not_(edx); // Correct sign in case of overflow. edx is never 0 here. in GenerateGeneric()
989 __ bind(&smi_done); in GenerateGeneric()
990 __ mov(eax, edx); in GenerateGeneric()
991 __ ret(0); in GenerateGeneric()
992 __ bind(&non_smi); in GenerateGeneric()
1002 __ cmp(eax, edx); in GenerateGeneric()
1003 __ j(not_equal, ¬_identical); in GenerateGeneric()
1008 __ cmp(edx, isolate()->factory()->undefined_value()); in GenerateGeneric()
1010 __ j(not_equal, &check_for_nan, Label::kNear); in GenerateGeneric()
1011 __ Move(eax, Immediate(Smi::FromInt(NegativeComparisonResult(cc)))); in GenerateGeneric()
1012 __ ret(0); in GenerateGeneric()
1013 __ bind(&check_for_nan); in GenerateGeneric()
1018 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), in GenerateGeneric()
1020 __ j(equal, &generic_heap_number_comparison, Label::kNear); in GenerateGeneric()
1022 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); in GenerateGeneric()
1023 __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset)); in GenerateGeneric()
1025 __ cmpb(ecx, Immediate(FIRST_JS_RECEIVER_TYPE)); in GenerateGeneric()
1026 __ j(above_equal, &runtime_call, Label::kFar); in GenerateGeneric()
1028 __ cmpb(ecx, Immediate(SYMBOL_TYPE)); in GenerateGeneric()
1029 __ j(equal, &runtime_call, Label::kFar); in GenerateGeneric()
1031 __ cmpb(ecx, Immediate(SIMD128_VALUE_TYPE)); in GenerateGeneric()
1032 __ j(equal, &runtime_call, Label::kFar); in GenerateGeneric()
1034 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); in GenerateGeneric()
1035 __ ret(0); in GenerateGeneric()
1038 __ bind(¬_identical); in GenerateGeneric()
1054 __ mov(ecx, Immediate(kSmiTagMask)); in GenerateGeneric()
1055 __ and_(ecx, eax); in GenerateGeneric()
1056 __ test(ecx, edx); in GenerateGeneric()
1057 __ j(not_zero, ¬_smis, Label::kNear); in GenerateGeneric()
1063 __ sub(ecx, Immediate(0x01)); in GenerateGeneric()
1064 __ mov(ebx, edx); in GenerateGeneric()
1065 __ xor_(ebx, eax); in GenerateGeneric()
1066 __ and_(ebx, ecx); // ebx holds either 0 or eax ^ edx. in GenerateGeneric()
1067 __ xor_(ebx, eax); in GenerateGeneric()
1071 __ cmp(FieldOperand(ebx, HeapObject::kMapOffset), in GenerateGeneric()
1074 __ j(equal, &slow, Label::kNear); in GenerateGeneric()
1076 __ mov(eax, ebx); in GenerateGeneric()
1077 __ ret(0); in GenerateGeneric()
1079 __ bind(¬_smis); in GenerateGeneric()
1088 __ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, ecx); in GenerateGeneric()
1089 __ j(below, &first_non_object, Label::kNear); in GenerateGeneric()
1094 __ bind(&return_not_equal); in GenerateGeneric()
1095 __ ret(0); in GenerateGeneric()
1097 __ bind(&first_non_object); in GenerateGeneric()
1099 __ CmpInstanceType(ecx, ODDBALL_TYPE); in GenerateGeneric()
1100 __ j(equal, &return_not_equal); in GenerateGeneric()
1102 __ CmpObjectType(edx, FIRST_JS_RECEIVER_TYPE, ecx); in GenerateGeneric()
1103 __ j(above_equal, &return_not_equal); in GenerateGeneric()
1106 __ CmpInstanceType(ecx, ODDBALL_TYPE); in GenerateGeneric()
1107 __ j(equal, &return_not_equal); in GenerateGeneric()
1110 __ bind(&slow); in GenerateGeneric()
1116 __ bind(&generic_heap_number_comparison); in GenerateGeneric()
1119 __ ucomisd(xmm0, xmm1); in GenerateGeneric()
1121 __ j(parity_even, &unordered, Label::kNear); in GenerateGeneric()
1123 __ mov(eax, 0); // equal in GenerateGeneric()
1124 __ mov(ecx, Immediate(Smi::FromInt(1))); in GenerateGeneric()
1125 __ cmov(above, eax, ecx); in GenerateGeneric()
1126 __ mov(ecx, Immediate(Smi::FromInt(-1))); in GenerateGeneric()
1127 __ cmov(below, eax, ecx); in GenerateGeneric()
1128 __ ret(0); in GenerateGeneric()
1132 __ bind(&unordered); in GenerateGeneric()
1135 __ mov(eax, Immediate(Smi::FromInt(1))); in GenerateGeneric()
1137 __ mov(eax, Immediate(Smi::FromInt(-1))); in GenerateGeneric()
1139 __ ret(0); in GenerateGeneric()
1142 __ bind(&non_number_comparison); in GenerateGeneric()
1153 __ ret(0); in GenerateGeneric()
1156 __ bind(&check_for_strings); in GenerateGeneric()
1158 __ JumpIfNotBothSequentialOneByteStrings(edx, eax, ecx, ebx, in GenerateGeneric()
1169 __ Abort(kUnexpectedFallThroughFromStringComparison); in GenerateGeneric()
1172 __ bind(&check_unequal_objects); in GenerateGeneric()
1183 __ lea(ecx, Operand(eax, edx, times_1, 0)); in GenerateGeneric()
1184 __ test(ecx, Immediate(kSmiTagMask)); in GenerateGeneric()
1185 __ j(not_zero, &runtime_call); in GenerateGeneric()
1187 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); in GenerateGeneric()
1188 __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); in GenerateGeneric()
1190 __ test_b(FieldOperand(ebx, Map::kBitFieldOffset), in GenerateGeneric()
1192 __ j(not_zero, &undetectable, Label::kNear); in GenerateGeneric()
1193 __ test_b(FieldOperand(ecx, Map::kBitFieldOffset), in GenerateGeneric()
1195 __ j(not_zero, &return_unequal, Label::kNear); in GenerateGeneric()
1197 __ CmpInstanceType(ebx, FIRST_JS_RECEIVER_TYPE); in GenerateGeneric()
1198 __ j(below, &runtime_call, Label::kNear); in GenerateGeneric()
1199 __ CmpInstanceType(ecx, FIRST_JS_RECEIVER_TYPE); in GenerateGeneric()
1200 __ j(below, &runtime_call, Label::kNear); in GenerateGeneric()
1202 __ bind(&return_unequal); in GenerateGeneric()
1204 __ ret(0); // eax, edx were pushed in GenerateGeneric()
1206 __ bind(&undetectable); in GenerateGeneric()
1207 __ test_b(FieldOperand(ecx, Map::kBitFieldOffset), in GenerateGeneric()
1209 __ j(zero, &return_unequal, Label::kNear); in GenerateGeneric()
1214 __ CmpInstanceType(ebx, ODDBALL_TYPE); in GenerateGeneric()
1215 __ j(zero, &return_equal, Label::kNear); in GenerateGeneric()
1216 __ CmpInstanceType(ecx, ODDBALL_TYPE); in GenerateGeneric()
1217 __ j(not_zero, &return_unequal, Label::kNear); in GenerateGeneric()
1219 __ bind(&return_equal); in GenerateGeneric()
1220 __ Move(eax, Immediate(EQUAL)); in GenerateGeneric()
1221 __ ret(0); // eax, edx were pushed in GenerateGeneric()
1223 __ bind(&runtime_call); in GenerateGeneric()
1228 __ Push(edx); in GenerateGeneric()
1229 __ Push(eax); in GenerateGeneric()
1230 __ CallRuntime(strict() ? Runtime::kStrictEqual : Runtime::kEqual); in GenerateGeneric()
1234 __ sub(eax, Immediate(isolate()->factory()->true_value())); in GenerateGeneric()
1235 __ Ret(); in GenerateGeneric()
1238 __ pop(ecx); in GenerateGeneric()
1239 __ push(edx); in GenerateGeneric()
1240 __ push(eax); in GenerateGeneric()
1241 __ push(Immediate(Smi::FromInt(NegativeComparisonResult(cc)))); in GenerateGeneric()
1242 __ push(ecx); in GenerateGeneric()
1245 __ TailCallRuntime(Runtime::kCompare); in GenerateGeneric()
1248 __ bind(&miss); in GenerateGeneric()
1263 __ SmiTag(eax); in CallStubInRecordCallTarget()
1264 __ push(eax); in CallStubInRecordCallTarget()
1265 __ push(edi); in CallStubInRecordCallTarget()
1266 __ push(edx); in CallStubInRecordCallTarget()
1267 __ push(ebx); in CallStubInRecordCallTarget()
1268 __ push(esi); in CallStubInRecordCallTarget()
1270 __ CallStub(stub); in CallStubInRecordCallTarget()
1272 __ pop(esi); in CallStubInRecordCallTarget()
1273 __ pop(ebx); in CallStubInRecordCallTarget()
1274 __ pop(edx); in CallStubInRecordCallTarget()
1275 __ pop(edi); in CallStubInRecordCallTarget()
1276 __ pop(eax); in CallStubInRecordCallTarget()
1277 __ SmiUntag(eax); in CallStubInRecordCallTarget()
1294 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, in GenerateRecordCallTarget()
1303 __ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset)); in GenerateRecordCallTarget()
1304 __ j(equal, &done, Label::kFar); in GenerateRecordCallTarget()
1305 __ CompareRoot(ecx, Heap::kmegamorphic_symbolRootIndex); in GenerateRecordCallTarget()
1306 __ j(equal, &done, Label::kFar); in GenerateRecordCallTarget()
1307 __ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset), in GenerateRecordCallTarget()
1309 __ j(not_equal, &check_allocation_site); in GenerateRecordCallTarget()
1312 __ JumpIfSmi(FieldOperand(ecx, WeakCell::kValueOffset), &initialize); in GenerateRecordCallTarget()
1313 __ jmp(&megamorphic); in GenerateRecordCallTarget()
1315 __ bind(&check_allocation_site); in GenerateRecordCallTarget()
1320 __ CompareRoot(FieldOperand(ecx, 0), Heap::kAllocationSiteMapRootIndex); in GenerateRecordCallTarget()
1321 __ j(not_equal, &miss); in GenerateRecordCallTarget()
1324 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); in GenerateRecordCallTarget()
1325 __ cmp(edi, ecx); in GenerateRecordCallTarget()
1326 __ j(not_equal, &megamorphic); in GenerateRecordCallTarget()
1327 __ jmp(&done, Label::kFar); in GenerateRecordCallTarget()
1329 __ bind(&miss); in GenerateRecordCallTarget()
1333 __ CompareRoot(ecx, Heap::kuninitialized_symbolRootIndex); in GenerateRecordCallTarget()
1334 __ j(equal, &initialize); in GenerateRecordCallTarget()
1337 __ bind(&megamorphic); in GenerateRecordCallTarget()
1338 __ mov( in GenerateRecordCallTarget()
1341 __ jmp(&done, Label::kFar); in GenerateRecordCallTarget()
1345 __ bind(&initialize); in GenerateRecordCallTarget()
1347 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); in GenerateRecordCallTarget()
1348 __ cmp(edi, ecx); in GenerateRecordCallTarget()
1349 __ j(not_equal, ¬_array_function); in GenerateRecordCallTarget()
1356 __ jmp(&done); in GenerateRecordCallTarget()
1358 __ bind(¬_array_function); in GenerateRecordCallTarget()
1362 __ bind(&done); in GenerateRecordCallTarget()
1364 __ add(FieldOperand(ebx, edx, times_half_pointer_size, in GenerateRecordCallTarget()
1378 __ JumpIfSmi(edi, &non_function); in Generate()
1380 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); in Generate()
1381 __ j(not_equal, &non_function); in Generate()
1387 __ mov(ebx, FieldOperand(ebx, edx, times_half_pointer_size, in Generate()
1390 __ cmp(FieldOperand(ebx, 0), Immediate(allocation_site_map)); in Generate()
1391 __ j(equal, &feedback_register_initialized); in Generate()
1392 __ mov(ebx, isolate()->factory()->undefined_value()); in Generate()
1393 __ bind(&feedback_register_initialized); in Generate()
1395 __ AssertUndefinedOrAllocationSite(ebx); in Generate()
1398 __ mov(edx, edi); in Generate()
1402 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); in Generate()
1403 __ mov(ecx, FieldOperand(ecx, SharedFunctionInfo::kConstructStubOffset)); in Generate()
1404 __ lea(ecx, FieldOperand(ecx, Code::kHeaderSize)); in Generate()
1405 __ jmp(ecx); in Generate()
1407 __ bind(&non_function); in Generate()
1408 __ mov(edx, edi); in Generate()
1409 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); in Generate()
1414 __ add(FieldOperand(feedback_vector, slot, times_half_pointer_size, in IncrementCallCount()
1424 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); in HandleArrayCase()
1425 __ cmp(edi, ecx); in HandleArrayCase()
1426 __ j(not_equal, miss); in HandleArrayCase()
1429 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, in HandleArrayCase()
1435 __ mov(ebx, ecx); in HandleArrayCase()
1436 __ mov(edx, edi); in HandleArrayCase()
1438 __ TailCallStub(&stub); in HandleArrayCase()
1453 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, in Generate()
1470 __ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset)); in Generate()
1471 __ j(not_equal, &extra_checks_or_miss); in Generate()
1475 __ JumpIfSmi(edi, &extra_checks_or_miss); in Generate()
1477 __ bind(&call_function); in Generate()
1482 __ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), in Generate()
1486 __ bind(&extra_checks_or_miss); in Generate()
1489 __ cmp(ecx, Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate))); in Generate()
1490 __ j(equal, &call); in Generate()
1493 __ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset), in Generate()
1495 __ j(not_equal, ¬_allocation_site); in Generate()
1500 __ bind(¬_allocation_site); in Generate()
1505 __ jmp(&miss); in Generate()
1508 __ cmp(ecx, Immediate(TypeFeedbackVector::UninitializedSentinel(isolate))); in Generate()
1509 __ j(equal, &uninitialized); in Generate()
1513 __ AssertNotSmi(ecx); in Generate()
1514 __ CmpObjectType(ecx, JS_FUNCTION_TYPE, ecx); in Generate()
1515 __ j(not_equal, &miss); in Generate()
1516 __ mov( in Generate()
1520 __ bind(&call); in Generate()
1525 __ bind(&call_count_incremented); in Generate()
1527 __ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()), in Generate()
1530 __ bind(&uninitialized); in Generate()
1533 __ JumpIfSmi(edi, &miss); in Generate()
1536 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); in Generate()
1537 __ j(not_equal, &miss); in Generate()
1541 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); in Generate()
1542 __ cmp(edi, ecx); in Generate()
1543 __ j(equal, &miss); in Generate()
1546 __ mov(ecx, FieldOperand(edi, JSFunction::kContextOffset)); in Generate()
1547 __ mov(ecx, ContextOperand(ecx, Context::NATIVE_CONTEXT_INDEX)); in Generate()
1548 __ cmp(ecx, NativeContextOperand()); in Generate()
1549 __ j(not_equal, &miss); in Generate()
1559 __ SmiTag(eax); in Generate()
1560 __ push(eax); in Generate()
1561 __ push(ebx); in Generate()
1562 __ push(edx); in Generate()
1563 __ push(edi); in Generate()
1564 __ push(esi); in Generate()
1565 __ CallStub(&create_stub); in Generate()
1566 __ pop(esi); in Generate()
1567 __ pop(edi); in Generate()
1568 __ pop(edx); in Generate()
1569 __ pop(ebx); in Generate()
1570 __ pop(eax); in Generate()
1571 __ SmiUntag(eax); in Generate()
1574 __ jmp(&call_function); in Generate()
1578 __ bind(&miss); in Generate()
1581 __ jmp(&call_count_incremented); in Generate()
1584 __ int3(); in Generate()
1592 __ SmiTag(eax); in GenerateMiss()
1593 __ push(eax); in GenerateMiss()
1596 __ push(edi); in GenerateMiss()
1597 __ push(ebx); in GenerateMiss()
1598 __ push(edx); in GenerateMiss()
1601 __ CallRuntime(Runtime::kCallIC_Miss); in GenerateMiss()
1604 __ mov(edi, eax); in GenerateMiss()
1607 __ pop(eax); in GenerateMiss()
1608 __ SmiUntag(eax); in GenerateMiss()
1667 __ EnterApiExitFrame(arg_stack_space); in Generate()
1670 __ mov(esi, ecx); in Generate()
1671 __ mov(edi, eax); in Generate()
1673 __ EnterExitFrame( in Generate()
1688 __ CheckStackAlignment(); in Generate()
1692 __ mov(Operand(esp, 0 * kPointerSize), edi); // argc. in Generate()
1693 __ mov(Operand(esp, 1 * kPointerSize), esi); // argv. in Generate()
1694 __ mov(Operand(esp, 2 * kPointerSize), in Generate()
1699 __ lea(eax, Operand(esp, 4 * kPointerSize)); in Generate()
1700 __ mov(Operand(esp, 0 * kPointerSize), eax); in Generate()
1701 __ mov(Operand(esp, 1 * kPointerSize), edi); // argc. in Generate()
1702 __ mov(Operand(esp, 2 * kPointerSize), esi); // argv. in Generate()
1703 __ mov(Operand(esp, 3 * kPointerSize), in Generate()
1706 __ call(ebx); in Generate()
1712 __ sub(esp, Immediate(kPointerSize)); in Generate()
1715 __ mov(kReturnRegister0, Operand(esp, 4 * kPointerSize)); in Generate()
1716 __ mov(kReturnRegister1, Operand(esp, 5 * kPointerSize)); in Generate()
1717 __ mov(kReturnRegister2, Operand(esp, 6 * kPointerSize)); in Generate()
1723 __ cmp(eax, isolate()->factory()->exception()); in Generate()
1724 __ j(equal, &exception_returned); in Generate()
1729 __ push(edx); in Generate()
1730 __ mov(edx, Immediate(isolate()->factory()->the_hole_value())); in Generate()
1734 __ cmp(edx, Operand::StaticVariable(pending_exception_address)); in Generate()
1736 __ j(equal, &okay, Label::kNear); in Generate()
1737 __ int3(); in Generate()
1738 __ bind(&okay); in Generate()
1739 __ pop(edx); in Generate()
1743 __ LeaveExitFrame(save_doubles(), !argv_in_register()); in Generate()
1744 __ ret(0); in Generate()
1747 __ bind(&exception_returned); in Generate()
1766 __ PrepareCallCFunction(3, eax); in Generate()
1767 __ mov(Operand(esp, 0 * kPointerSize), Immediate(0)); // argc. in Generate()
1768 __ mov(Operand(esp, 1 * kPointerSize), Immediate(0)); // argv. in Generate()
1769 __ mov(Operand(esp, 2 * kPointerSize), in Generate()
1771 __ CallCFunction(find_handler, 3); in Generate()
1775 __ mov(esi, Operand::StaticVariable(pending_handler_context_address)); in Generate()
1776 __ mov(esp, Operand::StaticVariable(pending_handler_sp_address)); in Generate()
1777 __ mov(ebp, Operand::StaticVariable(pending_handler_fp_address)); in Generate()
1782 __ test(esi, esi); in Generate()
1783 __ j(zero, &skip, Label::kNear); in Generate()
1784 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), esi); in Generate()
1785 __ bind(&skip); in Generate()
1788 __ mov(edi, Operand::StaticVariable(pending_handler_code_address)); in Generate()
1789 __ mov(edx, Operand::StaticVariable(pending_handler_offset_address)); in Generate()
1790 __ lea(edi, FieldOperand(edi, edx, times_1, Code::kHeaderSize)); in Generate()
1791 __ jmp(edi); in Generate()
1802 __ push(ebp); in Generate()
1803 __ mov(ebp, esp); in Generate()
1807 __ push(Immediate(Smi::FromInt(marker))); // marker in Generate()
1809 __ push(Operand::StaticVariable(context_address)); // context in Generate()
1811 __ push(edi); in Generate()
1812 __ push(esi); in Generate()
1813 __ push(ebx); in Generate()
1817 __ push(Operand::StaticVariable(c_entry_fp)); in Generate()
1821 __ cmp(Operand::StaticVariable(js_entry_sp), Immediate(0)); in Generate()
1822 __ j(not_equal, ¬_outermost_js, Label::kNear); in Generate()
1823 __ mov(Operand::StaticVariable(js_entry_sp), ebp); in Generate()
1824 __ push(Immediate(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); in Generate()
1825 __ jmp(&invoke, Label::kNear); in Generate()
1826 __ bind(¬_outermost_js); in Generate()
1827 __ push(Immediate(Smi::FromInt(StackFrame::INNER_JSENTRY_FRAME))); in Generate()
1831 __ jmp(&invoke); in Generate()
1832 __ bind(&handler_entry); in Generate()
1838 __ mov(Operand::StaticVariable(pending_exception), eax); in Generate()
1839 __ mov(eax, Immediate(isolate()->factory()->exception())); in Generate()
1840 __ jmp(&exit); in Generate()
1843 __ bind(&invoke); in Generate()
1844 __ PushStackHandler(); in Generate()
1847 __ push(Immediate(0)); // receiver in Generate()
1856 __ mov(edx, Immediate(construct_entry)); in Generate()
1859 __ mov(edx, Immediate(entry)); in Generate()
1861 __ mov(edx, Operand(edx, 0)); // deref address in Generate()
1862 __ lea(edx, FieldOperand(edx, Code::kHeaderSize)); in Generate()
1863 __ call(edx); in Generate()
1866 __ PopStackHandler(); in Generate()
1868 __ bind(&exit); in Generate()
1870 __ pop(ebx); in Generate()
1871 __ cmp(ebx, Immediate(Smi::FromInt(StackFrame::OUTERMOST_JSENTRY_FRAME))); in Generate()
1872 __ j(not_equal, ¬_outermost_js_2); in Generate()
1873 __ mov(Operand::StaticVariable(js_entry_sp), Immediate(0)); in Generate()
1874 __ bind(¬_outermost_js_2); in Generate()
1877 __ pop(Operand::StaticVariable(ExternalReference( in Generate()
1881 __ pop(ebx); in Generate()
1882 __ pop(esi); in Generate()
1883 __ pop(edi); in Generate()
1884 __ add(esp, Immediate(2 * kPointerSize)); // remove markers in Generate()
1887 __ pop(ebp); in Generate()
1888 __ ret(0); in Generate()
1899 __ JumpIfSmi(object_, receiver_not_string_); in GenerateFast()
1902 __ mov(result_, FieldOperand(object_, HeapObject::kMapOffset)); in GenerateFast()
1903 __ movzx_b(result_, FieldOperand(result_, Map::kInstanceTypeOffset)); in GenerateFast()
1905 __ test(result_, Immediate(kIsNotStringMask)); in GenerateFast()
1906 __ j(not_zero, receiver_not_string_); in GenerateFast()
1911 __ JumpIfNotSmi(index_, &index_not_smi_); in GenerateFast()
1912 __ bind(&got_smi_index_); in GenerateFast()
1915 __ cmp(index_, FieldOperand(object_, String::kLengthOffset)); in GenerateFast()
1916 __ j(above_equal, index_out_of_range_); in GenerateFast()
1918 __ SmiUntag(index_); in GenerateFast()
1924 __ SmiTag(result_); in GenerateFast()
1925 __ bind(&exit_); in GenerateFast()
1932 __ Abort(kUnexpectedFallthroughToCharCodeAtSlowCase); in GenerateSlow()
1935 __ bind(&index_not_smi_); in GenerateSlow()
1937 __ CheckMap(index_, in GenerateSlow()
1943 __ push(LoadWithVectorDescriptor::VectorRegister()); in GenerateSlow()
1944 __ push(LoadDescriptor::SlotRegister()); in GenerateSlow()
1946 __ push(object_); in GenerateSlow()
1947 __ push(index_); // Consumed by runtime conversion function. in GenerateSlow()
1948 __ CallRuntime(Runtime::kNumberToSmi); in GenerateSlow()
1952 __ mov(index_, eax); in GenerateSlow()
1954 __ pop(object_); in GenerateSlow()
1956 __ pop(LoadDescriptor::SlotRegister()); in GenerateSlow()
1957 __ pop(LoadWithVectorDescriptor::VectorRegister()); in GenerateSlow()
1960 __ mov(result_, FieldOperand(object_, HeapObject::kMapOffset)); in GenerateSlow()
1961 __ movzx_b(result_, FieldOperand(result_, Map::kInstanceTypeOffset)); in GenerateSlow()
1965 __ JumpIfNotSmi(index_, index_out_of_range_); in GenerateSlow()
1967 __ jmp(&got_smi_index_); in GenerateSlow()
1972 __ bind(&call_runtime_); in GenerateSlow()
1974 __ push(object_); in GenerateSlow()
1975 __ SmiTag(index_); in GenerateSlow()
1976 __ push(index_); in GenerateSlow()
1977 __ CallRuntime(Runtime::kStringCharCodeAtRT); in GenerateSlow()
1979 __ mov(result_, eax); in GenerateSlow()
1982 __ jmp(&exit_); in GenerateSlow()
1984 __ Abort(kUnexpectedFallthroughFromCharCodeAtSlowCase); in GenerateSlow()
1996 __ test(code_, Immediate(kSmiTagMask | in GenerateFast()
1998 __ j(not_zero, &slow_case_); in GenerateFast()
2001 __ Move(result_, Immediate(factory->single_character_string_cache())); in GenerateFast()
2006 __ mov(result_, FieldOperand(result_, in GenerateFast()
2009 __ cmp(result_, factory->undefined_value()); in GenerateFast()
2010 __ j(equal, &slow_case_); in GenerateFast()
2011 __ bind(&exit_); in GenerateFast()
2018 __ Abort(kUnexpectedFallthroughToCharFromCodeSlowCase); in GenerateSlow()
2020 __ bind(&slow_case_); in GenerateSlow()
2022 __ push(code_); in GenerateSlow()
2023 __ CallRuntime(Runtime::kStringCharFromCode); in GenerateSlow()
2025 __ mov(result_, eax); in GenerateSlow()
2028 __ jmp(&exit_); in GenerateSlow()
2030 __ Abort(kUnexpectedFallthroughFromCharFromCodeSlowCase); in GenerateSlow()
2046 __ test(count, count); in GenerateCopyCharacters()
2047 __ j(zero, &done); in GenerateCopyCharacters()
2051 __ shl(count, 1); in GenerateCopyCharacters()
2055 __ bind(&loop); in GenerateCopyCharacters()
2056 __ mov_b(scratch, Operand(src, 0)); in GenerateCopyCharacters()
2057 __ mov_b(Operand(dest, 0), scratch); in GenerateCopyCharacters()
2058 __ inc(src); in GenerateCopyCharacters()
2059 __ inc(dest); in GenerateCopyCharacters()
2060 __ dec(count); in GenerateCopyCharacters()
2061 __ j(not_zero, &loop); in GenerateCopyCharacters()
2063 __ bind(&done); in GenerateCopyCharacters()
2076 __ mov(length, FieldOperand(left, String::kLengthOffset)); in GenerateFlatOneByteStringEquals()
2077 __ cmp(length, FieldOperand(right, String::kLengthOffset)); in GenerateFlatOneByteStringEquals()
2078 __ j(equal, &check_zero_length, Label::kNear); in GenerateFlatOneByteStringEquals()
2079 __ bind(&strings_not_equal); in GenerateFlatOneByteStringEquals()
2080 __ Move(eax, Immediate(Smi::FromInt(NOT_EQUAL))); in GenerateFlatOneByteStringEquals()
2081 __ ret(0); in GenerateFlatOneByteStringEquals()
2085 __ bind(&check_zero_length); in GenerateFlatOneByteStringEquals()
2087 __ test(length, length); in GenerateFlatOneByteStringEquals()
2088 __ j(not_zero, &compare_chars, Label::kNear); in GenerateFlatOneByteStringEquals()
2089 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); in GenerateFlatOneByteStringEquals()
2090 __ ret(0); in GenerateFlatOneByteStringEquals()
2093 __ bind(&compare_chars); in GenerateFlatOneByteStringEquals()
2098 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); in GenerateFlatOneByteStringEquals()
2099 __ ret(0); in GenerateFlatOneByteStringEquals()
2107 __ IncrementCounter(counters->string_compare_native(), 1); in GenerateCompareFlatOneByteStrings()
2111 __ mov(scratch1, FieldOperand(left, String::kLengthOffset)); in GenerateCompareFlatOneByteStrings()
2112 __ mov(scratch3, scratch1); in GenerateCompareFlatOneByteStrings()
2113 __ sub(scratch3, FieldOperand(right, String::kLengthOffset)); in GenerateCompareFlatOneByteStrings()
2117 __ j(less_equal, &left_shorter, Label::kNear); in GenerateCompareFlatOneByteStrings()
2119 __ sub(scratch1, length_delta); in GenerateCompareFlatOneByteStrings()
2120 __ bind(&left_shorter); in GenerateCompareFlatOneByteStrings()
2126 __ test(min_length, min_length); in GenerateCompareFlatOneByteStrings()
2127 __ j(zero, &compare_lengths, Label::kNear); in GenerateCompareFlatOneByteStrings()
2135 __ bind(&compare_lengths); in GenerateCompareFlatOneByteStrings()
2136 __ test(length_delta, length_delta); in GenerateCompareFlatOneByteStrings()
2138 __ j(not_zero, &length_not_equal, Label::kNear); in GenerateCompareFlatOneByteStrings()
2143 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); in GenerateCompareFlatOneByteStrings()
2144 __ ret(0); in GenerateCompareFlatOneByteStrings()
2148 __ bind(&length_not_equal); in GenerateCompareFlatOneByteStrings()
2149 __ j(greater, &result_greater, Label::kNear); in GenerateCompareFlatOneByteStrings()
2150 __ jmp(&result_less, Label::kNear); in GenerateCompareFlatOneByteStrings()
2151 __ bind(&result_not_equal); in GenerateCompareFlatOneByteStrings()
2152 __ j(above, &result_greater, Label::kNear); in GenerateCompareFlatOneByteStrings()
2153 __ bind(&result_less); in GenerateCompareFlatOneByteStrings()
2156 __ Move(eax, Immediate(Smi::FromInt(LESS))); in GenerateCompareFlatOneByteStrings()
2157 __ ret(0); in GenerateCompareFlatOneByteStrings()
2160 __ bind(&result_greater); in GenerateCompareFlatOneByteStrings()
2161 __ Move(eax, Immediate(Smi::FromInt(GREATER))); in GenerateCompareFlatOneByteStrings()
2162 __ ret(0); in GenerateCompareFlatOneByteStrings()
2173 __ SmiUntag(length); in GenerateOneByteCharsCompareLoop()
2174 __ lea(left, in GenerateOneByteCharsCompareLoop()
2176 __ lea(right, in GenerateOneByteCharsCompareLoop()
2178 __ neg(length); in GenerateOneByteCharsCompareLoop()
2183 __ bind(&loop); in GenerateOneByteCharsCompareLoop()
2184 __ mov_b(scratch, Operand(left, index, times_1, 0)); in GenerateOneByteCharsCompareLoop()
2185 __ cmpb(scratch, Operand(right, index, times_1, 0)); in GenerateOneByteCharsCompareLoop()
2186 __ j(not_equal, chars_not_equal, chars_not_equal_near); in GenerateOneByteCharsCompareLoop()
2187 __ inc(index); in GenerateOneByteCharsCompareLoop()
2188 __ j(not_zero, &loop); in GenerateOneByteCharsCompareLoop()
2202 __ mov(ecx, isolate()->factory()->undefined_value()); in Generate()
2206 __ test(ecx, Immediate(kSmiTagMask)); in Generate()
2207 __ Assert(not_equal, kExpectedAllocationSite); in Generate()
2208 __ cmp(FieldOperand(ecx, HeapObject::kMapOffset), in Generate()
2210 __ Assert(equal, kExpectedAllocationSite); in Generate()
2216 __ TailCallStub(&stub); in Generate()
2226 __ JumpIfSmi(edx, &miss, miss_distance); in GenerateBooleans()
2227 __ mov(ecx, FieldOperand(edx, HeapObject::kMapOffset)); in GenerateBooleans()
2228 __ JumpIfSmi(eax, &miss, miss_distance); in GenerateBooleans()
2229 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); in GenerateBooleans()
2230 __ JumpIfNotRoot(ecx, Heap::kBooleanMapRootIndex, &miss, miss_distance); in GenerateBooleans()
2231 __ JumpIfNotRoot(ebx, Heap::kBooleanMapRootIndex, &miss, miss_distance); in GenerateBooleans()
2233 __ mov(eax, FieldOperand(eax, Oddball::kToNumberOffset)); in GenerateBooleans()
2234 __ AssertSmi(eax); in GenerateBooleans()
2235 __ mov(edx, FieldOperand(edx, Oddball::kToNumberOffset)); in GenerateBooleans()
2236 __ AssertSmi(edx); in GenerateBooleans()
2237 __ push(eax); in GenerateBooleans()
2238 __ mov(eax, edx); in GenerateBooleans()
2239 __ pop(edx); in GenerateBooleans()
2241 __ sub(eax, edx); in GenerateBooleans()
2242 __ Ret(); in GenerateBooleans()
2244 __ bind(&miss); in GenerateBooleans()
2252 __ mov(ecx, edx); in GenerateSmis()
2253 __ or_(ecx, eax); in GenerateSmis()
2254 __ JumpIfNotSmi(ecx, &miss, Label::kNear); in GenerateSmis()
2258 __ sub(eax, edx); in GenerateSmis()
2261 __ sub(edx, eax); in GenerateSmis()
2262 __ j(no_overflow, &done, Label::kNear); in GenerateSmis()
2264 __ not_(edx); in GenerateSmis()
2265 __ bind(&done); in GenerateSmis()
2266 __ mov(eax, edx); in GenerateSmis()
2268 __ ret(0); in GenerateSmis()
2270 __ bind(&miss); in GenerateSmis()
2283 __ JumpIfNotSmi(edx, &miss); in GenerateNumbers()
2286 __ JumpIfNotSmi(eax, &miss); in GenerateNumbers()
2291 __ JumpIfSmi(eax, &right_smi, Label::kNear); in GenerateNumbers()
2292 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), in GenerateNumbers()
2294 __ j(not_equal, &maybe_undefined1, Label::kNear); in GenerateNumbers()
2295 __ movsd(xmm1, FieldOperand(eax, HeapNumber::kValueOffset)); in GenerateNumbers()
2296 __ jmp(&left, Label::kNear); in GenerateNumbers()
2297 __ bind(&right_smi); in GenerateNumbers()
2298 __ mov(ecx, eax); // Can't clobber eax because we can still jump away. in GenerateNumbers()
2299 __ SmiUntag(ecx); in GenerateNumbers()
2300 __ Cvtsi2sd(xmm1, ecx); in GenerateNumbers()
2302 __ bind(&left); in GenerateNumbers()
2303 __ JumpIfSmi(edx, &left_smi, Label::kNear); in GenerateNumbers()
2304 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), in GenerateNumbers()
2306 __ j(not_equal, &maybe_undefined2, Label::kNear); in GenerateNumbers()
2307 __ movsd(xmm0, FieldOperand(edx, HeapNumber::kValueOffset)); in GenerateNumbers()
2308 __ jmp(&done); in GenerateNumbers()
2309 __ bind(&left_smi); in GenerateNumbers()
2310 __ mov(ecx, edx); // Can't clobber edx because we can still jump away. in GenerateNumbers()
2311 __ SmiUntag(ecx); in GenerateNumbers()
2312 __ Cvtsi2sd(xmm0, ecx); in GenerateNumbers()
2314 __ bind(&done); in GenerateNumbers()
2316 __ ucomisd(xmm0, xmm1); in GenerateNumbers()
2319 __ j(parity_even, &unordered, Label::kNear); in GenerateNumbers()
2323 __ mov(eax, 0); // equal in GenerateNumbers()
2324 __ mov(ecx, Immediate(Smi::FromInt(1))); in GenerateNumbers()
2325 __ cmov(above, eax, ecx); in GenerateNumbers()
2326 __ mov(ecx, Immediate(Smi::FromInt(-1))); in GenerateNumbers()
2327 __ cmov(below, eax, ecx); in GenerateNumbers()
2328 __ ret(0); in GenerateNumbers()
2330 __ bind(&unordered); in GenerateNumbers()
2331 __ bind(&generic_stub); in GenerateNumbers()
2334 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); in GenerateNumbers()
2336 __ bind(&maybe_undefined1); in GenerateNumbers()
2338 __ cmp(eax, Immediate(isolate()->factory()->undefined_value())); in GenerateNumbers()
2339 __ j(not_equal, &miss); in GenerateNumbers()
2340 __ JumpIfSmi(edx, &unordered); in GenerateNumbers()
2341 __ CmpObjectType(edx, HEAP_NUMBER_TYPE, ecx); in GenerateNumbers()
2342 __ j(not_equal, &maybe_undefined2, Label::kNear); in GenerateNumbers()
2343 __ jmp(&unordered); in GenerateNumbers()
2346 __ bind(&maybe_undefined2); in GenerateNumbers()
2348 __ cmp(edx, Immediate(isolate()->factory()->undefined_value())); in GenerateNumbers()
2349 __ j(equal, &unordered); in GenerateNumbers()
2352 __ bind(&miss); in GenerateNumbers()
2369 __ mov(tmp1, left); in GenerateInternalizedStrings()
2371 __ and_(tmp1, right); in GenerateInternalizedStrings()
2372 __ JumpIfSmi(tmp1, &miss, Label::kNear); in GenerateInternalizedStrings()
2375 __ mov(tmp1, FieldOperand(left, HeapObject::kMapOffset)); in GenerateInternalizedStrings()
2376 __ mov(tmp2, FieldOperand(right, HeapObject::kMapOffset)); in GenerateInternalizedStrings()
2377 __ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); in GenerateInternalizedStrings()
2378 __ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); in GenerateInternalizedStrings()
2380 __ or_(tmp1, tmp2); in GenerateInternalizedStrings()
2381 __ test(tmp1, Immediate(kIsNotStringMask | kIsNotInternalizedMask)); in GenerateInternalizedStrings()
2382 __ j(not_zero, &miss, Label::kNear); in GenerateInternalizedStrings()
2386 __ cmp(left, right); in GenerateInternalizedStrings()
2390 __ j(not_equal, &done, Label::kNear); in GenerateInternalizedStrings()
2393 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); in GenerateInternalizedStrings()
2394 __ bind(&done); in GenerateInternalizedStrings()
2395 __ ret(0); in GenerateInternalizedStrings()
2397 __ bind(&miss); in GenerateInternalizedStrings()
2414 __ mov(tmp1, left); in GenerateUniqueNames()
2416 __ and_(tmp1, right); in GenerateUniqueNames()
2417 __ JumpIfSmi(tmp1, &miss, Label::kNear); in GenerateUniqueNames()
2421 __ mov(tmp1, FieldOperand(left, HeapObject::kMapOffset)); in GenerateUniqueNames()
2422 __ mov(tmp2, FieldOperand(right, HeapObject::kMapOffset)); in GenerateUniqueNames()
2423 __ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); in GenerateUniqueNames()
2424 __ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); in GenerateUniqueNames()
2426 __ JumpIfNotUniqueNameInstanceType(tmp1, &miss, Label::kNear); in GenerateUniqueNames()
2427 __ JumpIfNotUniqueNameInstanceType(tmp2, &miss, Label::kNear); in GenerateUniqueNames()
2431 __ cmp(left, right); in GenerateUniqueNames()
2435 __ j(not_equal, &done, Label::kNear); in GenerateUniqueNames()
2438 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); in GenerateUniqueNames()
2439 __ bind(&done); in GenerateUniqueNames()
2440 __ ret(0); in GenerateUniqueNames()
2442 __ bind(&miss); in GenerateUniqueNames()
2461 __ mov(tmp1, left); in GenerateStrings()
2463 __ and_(tmp1, right); in GenerateStrings()
2464 __ JumpIfSmi(tmp1, &miss); in GenerateStrings()
2468 __ mov(tmp1, FieldOperand(left, HeapObject::kMapOffset)); in GenerateStrings()
2469 __ mov(tmp2, FieldOperand(right, HeapObject::kMapOffset)); in GenerateStrings()
2470 __ movzx_b(tmp1, FieldOperand(tmp1, Map::kInstanceTypeOffset)); in GenerateStrings()
2471 __ movzx_b(tmp2, FieldOperand(tmp2, Map::kInstanceTypeOffset)); in GenerateStrings()
2472 __ mov(tmp3, tmp1); in GenerateStrings()
2474 __ or_(tmp3, tmp2); in GenerateStrings()
2475 __ test(tmp3, Immediate(kIsNotStringMask)); in GenerateStrings()
2476 __ j(not_zero, &miss); in GenerateStrings()
2480 __ cmp(left, right); in GenerateStrings()
2481 __ j(not_equal, ¬_same, Label::kNear); in GenerateStrings()
2484 __ Move(eax, Immediate(Smi::FromInt(EQUAL))); in GenerateStrings()
2485 __ ret(0); in GenerateStrings()
2488 __ bind(¬_same); in GenerateStrings()
2497 __ or_(tmp1, tmp2); in GenerateStrings()
2498 __ test(tmp1, Immediate(kIsNotInternalizedMask)); in GenerateStrings()
2499 __ j(not_zero, &do_compare, Label::kNear); in GenerateStrings()
2503 __ ret(0); in GenerateStrings()
2504 __ bind(&do_compare); in GenerateStrings()
2509 __ JumpIfNotBothSequentialOneByteStrings(left, right, tmp1, tmp2, &runtime); in GenerateStrings()
2521 __ bind(&runtime); in GenerateStrings()
2525 __ Push(left); in GenerateStrings()
2526 __ Push(right); in GenerateStrings()
2527 __ CallRuntime(Runtime::kStringEqual); in GenerateStrings()
2529 __ sub(eax, Immediate(masm->isolate()->factory()->true_value())); in GenerateStrings()
2530 __ Ret(); in GenerateStrings()
2532 __ pop(tmp1); // Return address. in GenerateStrings()
2533 __ push(left); in GenerateStrings()
2534 __ push(right); in GenerateStrings()
2535 __ push(tmp1); in GenerateStrings()
2536 __ TailCallRuntime(Runtime::kStringCompare); in GenerateStrings()
2539 __ bind(&miss); in GenerateStrings()
2547 __ mov(ecx, edx); in GenerateReceivers()
2548 __ and_(ecx, eax); in GenerateReceivers()
2549 __ JumpIfSmi(ecx, &miss, Label::kNear); in GenerateReceivers()
2552 __ CmpObjectType(eax, FIRST_JS_RECEIVER_TYPE, ecx); in GenerateReceivers()
2553 __ j(below, &miss, Label::kNear); in GenerateReceivers()
2554 __ CmpObjectType(edx, FIRST_JS_RECEIVER_TYPE, ecx); in GenerateReceivers()
2555 __ j(below, &miss, Label::kNear); in GenerateReceivers()
2558 __ sub(eax, edx); in GenerateReceivers()
2559 __ ret(0); in GenerateReceivers()
2561 __ bind(&miss); in GenerateReceivers()
2569 __ mov(ecx, edx); in GenerateKnownReceivers()
2570 __ and_(ecx, eax); in GenerateKnownReceivers()
2571 __ JumpIfSmi(ecx, &miss, Label::kNear); in GenerateKnownReceivers()
2573 __ GetWeakValue(edi, cell); in GenerateKnownReceivers()
2574 __ cmp(edi, FieldOperand(eax, HeapObject::kMapOffset)); in GenerateKnownReceivers()
2575 __ j(not_equal, &miss, Label::kNear); in GenerateKnownReceivers()
2576 __ cmp(edi, FieldOperand(edx, HeapObject::kMapOffset)); in GenerateKnownReceivers()
2577 __ j(not_equal, &miss, Label::kNear); in GenerateKnownReceivers()
2580 __ sub(eax, edx); in GenerateKnownReceivers()
2581 __ ret(0); in GenerateKnownReceivers()
2583 __ PopReturnAddressTo(ecx); in GenerateKnownReceivers()
2584 __ Push(edx); in GenerateKnownReceivers()
2585 __ Push(eax); in GenerateKnownReceivers()
2586 __ Push(Immediate(Smi::FromInt(NegativeComparisonResult(GetCondition())))); in GenerateKnownReceivers()
2587 __ PushReturnAddressFrom(ecx); in GenerateKnownReceivers()
2588 __ TailCallRuntime(Runtime::kCompare); in GenerateKnownReceivers()
2591 __ bind(&miss); in GenerateKnownReceivers()
2600 __ push(edx); // Preserve edx and eax. in GenerateMiss()
2601 __ push(eax); in GenerateMiss()
2602 __ push(edx); // And also use them as the arguments. in GenerateMiss()
2603 __ push(eax); in GenerateMiss()
2604 __ push(Immediate(Smi::FromInt(op()))); in GenerateMiss()
2605 __ CallRuntime(Runtime::kCompareIC_Miss); in GenerateMiss()
2607 __ lea(edi, FieldOperand(eax, Code::kHeaderSize)); in GenerateMiss()
2608 __ pop(eax); in GenerateMiss()
2609 __ pop(edx); in GenerateMiss()
2613 __ jmp(edi); in GenerateMiss()
2639 __ mov(index, FieldOperand(properties, kCapacityOffset)); in GenerateNegativeLookup()
2640 __ dec(index); in GenerateNegativeLookup()
2641 __ and_(index, in GenerateNegativeLookup()
2647 __ lea(index, Operand(index, index, times_2, 0)); // index *= 3. in GenerateNegativeLookup()
2651 __ mov(entity_name, Operand(properties, index, times_half_pointer_size, in GenerateNegativeLookup()
2653 __ cmp(entity_name, masm->isolate()->factory()->undefined_value()); in GenerateNegativeLookup()
2654 __ j(equal, done); in GenerateNegativeLookup()
2657 __ cmp(entity_name, Handle<Name>(name)); in GenerateNegativeLookup()
2658 __ j(equal, miss); in GenerateNegativeLookup()
2662 __ cmp(entity_name, masm->isolate()->factory()->the_hole_value()); in GenerateNegativeLookup()
2663 __ j(equal, &good, Label::kNear); in GenerateNegativeLookup()
2666 __ mov(entity_name, FieldOperand(entity_name, HeapObject::kMapOffset)); in GenerateNegativeLookup()
2667 __ JumpIfNotUniqueNameInstanceType( in GenerateNegativeLookup()
2669 __ bind(&good); in GenerateNegativeLookup()
2674 __ push(Immediate(Handle<Object>(name))); in GenerateNegativeLookup()
2675 __ push(Immediate(name->Hash())); in GenerateNegativeLookup()
2676 __ CallStub(&stub); in GenerateNegativeLookup()
2677 __ test(r0, r0); in GenerateNegativeLookup()
2678 __ j(not_zero, miss); in GenerateNegativeLookup()
2679 __ jmp(done); in GenerateNegativeLookup()
2699 __ AssertName(name); in GeneratePositiveLookup()
2701 __ mov(r1, FieldOperand(elements, kCapacityOffset)); in GeneratePositiveLookup()
2702 __ shr(r1, kSmiTagSize); // convert smi to int in GeneratePositiveLookup()
2703 __ dec(r1); in GeneratePositiveLookup()
2710 __ mov(r0, FieldOperand(name, Name::kHashFieldOffset)); in GeneratePositiveLookup()
2711 __ shr(r0, Name::kHashShift); in GeneratePositiveLookup()
2713 __ add(r0, Immediate(NameDictionary::GetProbeOffset(i))); in GeneratePositiveLookup()
2715 __ and_(r0, r1); in GeneratePositiveLookup()
2719 __ lea(r0, Operand(r0, r0, times_2, 0)); // r0 = r0 * 3 in GeneratePositiveLookup()
2722 __ cmp(name, Operand(elements, in GeneratePositiveLookup()
2726 __ j(equal, done); in GeneratePositiveLookup()
2731 __ push(name); in GeneratePositiveLookup()
2732 __ mov(r0, FieldOperand(name, Name::kHashFieldOffset)); in GeneratePositiveLookup()
2733 __ shr(r0, Name::kHashShift); in GeneratePositiveLookup()
2734 __ push(r0); in GeneratePositiveLookup()
2735 __ CallStub(&stub); in GeneratePositiveLookup()
2737 __ test(r1, r1); in GeneratePositiveLookup()
2738 __ j(zero, miss); in GeneratePositiveLookup()
2739 __ jmp(done); in GeneratePositiveLookup()
2762 __ mov(scratch, FieldOperand(dictionary(), kCapacityOffset)); in Generate()
2763 __ dec(scratch); in Generate()
2764 __ SmiUntag(scratch); in Generate()
2765 __ push(scratch); in Generate()
2774 __ mov(scratch, Operand(esp, 2 * kPointerSize)); in Generate()
2776 __ add(scratch, Immediate(NameDictionary::GetProbeOffset(i))); in Generate()
2778 __ and_(scratch, Operand(esp, 0)); in Generate()
2782 __ lea(index(), Operand(scratch, scratch, times_2, 0)); // index *= 3. in Generate()
2786 __ mov(scratch, Operand(dictionary(), index(), times_pointer_size, in Generate()
2788 __ cmp(scratch, isolate()->factory()->undefined_value()); in Generate()
2789 __ j(equal, ¬_in_dictionary); in Generate()
2792 __ cmp(scratch, Operand(esp, 3 * kPointerSize)); in Generate()
2793 __ j(equal, &in_dictionary); in Generate()
2801 __ mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); in Generate()
2802 __ JumpIfNotUniqueNameInstanceType( in Generate()
2808 __ bind(&maybe_in_dictionary); in Generate()
2813 __ mov(result(), Immediate(0)); in Generate()
2814 __ Drop(1); in Generate()
2815 __ ret(2 * kPointerSize); in Generate()
2818 __ bind(&in_dictionary); in Generate()
2819 __ mov(result(), Immediate(1)); in Generate()
2820 __ Drop(1); in Generate()
2821 __ ret(2 * kPointerSize); in Generate()
2823 __ bind(¬_in_dictionary); in Generate()
2824 __ mov(result(), Immediate(0)); in Generate()
2825 __ Drop(1); in Generate()
2826 __ ret(2 * kPointerSize); in Generate()
2851 __ jmp(&skip_to_incremental_noncompacting, Label::kNear); in Generate()
2852 __ jmp(&skip_to_incremental_compacting, Label::kFar); in Generate()
2855 __ RememberedSetHelper(object(), address(), value(), save_fp_regs_mode(), in Generate()
2858 __ ret(0); in Generate()
2861 __ bind(&skip_to_incremental_noncompacting); in Generate()
2864 __ bind(&skip_to_incremental_compacting); in Generate()
2880 __ mov(regs_.scratch0(), Operand(regs_.address(), 0)); in GenerateIncremental()
2881 __ JumpIfNotInNewSpace(regs_.scratch0(), // Value. in GenerateIncremental()
2885 __ JumpIfInNewSpace(regs_.object(), regs_.scratch0(), in GenerateIncremental()
2896 __ RememberedSetHelper(object(), address(), value(), save_fp_regs_mode(), in GenerateIncremental()
2899 __ bind(&dont_need_remembered_set); in GenerateIncremental()
2908 __ ret(0); in GenerateIncremental()
2915 __ PrepareCallCFunction(argument_count, regs_.scratch0()); in InformIncrementalMarker()
2916 __ mov(Operand(esp, 0 * kPointerSize), regs_.object()); in InformIncrementalMarker()
2917 __ mov(Operand(esp, 1 * kPointerSize), regs_.address()); // Slot. in InformIncrementalMarker()
2918 __ mov(Operand(esp, 2 * kPointerSize), in InformIncrementalMarker()
2922 __ CallCFunction( in InformIncrementalMarker()
2938 __ JumpIfBlack(regs_.object(), in CheckNeedsToInformIncrementalMarker()
2946 __ RememberedSetHelper(object(), address(), value(), save_fp_regs_mode(), in CheckNeedsToInformIncrementalMarker()
2949 __ ret(0); in CheckNeedsToInformIncrementalMarker()
2952 __ bind(&object_is_black); in CheckNeedsToInformIncrementalMarker()
2955 __ mov(regs_.scratch0(), Operand(regs_.address(), 0)); in CheckNeedsToInformIncrementalMarker()
2960 __ CheckPageFlag(regs_.scratch0(), // Contains value. in CheckNeedsToInformIncrementalMarker()
2967 __ CheckPageFlag(regs_.object(), in CheckNeedsToInformIncrementalMarker()
2974 __ jmp(&need_incremental); in CheckNeedsToInformIncrementalMarker()
2976 __ bind(&ensure_not_white); in CheckNeedsToInformIncrementalMarker()
2981 __ push(regs_.object()); in CheckNeedsToInformIncrementalMarker()
2982 __ JumpIfWhite(regs_.scratch0(), // The value. in CheckNeedsToInformIncrementalMarker()
2986 __ pop(regs_.object()); in CheckNeedsToInformIncrementalMarker()
2990 __ RememberedSetHelper(object(), address(), value(), save_fp_regs_mode(), in CheckNeedsToInformIncrementalMarker()
2993 __ ret(0); in CheckNeedsToInformIncrementalMarker()
2996 __ bind(&need_incremental_pop_object); in CheckNeedsToInformIncrementalMarker()
2997 __ pop(regs_.object()); in CheckNeedsToInformIncrementalMarker()
2999 __ bind(&need_incremental); in CheckNeedsToInformIncrementalMarker()
3007 __ call(ces.GetCode(), RelocInfo::CODE_TARGET); in Generate()
3010 __ mov(ebx, MemOperand(ebp, parameter_count_offset)); in Generate()
3012 __ pop(ecx); in Generate()
3015 __ lea(esp, MemOperand(esp, ebx, times_pointer_size, additional_offset)); in Generate()
3016 __ jmp(ecx); // Return to IC Miss stub, continuation still on stack. in Generate()
3020 __ EmitLoadTypeFeedbackVector(StoreWithVectorDescriptor::VectorRegister()); in Generate()
3036 __ push(receiver); in HandlePolymorphicStoreCase()
3044 __ JumpIfSmi(receiver, &load_smi_map); in HandlePolymorphicStoreCase()
3045 __ mov(receiver_map, FieldOperand(receiver, 0)); in HandlePolymorphicStoreCase()
3046 __ bind(&compare_map); in HandlePolymorphicStoreCase()
3047 __ mov(cached_map, FieldOperand(feedback, FixedArray::OffsetOfElementAt(0))); in HandlePolymorphicStoreCase()
3052 __ cmp(receiver_map, FieldOperand(cached_map, WeakCell::kValueOffset)); in HandlePolymorphicStoreCase()
3053 __ j(not_equal, &start_polymorphic); in HandlePolymorphicStoreCase()
3058 __ mov(handler, FieldOperand(feedback, FixedArray::OffsetOfElementAt(1))); in HandlePolymorphicStoreCase()
3059 __ pop(receiver); in HandlePolymorphicStoreCase()
3060 __ lea(handler, FieldOperand(handler, Code::kHeaderSize)); in HandlePolymorphicStoreCase()
3061 __ jmp(handler); in HandlePolymorphicStoreCase()
3064 __ bind(&start_polymorphic); in HandlePolymorphicStoreCase()
3065 __ push(key); in HandlePolymorphicStoreCase()
3067 __ mov(counter, Immediate(Smi::FromInt(2))); in HandlePolymorphicStoreCase()
3072 __ cmp(counter, FieldOperand(feedback, FixedArray::kLengthOffset)); in HandlePolymorphicStoreCase()
3073 __ j(greater_equal, &pop_and_miss); in HandlePolymorphicStoreCase()
3076 __ bind(&next_loop); in HandlePolymorphicStoreCase()
3077 __ mov(cached_map, FieldOperand(feedback, counter, times_half_pointer_size, in HandlePolymorphicStoreCase()
3079 __ cmp(receiver_map, FieldOperand(cached_map, WeakCell::kValueOffset)); in HandlePolymorphicStoreCase()
3080 __ j(not_equal, &prepare_next); in HandlePolymorphicStoreCase()
3081 __ mov(handler, FieldOperand(feedback, counter, times_half_pointer_size, in HandlePolymorphicStoreCase()
3083 __ lea(handler, FieldOperand(handler, Code::kHeaderSize)); in HandlePolymorphicStoreCase()
3084 __ pop(key); in HandlePolymorphicStoreCase()
3085 __ pop(receiver); in HandlePolymorphicStoreCase()
3086 __ jmp(handler); in HandlePolymorphicStoreCase()
3088 __ bind(&prepare_next); in HandlePolymorphicStoreCase()
3089 __ add(counter, Immediate(Smi::FromInt(2))); in HandlePolymorphicStoreCase()
3090 __ cmp(counter, FieldOperand(feedback, FixedArray::kLengthOffset)); in HandlePolymorphicStoreCase()
3091 __ j(less, &next_loop); in HandlePolymorphicStoreCase()
3094 __ bind(&pop_and_miss); in HandlePolymorphicStoreCase()
3095 __ pop(key); in HandlePolymorphicStoreCase()
3096 __ pop(receiver); in HandlePolymorphicStoreCase()
3097 __ jmp(miss); in HandlePolymorphicStoreCase()
3099 __ bind(&load_smi_map); in HandlePolymorphicStoreCase()
3100 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); in HandlePolymorphicStoreCase()
3101 __ jmp(&compare_map); in HandlePolymorphicStoreCase()
3117 __ mov(ic_map, FieldOperand(weak_cell, WeakCell::kValueOffset)); in HandleMonomorphicStoreCase()
3120 __ JumpIfSmi(receiver, &compare_smi_map); in HandleMonomorphicStoreCase()
3121 __ cmp(ic_map, FieldOperand(receiver, 0)); in HandleMonomorphicStoreCase()
3122 __ j(not_equal, miss); in HandleMonomorphicStoreCase()
3123 __ mov(weak_cell, FieldOperand(vector, slot, times_half_pointer_size, in HandleMonomorphicStoreCase()
3125 __ lea(weak_cell, FieldOperand(weak_cell, Code::kHeaderSize)); in HandleMonomorphicStoreCase()
3127 __ jmp(weak_cell); in HandleMonomorphicStoreCase()
3131 __ bind(&compare_smi_map); in HandleMonomorphicStoreCase()
3132 __ CompareRoot(ic_map, Heap::kHeapNumberMapRootIndex); in HandleMonomorphicStoreCase()
3133 __ j(not_equal, miss); in HandleMonomorphicStoreCase()
3134 __ mov(weak_cell, FieldOperand(vector, slot, times_half_pointer_size, in HandleMonomorphicStoreCase()
3136 __ lea(weak_cell, FieldOperand(weak_cell, Code::kHeaderSize)); in HandleMonomorphicStoreCase()
3138 __ jmp(weak_cell); in HandleMonomorphicStoreCase()
3160 __ push(receiver); in HandlePolymorphicKeyedStoreCase()
3168 __ JumpIfSmi(receiver, &load_smi_map); in HandlePolymorphicKeyedStoreCase()
3169 __ mov(receiver_map, FieldOperand(receiver, 0)); in HandlePolymorphicKeyedStoreCase()
3170 __ bind(&compare_map); in HandlePolymorphicKeyedStoreCase()
3173 __ push(key); in HandlePolymorphicKeyedStoreCase()
3189 __ mov(counter, Immediate(Smi::kZero)); in HandlePolymorphicKeyedStoreCase()
3190 __ bind(&next_loop); in HandlePolymorphicKeyedStoreCase()
3191 __ mov(cached_map, FieldOperand(feedback, counter, times_half_pointer_size, in HandlePolymorphicKeyedStoreCase()
3193 __ cmp(receiver_map, FieldOperand(cached_map, WeakCell::kValueOffset)); in HandlePolymorphicKeyedStoreCase()
3194 __ j(not_equal, &prepare_next); in HandlePolymorphicKeyedStoreCase()
3195 __ mov(cached_map, FieldOperand(feedback, counter, times_half_pointer_size, in HandlePolymorphicKeyedStoreCase()
3197 __ CompareRoot(cached_map, Heap::kUndefinedValueRootIndex); in HandlePolymorphicKeyedStoreCase()
3198 __ j(not_equal, &transition_call); in HandlePolymorphicKeyedStoreCase()
3199 __ mov(feedback, FieldOperand(feedback, counter, times_half_pointer_size, in HandlePolymorphicKeyedStoreCase()
3201 __ pop(key); in HandlePolymorphicKeyedStoreCase()
3202 __ pop(receiver); in HandlePolymorphicKeyedStoreCase()
3203 __ lea(feedback, FieldOperand(feedback, Code::kHeaderSize)); in HandlePolymorphicKeyedStoreCase()
3204 __ jmp(feedback); in HandlePolymorphicKeyedStoreCase()
3206 __ bind(&transition_call); in HandlePolymorphicKeyedStoreCase()
3221 __ mov(feedback, FieldOperand(feedback, counter, times_half_pointer_size, in HandlePolymorphicKeyedStoreCase()
3223 __ lea(feedback, FieldOperand(feedback, Code::kHeaderSize)); in HandlePolymorphicKeyedStoreCase()
3225 __ mov(cached_map, FieldOperand(cached_map, WeakCell::kValueOffset)); in HandlePolymorphicKeyedStoreCase()
3227 __ JumpIfSmi(cached_map, &pop_and_miss); in HandlePolymorphicKeyedStoreCase()
3229 __ mov(StoreTransitionDescriptor::MapRegister(), cached_map); in HandlePolymorphicKeyedStoreCase()
3233 __ pop(key); in HandlePolymorphicKeyedStoreCase()
3234 __ pop(receiver); in HandlePolymorphicKeyedStoreCase()
3252 __ jmp(feedback); in HandlePolymorphicKeyedStoreCase()
3254 __ bind(&prepare_next); in HandlePolymorphicKeyedStoreCase()
3255 __ add(counter, Immediate(Smi::FromInt(3))); in HandlePolymorphicKeyedStoreCase()
3256 __ cmp(counter, FieldOperand(feedback, FixedArray::kLengthOffset)); in HandlePolymorphicKeyedStoreCase()
3257 __ j(less, &next_loop); in HandlePolymorphicKeyedStoreCase()
3260 __ bind(&pop_and_miss); in HandlePolymorphicKeyedStoreCase()
3261 __ pop(key); in HandlePolymorphicKeyedStoreCase()
3262 __ pop(receiver); in HandlePolymorphicKeyedStoreCase()
3263 __ jmp(miss); in HandlePolymorphicKeyedStoreCase()
3265 __ bind(&load_smi_map); in HandlePolymorphicKeyedStoreCase()
3266 __ LoadRoot(receiver_map, Heap::kHeapNumberMapRootIndex); in HandlePolymorphicKeyedStoreCase()
3267 __ jmp(&compare_map); in HandlePolymorphicKeyedStoreCase()
3286 __ RecordComment("[ StoreDescriptor -> StoreWithVectorDescriptor"); in GenerateImpl()
3290 __ push(Operand(esp, 0)); in GenerateImpl()
3291 __ mov(Operand(esp, 4), StoreWithVectorDescriptor::VectorRegister()); in GenerateImpl()
3292 __ RecordComment("]"); in GenerateImpl()
3294 __ mov(vector, Operand(esp, 1 * kPointerSize)); in GenerateImpl()
3296 __ mov(slot, Operand(esp, 2 * kPointerSize)); in GenerateImpl()
3300 __ mov(scratch, FieldOperand(vector, slot, times_half_pointer_size, in GenerateImpl()
3306 __ CompareRoot(FieldOperand(scratch, 0), Heap::kWeakCellMapRootIndex); in GenerateImpl()
3307 __ j(not_equal, &try_array); in GenerateImpl()
3311 __ bind(&try_array); in GenerateImpl()
3312 __ CompareRoot(FieldOperand(scratch, 0), Heap::kFixedArrayMapRootIndex); in GenerateImpl()
3313 __ j(not_equal, ¬_array); in GenerateImpl()
3317 __ bind(¬_array); in GenerateImpl()
3319 __ CompareRoot(scratch, Heap::kmegamorphic_symbolRootIndex); in GenerateImpl()
3320 __ j(not_equal, &try_poly_name); in GenerateImpl()
3324 __ jmp(megamorphic_stub, RelocInfo::CODE_TARGET); in GenerateImpl()
3326 __ bind(&try_poly_name); in GenerateImpl()
3328 __ cmp(key, scratch); in GenerateImpl()
3329 __ j(not_equal, &miss); in GenerateImpl()
3332 __ mov(scratch, FieldOperand(vector, slot, times_half_pointer_size, in GenerateImpl()
3337 __ bind(&miss); in GenerateImpl()
3343 __ EmitLoadTypeFeedbackVector(ebx); in Generate()
3345 __ jmp(stub.GetCode(), RelocInfo::CODE_TARGET); in Generate()
3360 __ push(eax); in Generate()
3361 __ push(ecx); in Generate()
3362 __ push(edx); in Generate()
3365 __ lea(eax, Operand(esp, (kNumSavedRegisters + 1) * kPointerSize)); in Generate()
3366 __ push(eax); in Generate()
3370 __ mov(eax, Operand(esp, (kNumSavedRegisters + 1) * kPointerSize)); in Generate()
3371 __ sub(eax, Immediate(Assembler::kCallInstructionLength)); in Generate()
3372 __ push(eax); in Generate()
3376 __ call(FUNCTION_ADDR(isolate()->function_entry_hook()), in Generate()
3378 __ add(esp, Immediate(2 * kPointerSize)); in Generate()
3381 __ pop(edx); in Generate()
3382 __ pop(ecx); in Generate()
3383 __ pop(eax); in Generate()
3385 __ ret(0); in Generate()
3396 __ TailCallStub(&stub); in CreateArrayDispatch()
3403 __ cmp(edx, kind); in CreateArrayDispatch()
3404 __ j(not_equal, &next); in CreateArrayDispatch()
3406 __ TailCallStub(&stub); in CreateArrayDispatch()
3407 __ bind(&next); in CreateArrayDispatch()
3411 __ Abort(kUnexpectedElementsKindInArrayConstructor); in CreateArrayDispatch()
3436 __ test_b(edx, Immediate(1)); in CreateArrayDispatchOneArgument()
3437 __ j(not_zero, &normal_sequence); in CreateArrayDispatchOneArgument()
3441 __ mov(ecx, Operand(esp, kPointerSize)); in CreateArrayDispatchOneArgument()
3442 __ test(ecx, ecx); in CreateArrayDispatchOneArgument()
3443 __ j(zero, &normal_sequence); in CreateArrayDispatchOneArgument()
3452 __ TailCallStub(&stub_holey); in CreateArrayDispatchOneArgument()
3454 __ bind(&normal_sequence); in CreateArrayDispatchOneArgument()
3458 __ TailCallStub(&stub); in CreateArrayDispatchOneArgument()
3462 __ inc(edx); in CreateArrayDispatchOneArgument()
3467 __ cmp(FieldOperand(ebx, 0), Immediate(allocation_site_map)); in CreateArrayDispatchOneArgument()
3468 __ Assert(equal, kExpectedAllocationSite); in CreateArrayDispatchOneArgument()
3475 __ add(FieldOperand(ebx, AllocationSite::kTransitionInfoOffset), in CreateArrayDispatchOneArgument()
3478 __ bind(&normal_sequence); in CreateArrayDispatchOneArgument()
3484 __ cmp(edx, kind); in CreateArrayDispatchOneArgument()
3485 __ j(not_equal, &next); in CreateArrayDispatchOneArgument()
3487 __ TailCallStub(&stub); in CreateArrayDispatchOneArgument()
3488 __ bind(&next); in CreateArrayDispatchOneArgument()
3492 __ Abort(kUnexpectedElementsKindInArrayConstructor); in CreateArrayDispatchOneArgument()
3535 __ test(eax, eax); in GenerateDispatchToArrayStub()
3536 __ j(not_zero, ¬_zero_case); in GenerateDispatchToArrayStub()
3539 __ bind(¬_zero_case); in GenerateDispatchToArrayStub()
3540 __ cmp(eax, 1); in GenerateDispatchToArrayStub()
3541 __ j(greater, ¬_one_case); in GenerateDispatchToArrayStub()
3544 __ bind(¬_one_case); in GenerateDispatchToArrayStub()
3546 __ TailCallStub(&stub); in GenerateDispatchToArrayStub()
3563 __ mov(ecx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); in Generate()
3565 __ test(ecx, Immediate(kSmiTagMask)); in Generate()
3566 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction); in Generate()
3567 __ CmpObjectType(ecx, MAP_TYPE, ecx); in Generate()
3568 __ Assert(equal, kUnexpectedInitialMapForArrayFunction); in Generate()
3571 __ AssertUndefinedOrAllocationSite(ebx); in Generate()
3577 __ mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); in Generate()
3579 __ cmp(edx, edi); in Generate()
3580 __ j(not_equal, &subclassing); in Generate()
3585 __ cmp(ebx, isolate()->factory()->undefined_value()); in Generate()
3586 __ j(equal, &no_info); in Generate()
3589 __ mov(edx, FieldOperand(ebx, AllocationSite::kTransitionInfoOffset)); in Generate()
3590 __ SmiUntag(edx); in Generate()
3592 __ and_(edx, Immediate(AllocationSite::ElementsKindBits::kMask)); in Generate()
3595 __ bind(&no_info); in Generate()
3599 __ bind(&subclassing); in Generate()
3600 __ mov(Operand(esp, eax, times_pointer_size, kPointerSize), edi); in Generate()
3601 __ add(eax, Immediate(3)); in Generate()
3602 __ PopReturnAddressTo(ecx); in Generate()
3603 __ Push(edx); in Generate()
3604 __ Push(ebx); in Generate()
3605 __ PushReturnAddressFrom(ecx); in Generate()
3606 __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate())); in Generate()
3615 __ test(eax, eax); in GenerateCase()
3616 __ j(not_zero, ¬_zero_case); in GenerateCase()
3618 __ TailCallStub(&stub0); in GenerateCase()
3620 __ bind(¬_zero_case); in GenerateCase()
3621 __ cmp(eax, 1); in GenerateCase()
3622 __ j(greater, ¬_one_case); in GenerateCase()
3627 __ mov(ecx, Operand(esp, kPointerSize)); in GenerateCase()
3628 __ test(ecx, ecx); in GenerateCase()
3629 __ j(zero, &normal_sequence); in GenerateCase()
3633 __ TailCallStub(&stub1_holey); in GenerateCase()
3636 __ bind(&normal_sequence); in GenerateCase()
3638 __ TailCallStub(&stub1); in GenerateCase()
3640 __ bind(¬_one_case); in GenerateCase()
3642 __ TailCallStub(&stubN); in GenerateCase()
3659 __ mov(ecx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); in Generate()
3661 __ test(ecx, Immediate(kSmiTagMask)); in Generate()
3662 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction); in Generate()
3663 __ CmpObjectType(ecx, MAP_TYPE, ecx); in Generate()
3664 __ Assert(equal, kUnexpectedInitialMapForArrayFunction); in Generate()
3668 __ mov(ecx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); in Generate()
3672 __ mov(ecx, FieldOperand(ecx, Map::kBitField2Offset)); in Generate()
3674 __ DecodeField<Map::ElementsKindBits>(ecx); in Generate()
3678 __ cmp(ecx, Immediate(FAST_ELEMENTS)); in Generate()
3679 __ j(equal, &done); in Generate()
3680 __ cmp(ecx, Immediate(FAST_HOLEY_ELEMENTS)); in Generate()
3681 __ Assert(equal, in Generate()
3683 __ bind(&done); in Generate()
3687 __ cmp(ecx, Immediate(FAST_ELEMENTS)); in Generate()
3688 __ j(equal, &fast_elements_case); in Generate()
3691 __ bind(&fast_elements_case); in Generate()
3703 __ AssertFunction(edi); in Generate()
3704 __ AssertReceiver(edx); in Generate()
3708 __ CmpObjectType(edx, JS_FUNCTION_TYPE, ebx); in Generate()
3709 __ j(not_equal, &new_object); in Generate()
3712 __ mov(ecx, FieldOperand(edx, JSFunction::kPrototypeOrInitialMapOffset)); in Generate()
3713 __ JumpIfSmi(ecx, &new_object); in Generate()
3714 __ CmpObjectType(ecx, MAP_TYPE, ebx); in Generate()
3715 __ j(not_equal, &new_object); in Generate()
3719 __ cmp(edi, FieldOperand(ecx, Map::kConstructorOrBackPointerOffset)); in Generate()
3720 __ j(not_equal, &new_object); in Generate()
3724 __ movzx_b(ebx, FieldOperand(ecx, Map::kInstanceSizeOffset)); in Generate()
3725 __ lea(ebx, Operand(ebx, times_pointer_size, 0)); in Generate()
3726 __ Allocate(ebx, eax, edi, no_reg, &allocate, NO_ALLOCATION_FLAGS); in Generate()
3727 __ bind(&done_allocate); in Generate()
3730 __ mov(FieldOperand(eax, JSObject::kMapOffset), ecx); in Generate()
3731 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), in Generate()
3733 __ mov(FieldOperand(eax, JSObject::kElementsOffset), in Generate()
3736 __ lea(ebx, FieldOperand(eax, JSObject::kHeaderSize)); in Generate()
3750 __ test(FieldOperand(ecx, Map::kBitField3Offset), in Generate()
3752 __ j(not_zero, &slack_tracking, Label::kNear); in Generate()
3755 __ LoadRoot(edx, Heap::kUndefinedValueRootIndex); in Generate()
3756 __ InitializeFieldsWithFiller(ebx, edi, edx); in Generate()
3757 __ Ret(); in Generate()
3759 __ bind(&slack_tracking); in Generate()
3763 __ sub(FieldOperand(ecx, Map::kBitField3Offset), in Generate()
3767 __ movzx_b(edx, FieldOperand(ecx, Map::kUnusedPropertyFieldsOffset)); in Generate()
3768 __ neg(edx); in Generate()
3769 __ lea(edx, Operand(edi, edx, times_pointer_size, 0)); in Generate()
3770 __ LoadRoot(edi, Heap::kUndefinedValueRootIndex); in Generate()
3771 __ InitializeFieldsWithFiller(ebx, edx, edi); in Generate()
3774 __ movzx_b(edx, FieldOperand(ecx, Map::kUnusedPropertyFieldsOffset)); in Generate()
3775 __ lea(edx, Operand(ebx, edx, times_pointer_size, 0)); in Generate()
3776 __ LoadRoot(edi, Heap::kOnePointerFillerMapRootIndex); in Generate()
3777 __ InitializeFieldsWithFiller(ebx, edx, edi); in Generate()
3782 __ test(FieldOperand(ecx, Map::kBitField3Offset), in Generate()
3784 __ j(zero, &finalize, Label::kNear); in Generate()
3785 __ Ret(); in Generate()
3788 __ bind(&finalize); in Generate()
3791 __ Push(eax); in Generate()
3792 __ Push(ecx); in Generate()
3793 __ CallRuntime(Runtime::kFinalizeInstanceSize); in Generate()
3794 __ Pop(eax); in Generate()
3796 __ Ret(); in Generate()
3800 __ bind(&allocate); in Generate()
3803 __ SmiTag(ebx); in Generate()
3804 __ Push(ecx); in Generate()
3805 __ Push(ebx); in Generate()
3806 __ CallRuntime(Runtime::kAllocateInNewSpace); in Generate()
3807 __ Pop(ecx); in Generate()
3809 __ movzx_b(ebx, FieldOperand(ecx, Map::kInstanceSizeOffset)); in Generate()
3810 __ lea(edi, Operand(eax, ebx, times_pointer_size, 0)); in Generate()
3812 __ dec(edi); in Generate()
3813 __ jmp(&done_allocate); in Generate()
3816 __ bind(&new_object); in Generate()
3817 __ PopReturnAddressTo(ecx); in Generate()
3818 __ Push(edi); in Generate()
3819 __ Push(edx); in Generate()
3820 __ PushReturnAddressFrom(ecx); in Generate()
3821 __ TailCallRuntime(Runtime::kNewObject); in Generate()
3832 __ AssertFunction(edi); in Generate()
3835 __ mov(edx, ebp); in Generate()
3839 __ mov(edx, Operand(edx, StandardFrameConstants::kCallerFPOffset)); in Generate()
3843 __ cmp(edi, Operand(edx, StandardFrameConstants::kFunctionOffset)); in Generate()
3844 __ j(equal, &ok); in Generate()
3845 __ Abort(kInvalidFrameForFastNewRestArgumentsStub); in Generate()
3846 __ bind(&ok); in Generate()
3852 __ mov(ebx, Operand(edx, StandardFrameConstants::kCallerFPOffset)); in Generate()
3853 __ cmp(Operand(ebx, CommonFrameConstants::kContextOrFrameTypeOffset), in Generate()
3855 __ j(not_equal, &no_rest_parameters, Label::kNear); in Generate()
3860 __ mov(ecx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); in Generate()
3861 __ mov(eax, Operand(ebx, ArgumentsAdaptorFrameConstants::kLengthOffset)); in Generate()
3862 __ sub(eax, in Generate()
3864 __ j(greater, &rest_parameters); in Generate()
3867 __ bind(&no_rest_parameters); in Generate()
3876 __ Allocate(JSArray::kSize, eax, edx, ecx, &allocate, NO_ALLOCATION_FLAGS); in Generate()
3877 __ bind(&done_allocate); in Generate()
3880 __ LoadGlobalFunction(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, ecx); in Generate()
3881 __ mov(FieldOperand(eax, JSArray::kMapOffset), ecx); in Generate()
3882 __ mov(ecx, isolate()->factory()->empty_fixed_array()); in Generate()
3883 __ mov(FieldOperand(eax, JSArray::kPropertiesOffset), ecx); in Generate()
3884 __ mov(FieldOperand(eax, JSArray::kElementsOffset), ecx); in Generate()
3885 __ mov(FieldOperand(eax, JSArray::kLengthOffset), Immediate(Smi::kZero)); in Generate()
3887 __ Ret(); in Generate()
3890 __ bind(&allocate); in Generate()
3893 __ Push(Smi::FromInt(JSArray::kSize)); in Generate()
3894 __ CallRuntime(Runtime::kAllocateInNewSpace); in Generate()
3896 __ jmp(&done_allocate); in Generate()
3899 __ bind(&rest_parameters); in Generate()
3902 __ lea(ebx, in Generate()
3915 __ lea(ecx, Operand(eax, times_half_pointer_size, in Generate()
3917 __ Allocate(ecx, edx, edi, no_reg, &allocate, NO_ALLOCATION_FLAGS); in Generate()
3918 __ bind(&done_allocate); in Generate()
3921 __ mov(FieldOperand(edx, FixedArray::kMapOffset), in Generate()
3923 __ mov(FieldOperand(edx, FixedArray::kLengthOffset), eax); in Generate()
3926 __ Move(ecx, Smi::kZero); in Generate()
3927 __ bind(&loop); in Generate()
3928 __ cmp(ecx, eax); in Generate()
3929 __ j(equal, &done_loop, Label::kNear); in Generate()
3930 __ mov(edi, Operand(ebx, 0 * kPointerSize)); in Generate()
3931 __ mov(FieldOperand(edx, ecx, times_half_pointer_size, in Generate()
3934 __ sub(ebx, Immediate(1 * kPointerSize)); in Generate()
3935 __ add(ecx, Immediate(Smi::FromInt(1))); in Generate()
3936 __ jmp(&loop); in Generate()
3937 __ bind(&done_loop); in Generate()
3941 __ lea(edi, in Generate()
3943 __ LoadGlobalFunction(Context::JS_ARRAY_FAST_ELEMENTS_MAP_INDEX, ecx); in Generate()
3944 __ mov(FieldOperand(edi, JSArray::kMapOffset), ecx); in Generate()
3945 __ mov(FieldOperand(edi, JSArray::kPropertiesOffset), in Generate()
3947 __ mov(FieldOperand(edi, JSArray::kElementsOffset), edx); in Generate()
3948 __ mov(FieldOperand(edi, JSArray::kLengthOffset), eax); in Generate()
3950 __ mov(eax, edi); in Generate()
3951 __ Ret(); in Generate()
3955 __ bind(&allocate); in Generate()
3956 __ cmp(ecx, Immediate(kMaxRegularHeapObjectSize)); in Generate()
3957 __ j(greater, &too_big_for_new_space); in Generate()
3960 __ SmiTag(ecx); in Generate()
3961 __ Push(eax); in Generate()
3962 __ Push(ebx); in Generate()
3963 __ Push(ecx); in Generate()
3964 __ CallRuntime(Runtime::kAllocateInNewSpace); in Generate()
3965 __ mov(edx, eax); in Generate()
3966 __ Pop(ebx); in Generate()
3967 __ Pop(eax); in Generate()
3969 __ jmp(&done_allocate); in Generate()
3972 __ bind(&too_big_for_new_space); in Generate()
3973 __ PopReturnAddressTo(ecx); in Generate()
3979 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); in Generate()
3980 __ Push(Operand(edx, StandardFrameConstants::kFunctionOffset)); in Generate()
3982 __ Push(Operand(ebp, StandardFrameConstants::kFunctionOffset)); in Generate()
3984 __ PushReturnAddressFrom(ecx); in Generate()
3985 __ TailCallRuntime(Runtime::kNewRestParameter); in Generate()
3997 __ AssertFunction(edi); in Generate()
4000 __ mov(ecx, ebp); in Generate()
4004 __ mov(ecx, Operand(ecx, StandardFrameConstants::kCallerFPOffset)); in Generate()
4008 __ cmp(edi, Operand(ecx, StandardFrameConstants::kFunctionOffset)); in Generate()
4009 __ j(equal, &ok); in Generate()
4010 __ Abort(kInvalidFrameForFastNewSloppyArgumentsStub); in Generate()
4011 __ bind(&ok); in Generate()
4015 __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); in Generate()
4016 __ mov(ebx, in Generate()
4018 __ lea(edx, Operand(ecx, ebx, times_half_pointer_size, in Generate()
4029 __ mov(eax, Operand(ecx, StandardFrameConstants::kCallerFPOffset)); in Generate()
4030 __ mov(eax, Operand(eax, CommonFrameConstants::kContextOrFrameTypeOffset)); in Generate()
4031 __ cmp(eax, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); in Generate()
4032 __ j(equal, &adaptor_frame, Label::kNear); in Generate()
4035 __ mov(ecx, ebx); in Generate()
4036 __ push(ebx); in Generate()
4037 __ jmp(&try_allocate, Label::kNear); in Generate()
4040 __ bind(&adaptor_frame); in Generate()
4041 __ push(ebx); in Generate()
4042 __ mov(edx, Operand(ecx, StandardFrameConstants::kCallerFPOffset)); in Generate()
4043 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); in Generate()
4044 __ lea(edx, Operand(edx, ecx, times_2, in Generate()
4050 __ cmp(ebx, ecx); in Generate()
4051 __ j(less_equal, &try_allocate, Label::kNear); in Generate()
4052 __ mov(ebx, ecx); in Generate()
4055 __ bind(&try_allocate); in Generate()
4056 __ push(edi); in Generate()
4057 __ push(ebx); in Generate()
4064 __ test(ebx, ebx); in Generate()
4065 __ j(zero, &no_parameter_map, Label::kNear); in Generate()
4066 __ lea(ebx, Operand(ebx, times_2, kParameterMapHeaderSize)); in Generate()
4067 __ bind(&no_parameter_map); in Generate()
4070 __ lea(ebx, Operand(ebx, ecx, times_2, FixedArray::kHeaderSize)); in Generate()
4073 __ add(ebx, Immediate(JSSloppyArgumentsObject::kSize)); in Generate()
4076 __ Allocate(ebx, eax, edi, no_reg, &runtime, NO_ALLOCATION_FLAGS); in Generate()
4085 __ mov(edi, NativeContextOperand()); in Generate()
4086 __ mov(ebx, Operand(esp, 0 * kPointerSize)); in Generate()
4087 __ test(ebx, ebx); in Generate()
4088 __ j(not_zero, &has_mapped_parameters, Label::kNear); in Generate()
4089 __ mov( in Generate()
4092 __ jmp(&instantiate, Label::kNear); in Generate()
4094 __ bind(&has_mapped_parameters); in Generate()
4095 __ mov(edi, Operand(edi, Context::SlotOffset( in Generate()
4097 __ bind(&instantiate); in Generate()
4107 __ mov(FieldOperand(eax, JSObject::kMapOffset), edi); in Generate()
4108 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), in Generate()
4110 __ mov(FieldOperand(eax, JSObject::kElementsOffset), in Generate()
4115 __ mov(edi, Operand(esp, 1 * kPointerSize)); in Generate()
4116 __ AssertNotSmi(edi); in Generate()
4117 __ mov(FieldOperand(eax, JSSloppyArgumentsObject::kCalleeOffset), edi); in Generate()
4120 __ AssertSmi(ecx); in Generate()
4121 __ mov(FieldOperand(eax, JSSloppyArgumentsObject::kLengthOffset), ecx); in Generate()
4126 __ lea(edi, Operand(eax, JSSloppyArgumentsObject::kSize)); in Generate()
4127 __ mov(FieldOperand(eax, JSObject::kElementsOffset), edi); in Generate()
4138 __ push(edx); in Generate()
4139 __ push(eax); in Generate()
4143 __ test(ebx, ebx); in Generate()
4144 __ j(zero, &skip_parameter_map); in Generate()
4146 __ mov(FieldOperand(edi, FixedArray::kMapOffset), in Generate()
4148 __ lea(eax, Operand(ebx, reinterpret_cast<intptr_t>(Smi::FromInt(2)))); in Generate()
4149 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), eax); in Generate()
4150 __ mov(FieldOperand(edi, FixedArray::kHeaderSize + 0 * kPointerSize), esi); in Generate()
4151 __ lea(eax, Operand(edi, ebx, times_2, kParameterMapHeaderSize)); in Generate()
4152 __ mov(FieldOperand(edi, FixedArray::kHeaderSize + 1 * kPointerSize), eax); in Generate()
4163 __ push(ecx); in Generate()
4164 __ mov(eax, Operand(esp, 3 * kPointerSize)); in Generate()
4165 __ mov(ebx, Immediate(Smi::FromInt(Context::MIN_CONTEXT_SLOTS))); in Generate()
4166 __ add(ebx, Operand(esp, 5 * kPointerSize)); in Generate()
4167 __ sub(ebx, eax); in Generate()
4168 __ mov(ecx, isolate()->factory()->the_hole_value()); in Generate()
4169 __ mov(edx, edi); in Generate()
4170 __ lea(edi, Operand(edi, eax, times_2, kParameterMapHeaderSize)); in Generate()
4182 __ jmp(¶meters_test, Label::kNear); in Generate()
4184 __ bind(¶meters_loop); in Generate()
4185 __ sub(eax, Immediate(Smi::FromInt(1))); in Generate()
4186 __ mov(FieldOperand(edx, eax, times_2, kParameterMapHeaderSize), ebx); in Generate()
4187 __ mov(FieldOperand(edi, eax, times_2, FixedArray::kHeaderSize), ecx); in Generate()
4188 __ add(ebx, Immediate(Smi::FromInt(1))); in Generate()
4189 __ bind(¶meters_test); in Generate()
4190 __ test(eax, eax); in Generate()
4191 __ j(not_zero, ¶meters_loop, Label::kNear); in Generate()
4192 __ pop(ecx); in Generate()
4194 __ bind(&skip_parameter_map); in Generate()
4204 __ mov(FieldOperand(edi, FixedArray::kMapOffset), in Generate()
4206 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), ecx); in Generate()
4209 __ mov(ebx, Operand(esp, 2 * kPointerSize)); in Generate()
4210 __ mov(edx, Operand(esp, 1 * kPointerSize)); in Generate()
4211 __ sub(edx, ebx); // Is there a smarter way to do negative scaling? in Generate()
4212 __ sub(edx, ebx); in Generate()
4213 __ jmp(&arguments_test, Label::kNear); in Generate()
4215 __ bind(&arguments_loop); in Generate()
4216 __ sub(edx, Immediate(kPointerSize)); in Generate()
4217 __ mov(eax, Operand(edx, 0)); in Generate()
4218 __ mov(FieldOperand(edi, ebx, times_2, FixedArray::kHeaderSize), eax); in Generate()
4219 __ add(ebx, Immediate(Smi::FromInt(1))); in Generate()
4221 __ bind(&arguments_test); in Generate()
4222 __ cmp(ebx, ecx); in Generate()
4223 __ j(less, &arguments_loop, Label::kNear); in Generate()
4226 __ pop(eax); // Address of arguments object. in Generate()
4227 __ Drop(4); in Generate()
4230 __ ret(0); in Generate()
4233 __ bind(&runtime); in Generate()
4234 __ pop(eax); // Remove saved mapped parameter count. in Generate()
4235 __ pop(edi); // Pop saved function. in Generate()
4236 __ pop(eax); // Remove saved parameter count. in Generate()
4237 __ pop(eax); // Pop return address. in Generate()
4238 __ push(edi); // Push function. in Generate()
4239 __ push(edx); // Push parameters pointer. in Generate()
4240 __ push(ecx); // Push parameter count. in Generate()
4241 __ push(eax); // Push return address. in Generate()
4242 __ TailCallRuntime(Runtime::kNewSloppyArguments); in Generate()
4253 __ AssertFunction(edi); in Generate()
4256 __ mov(edx, ebp); in Generate()
4260 __ mov(edx, Operand(edx, StandardFrameConstants::kCallerFPOffset)); in Generate()
4264 __ cmp(edi, Operand(edx, StandardFrameConstants::kFunctionOffset)); in Generate()
4265 __ j(equal, &ok); in Generate()
4266 __ Abort(kInvalidFrameForFastNewStrictArgumentsStub); in Generate()
4267 __ bind(&ok); in Generate()
4272 __ mov(ebx, Operand(edx, StandardFrameConstants::kCallerFPOffset)); in Generate()
4273 __ cmp(Operand(ebx, CommonFrameConstants::kContextOrFrameTypeOffset), in Generate()
4275 __ j(equal, &arguments_adaptor, Label::kNear); in Generate()
4277 __ mov(eax, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); in Generate()
4278 __ mov(eax, in Generate()
4280 __ lea(ebx, in Generate()
4284 __ jmp(&arguments_done, Label::kNear); in Generate()
4285 __ bind(&arguments_adaptor); in Generate()
4287 __ mov(eax, Operand(ebx, ArgumentsAdaptorFrameConstants::kLengthOffset)); in Generate()
4288 __ lea(ebx, in Generate()
4292 __ bind(&arguments_done); in Generate()
4303 __ lea(ecx, in Generate()
4306 __ Allocate(ecx, edx, edi, no_reg, &allocate, NO_ALLOCATION_FLAGS); in Generate()
4307 __ bind(&done_allocate); in Generate()
4310 __ mov(FieldOperand(edx, FixedArray::kMapOffset), in Generate()
4312 __ mov(FieldOperand(edx, FixedArray::kLengthOffset), eax); in Generate()
4315 __ Move(ecx, Smi::kZero); in Generate()
4316 __ bind(&loop); in Generate()
4317 __ cmp(ecx, eax); in Generate()
4318 __ j(equal, &done_loop, Label::kNear); in Generate()
4319 __ mov(edi, Operand(ebx, 0 * kPointerSize)); in Generate()
4320 __ mov(FieldOperand(edx, ecx, times_half_pointer_size, in Generate()
4323 __ sub(ebx, Immediate(1 * kPointerSize)); in Generate()
4324 __ add(ecx, Immediate(Smi::FromInt(1))); in Generate()
4325 __ jmp(&loop); in Generate()
4326 __ bind(&done_loop); in Generate()
4330 __ lea(edi, in Generate()
4332 __ LoadGlobalFunction(Context::STRICT_ARGUMENTS_MAP_INDEX, ecx); in Generate()
4333 __ mov(FieldOperand(edi, JSStrictArgumentsObject::kMapOffset), ecx); in Generate()
4334 __ mov(FieldOperand(edi, JSStrictArgumentsObject::kPropertiesOffset), in Generate()
4336 __ mov(FieldOperand(edi, JSStrictArgumentsObject::kElementsOffset), edx); in Generate()
4337 __ mov(FieldOperand(edi, JSStrictArgumentsObject::kLengthOffset), eax); in Generate()
4339 __ mov(eax, edi); in Generate()
4340 __ Ret(); in Generate()
4344 __ bind(&allocate); in Generate()
4345 __ cmp(ecx, Immediate(kMaxRegularHeapObjectSize)); in Generate()
4346 __ j(greater, &too_big_for_new_space); in Generate()
4349 __ SmiTag(ecx); in Generate()
4350 __ Push(eax); in Generate()
4351 __ Push(ebx); in Generate()
4352 __ Push(ecx); in Generate()
4353 __ CallRuntime(Runtime::kAllocateInNewSpace); in Generate()
4354 __ mov(edx, eax); in Generate()
4355 __ Pop(ebx); in Generate()
4356 __ Pop(eax); in Generate()
4358 __ jmp(&done_allocate); in Generate()
4361 __ bind(&too_big_for_new_space); in Generate()
4362 __ PopReturnAddressTo(ecx); in Generate()
4368 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); in Generate()
4369 __ Push(Operand(edx, StandardFrameConstants::kFunctionOffset)); in Generate()
4371 __ Push(Operand(ebp, StandardFrameConstants::kFunctionOffset)); in Generate()
4373 __ PushReturnAddressFrom(ecx); in Generate()
4374 __ TailCallRuntime(Runtime::kNewStrictArguments); in Generate()
4390 __ EnterApiExitFrame(argc); in PrepareCallApiFunction()
4391 if (__ emit_debug_code()) { in PrepareCallApiFunction()
4392 __ mov(esi, Immediate(bit_cast<int32_t>(kZapValue))); in PrepareCallApiFunction()
4419 __ mov(ebx, Operand::StaticVariable(next_address)); in CallApiFunctionAndReturn()
4420 __ mov(edi, Operand::StaticVariable(limit_address)); in CallApiFunctionAndReturn()
4421 __ add(Operand::StaticVariable(level_address), Immediate(1)); in CallApiFunctionAndReturn()
4425 __ PushSafepointRegisters(); in CallApiFunctionAndReturn()
4426 __ PrepareCallCFunction(1, eax); in CallApiFunctionAndReturn()
4427 __ mov(Operand(esp, 0), in CallApiFunctionAndReturn()
4429 __ CallCFunction(ExternalReference::log_enter_external_function(isolate), in CallApiFunctionAndReturn()
4431 __ PopSafepointRegisters(); in CallApiFunctionAndReturn()
4437 __ mov(eax, Immediate(ExternalReference::is_profiling_address(isolate))); in CallApiFunctionAndReturn()
4438 __ cmpb(Operand(eax, 0), Immediate(0)); in CallApiFunctionAndReturn()
4439 __ j(zero, &profiler_disabled); in CallApiFunctionAndReturn()
4442 __ mov(thunk_last_arg, function_address); in CallApiFunctionAndReturn()
4444 __ mov(eax, Immediate(thunk_ref)); in CallApiFunctionAndReturn()
4445 __ call(eax); in CallApiFunctionAndReturn()
4446 __ jmp(&end_profiler_check); in CallApiFunctionAndReturn()
4448 __ bind(&profiler_disabled); in CallApiFunctionAndReturn()
4450 __ call(function_address); in CallApiFunctionAndReturn()
4451 __ bind(&end_profiler_check); in CallApiFunctionAndReturn()
4455 __ PushSafepointRegisters(); in CallApiFunctionAndReturn()
4456 __ PrepareCallCFunction(1, eax); in CallApiFunctionAndReturn()
4457 __ mov(Operand(esp, 0), in CallApiFunctionAndReturn()
4459 __ CallCFunction(ExternalReference::log_leave_external_function(isolate), in CallApiFunctionAndReturn()
4461 __ PopSafepointRegisters(); in CallApiFunctionAndReturn()
4466 __ mov(eax, return_value_operand); in CallApiFunctionAndReturn()
4472 __ bind(&prologue); in CallApiFunctionAndReturn()
4475 __ mov(Operand::StaticVariable(next_address), ebx); in CallApiFunctionAndReturn()
4476 __ sub(Operand::StaticVariable(level_address), Immediate(1)); in CallApiFunctionAndReturn()
4477 __ Assert(above_equal, kInvalidHandleScopeLevel); in CallApiFunctionAndReturn()
4478 __ cmp(edi, Operand::StaticVariable(limit_address)); in CallApiFunctionAndReturn()
4479 __ j(not_equal, &delete_allocated_handles); in CallApiFunctionAndReturn()
4482 __ bind(&leave_exit_frame); in CallApiFunctionAndReturn()
4485 __ mov(esi, *context_restore_operand); in CallApiFunctionAndReturn()
4488 __ mov(ebx, *stack_space_operand); in CallApiFunctionAndReturn()
4490 __ LeaveApiExitFrame(!restore_context); in CallApiFunctionAndReturn()
4495 __ cmp(Operand::StaticVariable(scheduled_exception_address), in CallApiFunctionAndReturn()
4497 __ j(not_equal, &promote_scheduled_exception); in CallApiFunctionAndReturn()
4505 __ JumpIfSmi(return_value, &ok, Label::kNear); in CallApiFunctionAndReturn()
4506 __ mov(map, FieldOperand(return_value, HeapObject::kMapOffset)); in CallApiFunctionAndReturn()
4508 __ CmpInstanceType(map, LAST_NAME_TYPE); in CallApiFunctionAndReturn()
4509 __ j(below_equal, &ok, Label::kNear); in CallApiFunctionAndReturn()
4511 __ CmpInstanceType(map, FIRST_JS_RECEIVER_TYPE); in CallApiFunctionAndReturn()
4512 __ j(above_equal, &ok, Label::kNear); in CallApiFunctionAndReturn()
4514 __ cmp(map, isolate->factory()->heap_number_map()); in CallApiFunctionAndReturn()
4515 __ j(equal, &ok, Label::kNear); in CallApiFunctionAndReturn()
4517 __ cmp(return_value, isolate->factory()->undefined_value()); in CallApiFunctionAndReturn()
4518 __ j(equal, &ok, Label::kNear); in CallApiFunctionAndReturn()
4520 __ cmp(return_value, isolate->factory()->true_value()); in CallApiFunctionAndReturn()
4521 __ j(equal, &ok, Label::kNear); in CallApiFunctionAndReturn()
4523 __ cmp(return_value, isolate->factory()->false_value()); in CallApiFunctionAndReturn()
4524 __ j(equal, &ok, Label::kNear); in CallApiFunctionAndReturn()
4526 __ cmp(return_value, isolate->factory()->null_value()); in CallApiFunctionAndReturn()
4527 __ j(equal, &ok, Label::kNear); in CallApiFunctionAndReturn()
4529 __ Abort(kAPICallReturnedInvalidObject); in CallApiFunctionAndReturn()
4531 __ bind(&ok); in CallApiFunctionAndReturn()
4536 __ pop(ecx); in CallApiFunctionAndReturn()
4537 __ add(esp, ebx); in CallApiFunctionAndReturn()
4538 __ jmp(ecx); in CallApiFunctionAndReturn()
4540 __ ret(stack_space * kPointerSize); in CallApiFunctionAndReturn()
4544 __ bind(&promote_scheduled_exception); in CallApiFunctionAndReturn()
4545 __ TailCallRuntime(Runtime::kPromoteScheduledException); in CallApiFunctionAndReturn()
4550 __ bind(&delete_allocated_handles); in CallApiFunctionAndReturn()
4551 __ mov(Operand::StaticVariable(limit_address), edi); in CallApiFunctionAndReturn()
4552 __ mov(edi, eax); in CallApiFunctionAndReturn()
4553 __ mov(Operand(esp, 0), in CallApiFunctionAndReturn()
4555 __ mov(eax, Immediate(delete_extensions)); in CallApiFunctionAndReturn()
4556 __ call(eax); in CallApiFunctionAndReturn()
4557 __ mov(eax, edi); in CallApiFunctionAndReturn()
4558 __ jmp(&leave_exit_frame); in CallApiFunctionAndReturn()
4595 __ pop(return_address); in Generate()
4598 __ PushRoot(Heap::kUndefinedValueRootIndex); in Generate()
4601 __ push(context); in Generate()
4604 __ push(callee); in Generate()
4607 __ push(call_data); in Generate()
4612 __ push(Immediate(masm->isolate()->factory()->undefined_value())); in Generate()
4614 __ push(Immediate(masm->isolate()->factory()->undefined_value())); in Generate()
4617 __ push(scratch); in Generate()
4619 __ push(scratch); in Generate()
4622 __ push(Immediate(reinterpret_cast<int>(masm->isolate()))); in Generate()
4624 __ push(holder); in Generate()
4626 __ mov(scratch, esp); in Generate()
4629 __ push(return_address); in Generate()
4633 __ mov(context, FieldOperand(callee, JSFunction::kContextOffset)); in Generate()
4649 __ mov(ApiParameterOperand(2), scratch); in Generate()
4650 __ add(scratch, Immediate((argc() + FCA::kArgsLength - 1) * kPointerSize)); in Generate()
4652 __ mov(ApiParameterOperand(3), scratch); in Generate()
4654 __ Move(ApiParameterOperand(4), Immediate(argc())); in Generate()
4657 __ lea(scratch, ApiParameterOperand(2)); in Generate()
4658 __ mov(ApiParameterOperand(0), scratch); in Generate()
4703 __ pop(scratch); // Pop return address to extend the frame. in Generate()
4704 __ push(receiver); in Generate()
4705 __ push(FieldOperand(callback, AccessorInfo::kDataOffset)); in Generate()
4706 __ PushRoot(Heap::kUndefinedValueRootIndex); // ReturnValue in Generate()
4708 __ PushRoot(Heap::kUndefinedValueRootIndex); in Generate()
4709 __ push(Immediate(ExternalReference::isolate_address(isolate()))); in Generate()
4710 __ push(holder); in Generate()
4711 __ push(Immediate(Smi::kZero)); // should_throw_on_error -> false in Generate()
4712 __ push(FieldOperand(callback, AccessorInfo::kNameOffset)); in Generate()
4713 __ push(scratch); // Restore return address. in Generate()
4724 __ lea(scratch, Operand(esp, 2 * kPointerSize)); in Generate()
4730 __ mov(info_object, scratch); in Generate()
4733 __ sub(scratch, Immediate(kPointerSize)); in Generate()
4734 __ mov(ApiParameterOperand(0), scratch); in Generate()
4736 __ lea(scratch, info_object); in Generate()
4737 __ mov(ApiParameterOperand(1), scratch); in Generate()
4744 __ mov(scratch, FieldOperand(callback, AccessorInfo::kJsGetterOffset)); in Generate()
4746 __ mov(function_address, in Generate()
4756 #undef __