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

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: Review feedback Created 7 years, 11 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/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.h » ('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 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()->IsStub()
808 ? Deoptimizer::EAGER 808 ? Deoptimizer::LAZY
809 : Deoptimizer::LAZY; 809 : Deoptimizer::EAGER;
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());
818 Label no_deopt; 818 Label no_deopt;
819 __ pushfd(); 819 __ pushfd();
(...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after
2644 __ j(equal, &no_padding); 2644 __ j(equal, &no_padding);
2645 if (FLAG_debug_code) { 2645 if (FLAG_debug_code) {
2646 __ cmp(Operand(esp, (GetParameterCount() + 2) * kPointerSize), 2646 __ cmp(Operand(esp, (GetParameterCount() + 2) * kPointerSize),
2647 Immediate(kAlignmentZapValue)); 2647 Immediate(kAlignmentZapValue));
2648 __ Assert(equal, "expected alignment marker"); 2648 __ Assert(equal, "expected alignment marker");
2649 } 2649 }
2650 __ Ret((GetParameterCount() + 2) * kPointerSize, ecx); 2650 __ Ret((GetParameterCount() + 2) * kPointerSize, ecx);
2651 __ bind(&no_padding); 2651 __ bind(&no_padding);
2652 } 2652 }
2653 if (info()->IsStub()) { 2653 if (info()->IsStub()) {
2654 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2655 __ Ret(); 2654 __ Ret();
2656 } else { 2655 } else {
2657 __ Ret((GetParameterCount() + 1) * kPointerSize, ecx); 2656 __ Ret((GetParameterCount() + 1) * kPointerSize, ecx);
2658 } 2657 }
2659 } 2658 }
2660 2659
2661 2660
2662 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { 2661 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2663 Register result = ToRegister(instr->result()); 2662 Register result = ToRegister(instr->result());
2664 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); 2663 __ mov(result, Operand::Cell(instr->hydrogen()->cell()));
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
3379 3378
3380 3379
3381 void LCodeGen::DoThisFunction(LThisFunction* instr) { 3380 void LCodeGen::DoThisFunction(LThisFunction* instr) {
3382 Register result = ToRegister(instr->result()); 3381 Register result = ToRegister(instr->result());
3383 __ mov(result, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 3382 __ mov(result, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
3384 } 3383 }
3385 3384
3386 3385
3387 void LCodeGen::DoContext(LContext* instr) { 3386 void LCodeGen::DoContext(LContext* instr) {
3388 Register result = ToRegister(instr->result()); 3387 Register result = ToRegister(instr->result());
3389 __ mov(result, Operand(ebp, StandardFrameConstants::kContextOffset)); 3388 if (info()->IsOptimizing()) {
3389 __ mov(result, Operand(ebp, StandardFrameConstants::kContextOffset));
3390 } else {
3391 // If there is no frame, the context must be in esi.
3392 ASSERT(result.is(esi));
3393 }
3390 } 3394 }
3391 3395
3392 3396
3393 void LCodeGen::DoOuterContext(LOuterContext* instr) { 3397 void LCodeGen::DoOuterContext(LOuterContext* instr) {
3394 Register context = ToRegister(instr->context()); 3398 Register context = ToRegister(instr->context());
3395 Register result = ToRegister(instr->result()); 3399 Register result = ToRegister(instr->result());
3396 __ mov(result, 3400 __ mov(result,
3397 Operand(context, Context::SlotOffset(Context::PREVIOUS_INDEX))); 3401 Operand(context, Context::SlotOffset(Context::PREVIOUS_INDEX)));
3398 } 3402 }
3399 3403
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after
5941 FixedArray::kHeaderSize - kPointerSize)); 5945 FixedArray::kHeaderSize - kPointerSize));
5942 __ bind(&done); 5946 __ bind(&done);
5943 } 5947 }
5944 5948
5945 5949
5946 #undef __ 5950 #undef __
5947 5951
5948 } } // namespace v8::internal 5952 } } // namespace v8::internal
5949 5953
5950 #endif // V8_TARGET_ARCH_IA32 5954 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698