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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 11550005: Elide unnecessary context reload in generated stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merge with ToT Created 8 years 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
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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 deoptimizations_.Add(environment, zone()); 797 deoptimizations_.Add(environment, zone());
798 } 798 }
799 } 799 }
800 800
801 801
802 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) { 802 void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
803 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 803 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
804 ASSERT(environment->HasBeenRegistered()); 804 ASSERT(environment->HasBeenRegistered());
805 int id = environment->deoptimization_index(); 805 int id = environment->deoptimization_index();
806 ASSERT(info()->IsOptimizing() || info()->IsStub()); 806 ASSERT(info()->IsOptimizing() || info()->IsStub());
807 Deoptimizer::BailoutType bailout_type = frame_is_built_ 807 Deoptimizer::BailoutType bailout_type = info()->IsOptimizing()
ulan 2012/12/28 15:40:49 Maybe negate this and use info()->IsStub() to make
danno 2012/12/28 17:38:41 Done.
808 ? Deoptimizer::EAGER 808 ? Deoptimizer::EAGER
809 : Deoptimizer::LAZY; 809 : Deoptimizer::LAZY;
810 Address entry = Deoptimizer::GetDeoptimizationEntry(id, bailout_type); 810 Address entry = Deoptimizer::GetDeoptimizationEntry(id, bailout_type);
811 if (entry == NULL) { 811 if (entry == NULL) {
812 Abort("bailout was not prepared"); 812 Abort("bailout was not prepared");
813 return; 813 return;
814 } 814 }
815 815
816 if (FLAG_deopt_every_n_times != 0) { 816 if (FLAG_deopt_every_n_times != 0) {
817 Handle<SharedFunctionInfo> shared(info_->shared_info()); 817 Handle<SharedFunctionInfo> shared(info_->shared_info());
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after
2633 __ j(equal, &no_padding); 2633 __ j(equal, &no_padding);
2634 if (FLAG_debug_code) { 2634 if (FLAG_debug_code) {
2635 __ cmp(Operand(esp, (GetParameterCount() + 2) * kPointerSize), 2635 __ cmp(Operand(esp, (GetParameterCount() + 2) * kPointerSize),
2636 Immediate(kAlignmentZapValue)); 2636 Immediate(kAlignmentZapValue));
2637 __ Assert(equal, "expected alignment marker"); 2637 __ Assert(equal, "expected alignment marker");
2638 } 2638 }
2639 __ Ret((GetParameterCount() + 2) * kPointerSize, ecx); 2639 __ Ret((GetParameterCount() + 2) * kPointerSize, ecx);
2640 __ bind(&no_padding); 2640 __ bind(&no_padding);
2641 } 2641 }
2642 if (info()->IsStub()) { 2642 if (info()->IsStub()) {
2643 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2644 __ Ret(); 2643 __ Ret();
2645 } else { 2644 } else {
2646 __ Ret((GetParameterCount() + 1) * kPointerSize, ecx); 2645 __ Ret((GetParameterCount() + 1) * kPointerSize, ecx);
2647 } 2646 }
2648 } 2647 }
2649 2648
2650 2649
2651 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { 2650 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2652 Register result = ToRegister(instr->result()); 2651 Register result = ToRegister(instr->result());
2653 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); 2652 __ mov(result, Operand::Cell(instr->hydrogen()->cell()));
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
3368 3367
3369 3368
3370 void LCodeGen::DoThisFunction(LThisFunction* instr) { 3369 void LCodeGen::DoThisFunction(LThisFunction* instr) {
3371 Register result = ToRegister(instr->result()); 3370 Register result = ToRegister(instr->result());
3372 __ mov(result, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 3371 __ mov(result, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
3373 } 3372 }
3374 3373
3375 3374
3376 void LCodeGen::DoContext(LContext* instr) { 3375 void LCodeGen::DoContext(LContext* instr) {
3377 Register result = ToRegister(instr->result()); 3376 Register result = ToRegister(instr->result());
3378 __ mov(result, Operand(ebp, StandardFrameConstants::kContextOffset)); 3377 if (info()->IsOptimizing()) {
3378 __ mov(result, Operand(ebp, StandardFrameConstants::kContextOffset));
3379 } else {
3380 // If there is no frame, the context must be in esi.
3381 ASSERT(result.is(esi));
3382 }
3379 } 3383 }
3380 3384
3381 3385
3382 void LCodeGen::DoOuterContext(LOuterContext* instr) { 3386 void LCodeGen::DoOuterContext(LOuterContext* instr) {
3383 Register context = ToRegister(instr->context()); 3387 Register context = ToRegister(instr->context());
3384 Register result = ToRegister(instr->result()); 3388 Register result = ToRegister(instr->result());
3385 __ mov(result, 3389 __ mov(result,
3386 Operand(context, Context::SlotOffset(Context::PREVIOUS_INDEX))); 3390 Operand(context, Context::SlotOffset(Context::PREVIOUS_INDEX)));
3387 } 3391 }
3388 3392
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after
5930 FixedArray::kHeaderSize - kPointerSize)); 5934 FixedArray::kHeaderSize - kPointerSize));
5931 __ bind(&done); 5935 __ bind(&done);
5932 } 5936 }
5933 5937
5934 5938
5935 #undef __ 5939 #undef __
5936 5940
5937 } } // namespace v8::internal 5941 } } // namespace v8::internal
5938 5942
5939 #endif // V8_TARGET_ARCH_IA32 5943 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698