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

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

Issue 10035021: Reduce size of LIR instruction by one word and remove dead code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 8 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/mips/lithium-mips.cc ('k') | src/x64/lithium-x64.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 1998 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 // We are pushing three values on the stack but recording a 2009 // We are pushing three values on the stack but recording a
2010 // safepoint with two arguments because stub is going to 2010 // safepoint with two arguments because stub is going to
2011 // remove the third argument from the stack before jumping 2011 // remove the third argument from the stack before jumping
2012 // to instanceof builtin on the slow path. 2012 // to instanceof builtin on the slow path.
2013 CallCodeGeneric(stub.GetCode(), 2013 CallCodeGeneric(stub.GetCode(),
2014 RelocInfo::CODE_TARGET, 2014 RelocInfo::CODE_TARGET,
2015 instr, 2015 instr,
2016 RECORD_SAFEPOINT_WITH_REGISTERS, 2016 RECORD_SAFEPOINT_WITH_REGISTERS,
2017 2); 2017 2);
2018 ASSERT(delta == masm_->SizeOfCodeGeneratedSince(map_check)); 2018 ASSERT(delta == masm_->SizeOfCodeGeneratedSince(map_check));
2019 ASSERT(instr->HasDeoptimizationEnvironment()); 2019 LEnvironment* env = instr->GetDeferredLazyDeoptimizationEnvironment();
2020 LEnvironment* env = instr->deoptimization_environment();
2021 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index()); 2020 safepoints_.RecordLazyDeoptimizationIndex(env->deoptimization_index());
2022 // Move result to a register that survives the end of the 2021 // Move result to a register that survives the end of the
2023 // PushSafepointRegisterScope. 2022 // PushSafepointRegisterScope.
2024 __ movq(kScratchRegister, rax); 2023 __ movq(kScratchRegister, rax);
2025 } 2024 }
2026 __ testq(kScratchRegister, kScratchRegister); 2025 __ testq(kScratchRegister, kScratchRegister);
2027 Label load_false; 2026 Label load_false;
2028 Label done; 2027 Label done;
2029 __ j(not_zero, &load_false); 2028 __ j(not_zero, &load_false);
2030 __ LoadRoot(rax, Heap::kTrueValueRootIndex); 2029 __ LoadRoot(rax, Heap::kTrueValueRootIndex);
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
2619 // length is a small non-negative integer, due to the test above. 2618 // length is a small non-negative integer, due to the test above.
2620 __ testl(length, length); 2619 __ testl(length, length);
2621 __ j(zero, &invoke, Label::kNear); 2620 __ j(zero, &invoke, Label::kNear);
2622 __ bind(&loop); 2621 __ bind(&loop);
2623 __ push(Operand(elements, length, times_pointer_size, 1 * kPointerSize)); 2622 __ push(Operand(elements, length, times_pointer_size, 1 * kPointerSize));
2624 __ decl(length); 2623 __ decl(length);
2625 __ j(not_zero, &loop); 2624 __ j(not_zero, &loop);
2626 2625
2627 // Invoke the function. 2626 // Invoke the function.
2628 __ bind(&invoke); 2627 __ bind(&invoke);
2629 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); 2628 ASSERT(instr->HasPointerMap());
2630 LPointerMap* pointers = instr->pointer_map(); 2629 LPointerMap* pointers = instr->pointer_map();
2631 RecordPosition(pointers->position()); 2630 RecordPosition(pointers->position());
2632 SafepointGenerator safepoint_generator( 2631 SafepointGenerator safepoint_generator(
2633 this, pointers, Safepoint::kLazyDeopt); 2632 this, pointers, Safepoint::kLazyDeopt);
2634 ParameterCount actual(rax); 2633 ParameterCount actual(rax);
2635 __ InvokeFunction(function, actual, CALL_FUNCTION, 2634 __ InvokeFunction(function, actual, CALL_FUNCTION,
2636 safepoint_generator, CALL_AS_METHOD); 2635 safepoint_generator, CALL_AS_METHOD);
2637 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 2636 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
2638 } 2637 }
2639 2638
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
3176 3175
3177 default: 3176 default:
3178 UNREACHABLE(); 3177 UNREACHABLE();
3179 } 3178 }
3180 } 3179 }
3181 3180
3182 3181
3183 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { 3182 void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
3184 ASSERT(ToRegister(instr->function()).is(rdi)); 3183 ASSERT(ToRegister(instr->function()).is(rdi));
3185 ASSERT(instr->HasPointerMap()); 3184 ASSERT(instr->HasPointerMap());
3186 ASSERT(instr->HasDeoptimizationEnvironment());
3187 LPointerMap* pointers = instr->pointer_map(); 3185 LPointerMap* pointers = instr->pointer_map();
3188 RecordPosition(pointers->position()); 3186 RecordPosition(pointers->position());
3189 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); 3187 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt);
3190 ParameterCount count(instr->arity()); 3188 ParameterCount count(instr->arity());
3191 __ InvokeFunction(rdi, count, CALL_FUNCTION, generator, CALL_AS_METHOD); 3189 __ InvokeFunction(rdi, count, CALL_FUNCTION, generator, CALL_AS_METHOD);
3192 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 3190 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
3193 } 3191 }
3194 3192
3195 3193
3196 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { 3194 void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
4598 void LCodeGen::DoDeoptimize(LDeoptimize* instr) { 4596 void LCodeGen::DoDeoptimize(LDeoptimize* instr) {
4599 DeoptimizeIf(no_condition, instr->environment()); 4597 DeoptimizeIf(no_condition, instr->environment());
4600 } 4598 }
4601 4599
4602 4600
4603 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { 4601 void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) {
4604 LOperand* obj = instr->object(); 4602 LOperand* obj = instr->object();
4605 LOperand* key = instr->key(); 4603 LOperand* key = instr->key();
4606 EmitPushTaggedOperand(obj); 4604 EmitPushTaggedOperand(obj);
4607 EmitPushTaggedOperand(key); 4605 EmitPushTaggedOperand(key);
4608 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); 4606 ASSERT(instr->HasPointerMap());
4609 LPointerMap* pointers = instr->pointer_map(); 4607 LPointerMap* pointers = instr->pointer_map();
4610 RecordPosition(pointers->position()); 4608 RecordPosition(pointers->position());
4611 // Create safepoint generator that will also ensure enough space in the 4609 // Create safepoint generator that will also ensure enough space in the
4612 // reloc info for patching in deoptimization (since this is invoking a 4610 // reloc info for patching in deoptimization (since this is invoking a
4613 // builtin) 4611 // builtin)
4614 SafepointGenerator safepoint_generator( 4612 SafepointGenerator safepoint_generator(
4615 this, pointers, Safepoint::kLazyDeopt); 4613 this, pointers, Safepoint::kLazyDeopt);
4616 __ Push(Smi::FromInt(strict_mode_flag())); 4614 __ Push(Smi::FromInt(strict_mode_flag()));
4617 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); 4615 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator);
4618 } 4616 }
4619 4617
4620 4618
4621 void LCodeGen::DoIn(LIn* instr) { 4619 void LCodeGen::DoIn(LIn* instr) {
4622 LOperand* obj = instr->object(); 4620 LOperand* obj = instr->object();
4623 LOperand* key = instr->key(); 4621 LOperand* key = instr->key();
4624 EmitPushTaggedOperand(key); 4622 EmitPushTaggedOperand(key);
4625 EmitPushTaggedOperand(obj); 4623 EmitPushTaggedOperand(obj);
4626 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); 4624 ASSERT(instr->HasPointerMap());
4627 LPointerMap* pointers = instr->pointer_map(); 4625 LPointerMap* pointers = instr->pointer_map();
4628 RecordPosition(pointers->position()); 4626 RecordPosition(pointers->position());
4629 SafepointGenerator safepoint_generator( 4627 SafepointGenerator safepoint_generator(
4630 this, pointers, Safepoint::kLazyDeopt); 4628 this, pointers, Safepoint::kLazyDeopt);
4631 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4629 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4632 } 4630 }
4633 4631
4634 4632
4635 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { 4633 void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
4636 PushSafepointRegistersScope scope(this); 4634 PushSafepointRegistersScope scope(this);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4785 FixedArray::kHeaderSize - kPointerSize)); 4783 FixedArray::kHeaderSize - kPointerSize));
4786 __ bind(&done); 4784 __ bind(&done);
4787 } 4785 }
4788 4786
4789 4787
4790 #undef __ 4788 #undef __
4791 4789
4792 } } // namespace v8::internal 4790 } } // namespace v8::internal
4793 4791
4794 #endif // V8_TARGET_ARCH_X64 4792 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/mips/lithium-mips.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698