Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 23480031: Enable preaging of code objects when --optimize-for-size. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: bool -> enum Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2646 matching lines...) Expand 10 before | Expand all | Expand 10 after
2657 #endif 2657 #endif
2658 } 2658 }
2659 2659
2660 2660
2661 void MacroAssembler::Call(Handle<Code> code_object, 2661 void MacroAssembler::Call(Handle<Code> code_object,
2662 RelocInfo::Mode rmode, 2662 RelocInfo::Mode rmode,
2663 TypeFeedbackId ast_id) { 2663 TypeFeedbackId ast_id) {
2664 #ifdef DEBUG 2664 #ifdef DEBUG
2665 int end_position = pc_offset() + CallSize(code_object); 2665 int end_position = pc_offset() + CallSize(code_object);
2666 #endif 2666 #endif
2667 ASSERT(RelocInfo::IsCodeTarget(rmode)); 2667 ASSERT(RelocInfo::IsCodeTarget(rmode) ||
2668 rmode == RelocInfo::CODE_AGE_SEQUENCE);
2668 call(code_object, rmode, ast_id); 2669 call(code_object, rmode, ast_id);
2669 #ifdef DEBUG 2670 #ifdef DEBUG
2670 CHECK_EQ(end_position, pc_offset()); 2671 CHECK_EQ(end_position, pc_offset());
2671 #endif 2672 #endif
2672 } 2673 }
2673 2674
2674 2675
2675 void MacroAssembler::Pushad() { 2676 void MacroAssembler::Pushad() {
2676 push(rax); 2677 push(rax);
2677 push(rcx); 2678 push(rcx);
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
3671 } 3672 }
3672 } else { 3673 } else {
3673 SetCallKind(rcx, call_kind); 3674 SetCallKind(rcx, call_kind);
3674 Jump(adaptor, RelocInfo::CODE_TARGET); 3675 Jump(adaptor, RelocInfo::CODE_TARGET);
3675 } 3676 }
3676 bind(&invoke); 3677 bind(&invoke);
3677 } 3678 }
3678 } 3679 }
3679 3680
3680 3681
3682 void MacroAssembler::Prologue(PrologueFrameMode frame_mode) {
3683 if (frame_mode == BUILD_STUB_FRAME) {
3684 push(rbp); // Caller's frame pointer.
3685 movq(rbp, rsp);
3686 push(rsi); // Callee's context.
3687 Push(Smi::FromInt(StackFrame::STUB));
3688 } else {
3689 PredictableCodeSizeScope predictible_code_size_scope(this,
3690 kNoCodeAgeSequenceLength);
3691 if (FLAG_optimize_for_size && FLAG_age_code) {
3692 // Pre-age the code.
3693 Call(isolate()->builtins()->MarkCodeAsExecutedOnce(),
3694 RelocInfo::CODE_AGE_SEQUENCE);
3695 Nop(kNoCodeAgeSequenceLength - Assembler::kShortCallInstructionLength);
3696 } else {
3697 push(rbp); // Caller's frame pointer.
3698 movq(rbp, rsp);
3699 push(rsi); // Callee's context.
3700 push(rdi); // Callee's JS function.
3701 }
3702 }
3703 }
3704
3705
3681 void MacroAssembler::EnterFrame(StackFrame::Type type) { 3706 void MacroAssembler::EnterFrame(StackFrame::Type type) {
3682 push(rbp); 3707 push(rbp);
3683 movq(rbp, rsp); 3708 movq(rbp, rsp);
3684 push(rsi); // Context. 3709 push(rsi); // Context.
3685 Push(Smi::FromInt(type)); 3710 Push(Smi::FromInt(type));
3686 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT); 3711 movq(kScratchRegister, CodeObject(), RelocInfo::EMBEDDED_OBJECT);
3687 push(kScratchRegister); 3712 push(kScratchRegister);
3688 if (emit_debug_code()) { 3713 if (emit_debug_code()) {
3689 movq(kScratchRegister, 3714 movq(kScratchRegister,
3690 isolate()->factory()->undefined_value(), 3715 isolate()->factory()->undefined_value(),
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
4968 movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE); 4993 movq(arg_reg_1, isolate, RelocInfo::EXTERNAL_REFERENCE);
4969 CallCFunction( 4994 CallCFunction(
4970 ExternalReference::record_object_allocation_function(isolate), 3); 4995 ExternalReference::record_object_allocation_function(isolate), 3);
4971 PopSafepointRegisters(); 4996 PopSafepointRegisters();
4972 } 4997 }
4973 4998
4974 4999
4975 } } // namespace v8::internal 5000 } } // namespace v8::internal
4976 5001
4977 #endif // V8_TARGET_ARCH_X64 5002 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698