Revision f230a1cf deps/v8/src/ia32/builtins-ia32.cc
deps/v8/src/ia32/builtins-ia32.cc | ||
---|---|---|
539 | 539 |
__ mov(eax, Operand(esp, 8 * kPointerSize)); |
540 | 540 |
{ |
541 | 541 |
FrameScope scope(masm, StackFrame::MANUAL); |
542 |
__ PrepareCallCFunction(1, ebx); |
|
542 |
__ PrepareCallCFunction(2, ebx); |
|
543 |
__ mov(Operand(esp, 1 * kPointerSize), |
|
544 |
Immediate(ExternalReference::isolate_address(masm->isolate()))); |
|
543 | 545 |
__ mov(Operand(esp, 0), eax); |
544 | 546 |
__ CallCFunction( |
545 |
ExternalReference::get_make_code_young_function(masm->isolate()), 1);
|
|
547 |
ExternalReference::get_make_code_young_function(masm->isolate()), 2);
|
|
546 | 548 |
} |
547 | 549 |
__ popad(); |
548 | 550 |
__ ret(0); |
... | ... | |
561 | 563 |
#undef DEFINE_CODE_AGE_BUILTIN_GENERATOR |
562 | 564 |
|
563 | 565 |
|
566 |
void Builtins::Generate_MarkCodeAsExecutedOnce(MacroAssembler* masm) { |
|
567 |
// For now, as in GenerateMakeCodeYoungAgainCommon, we are relying on the fact |
|
568 |
// that make_code_young doesn't do any garbage collection which allows us to |
|
569 |
// save/restore the registers without worrying about which of them contain |
|
570 |
// pointers. |
|
571 |
__ pushad(); |
|
572 |
__ mov(eax, Operand(esp, 8 * kPointerSize)); |
|
573 |
__ sub(eax, Immediate(Assembler::kCallInstructionLength)); |
|
574 |
{ // NOLINT |
|
575 |
FrameScope scope(masm, StackFrame::MANUAL); |
|
576 |
__ PrepareCallCFunction(2, ebx); |
|
577 |
__ mov(Operand(esp, 1 * kPointerSize), |
|
578 |
Immediate(ExternalReference::isolate_address(masm->isolate()))); |
|
579 |
__ mov(Operand(esp, 0), eax); |
|
580 |
__ CallCFunction( |
|
581 |
ExternalReference::get_mark_code_as_executed_function(masm->isolate()), |
|
582 |
2); |
|
583 |
} |
|
584 |
__ popad(); |
|
585 |
|
|
586 |
// Perform prologue operations usually performed by the young code stub. |
|
587 |
__ pop(eax); // Pop return address into scratch register. |
|
588 |
__ push(ebp); // Caller's frame pointer. |
|
589 |
__ mov(ebp, esp); |
|
590 |
__ push(esi); // Callee's context. |
|
591 |
__ push(edi); // Callee's JS Function. |
|
592 |
__ push(eax); // Push return address after frame prologue. |
|
593 |
|
|
594 |
// Jump to point after the code-age stub. |
|
595 |
__ ret(0); |
|
596 |
} |
|
597 |
|
|
598 |
|
|
599 |
void Builtins::Generate_MarkCodeAsExecutedTwice(MacroAssembler* masm) { |
|
600 |
GenerateMakeCodeYoungAgainCommon(masm); |
|
601 |
} |
|
602 |
|
|
603 |
|
|
564 | 604 |
void Builtins::Generate_NotifyStubFailure(MacroAssembler* masm) { |
565 | 605 |
// Enter an internal frame. |
566 | 606 |
{ |
... | ... | |
628 | 668 |
} |
629 | 669 |
|
630 | 670 |
|
631 |
void Builtins::Generate_NotifyOSR(MacroAssembler* masm) { |
|
632 |
// TODO(kasperl): Do we need to save/restore the XMM registers too? |
|
633 |
// TODO(mvstanton): We should save these regs, do this in a future |
|
634 |
// checkin. |
|
635 |
|
|
636 |
// For now, we are relying on the fact that Runtime::NotifyOSR |
|
637 |
// doesn't do any garbage collection which allows us to save/restore |
|
638 |
// the registers without worrying about which of them contain |
|
639 |
// pointers. This seems a bit fragile. |
|
640 |
__ pushad(); |
|
641 |
{ |
|
642 |
FrameScope scope(masm, StackFrame::INTERNAL); |
|
643 |
__ CallRuntime(Runtime::kNotifyOSR, 0); |
|
644 |
} |
|
645 |
__ popad(); |
|
646 |
__ ret(0); |
|
647 |
} |
|
648 |
|
|
649 |
|
|
650 | 671 |
void Builtins::Generate_FunctionCall(MacroAssembler* masm) { |
651 | 672 |
Factory* factory = masm->isolate()->factory(); |
652 | 673 |
|
... | ... | |
1063 | 1084 |
|
1064 | 1085 |
// Lookup the argument in the number to string cache. |
1065 | 1086 |
Label not_cached, argument_is_string; |
1066 |
NumberToStringStub::GenerateLookupNumberStringCache( |
|
1067 |
masm, |
|
1068 |
eax, // Input. |
|
1069 |
ebx, // Result. |
|
1070 |
ecx, // Scratch 1. |
|
1071 |
edx, // Scratch 2. |
|
1072 |
¬_cached); |
|
1087 |
__ LookupNumberStringCache(eax, // Input. |
|
1088 |
ebx, // Result. |
|
1089 |
ecx, // Scratch 1. |
|
1090 |
edx, // Scratch 2. |
|
1091 |
¬_cached); |
|
1073 | 1092 |
__ IncrementCounter(counters->string_ctor_cached_number(), 1); |
1074 | 1093 |
__ bind(&argument_is_string); |
1075 | 1094 |
// ----------- S t a t e ------------- |
... | ... | |
1326 | 1345 |
} |
1327 | 1346 |
|
1328 | 1347 |
|
1348 |
void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) { |
|
1349 |
// We check the stack limit as indicator that recompilation might be done. |
|
1350 |
Label ok; |
|
1351 |
ExternalReference stack_limit = |
|
1352 |
ExternalReference::address_of_stack_limit(masm->isolate()); |
|
1353 |
__ cmp(esp, Operand::StaticVariable(stack_limit)); |
|
1354 |
__ j(above_equal, &ok, Label::kNear); |
|
1355 |
{ |
|
1356 |
FrameScope scope(masm, StackFrame::INTERNAL); |
|
1357 |
__ CallRuntime(Runtime::kStackGuard, 0); |
|
1358 |
} |
|
1359 |
__ jmp(masm->isolate()->builtins()->OnStackReplacement(), |
|
1360 |
RelocInfo::CODE_TARGET); |
|
1361 |
|
|
1362 |
__ bind(&ok); |
|
1363 |
__ ret(0); |
|
1364 |
} |
|
1365 |
|
|
1329 | 1366 |
#undef __ |
1330 | 1367 |
} |
1331 | 1368 |
} // namespace v8::internal |
Also available in: Unified diff