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

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

Issue 6594115: Optimize loads from root-array in X64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Reordered the root-array slightly. Should have no effect on ia32, but help slightly on x64. Created 9 years, 9 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/deoptimizer-x64.cc ('k') | src/x64/macro-assembler-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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 return; 1425 return;
1426 } 1426 }
1427 1427
1428 __ CompareRoot(reg, Heap::kNullValueRootIndex); 1428 __ CompareRoot(reg, Heap::kNullValueRootIndex);
1429 if (instr->is_strict()) { 1429 if (instr->is_strict()) {
1430 __ movl(result, Immediate(Heap::kTrueValueRootIndex)); 1430 __ movl(result, Immediate(Heap::kTrueValueRootIndex));
1431 NearLabel load; 1431 NearLabel load;
1432 __ j(equal, &load); 1432 __ j(equal, &load);
1433 __ movl(result, Immediate(Heap::kFalseValueRootIndex)); 1433 __ movl(result, Immediate(Heap::kFalseValueRootIndex));
1434 __ bind(&load); 1434 __ bind(&load);
1435 __ movq(result, Operand(kRootRegister, result, times_pointer_size, 0)); 1435 __ LoadRootIndexed(result, result, 0);
1436 } else { 1436 } else {
1437 NearLabel true_value, false_value, done; 1437 NearLabel true_value, false_value, done;
1438 __ j(equal, &true_value); 1438 __ j(equal, &true_value);
1439 __ CompareRoot(reg, Heap::kUndefinedValueRootIndex); 1439 __ CompareRoot(reg, Heap::kUndefinedValueRootIndex);
1440 __ j(equal, &true_value); 1440 __ j(equal, &true_value);
1441 __ JumpIfSmi(reg, &false_value); 1441 __ JumpIfSmi(reg, &false_value);
1442 // Check for undetectable objects by looking in the bit field in 1442 // Check for undetectable objects by looking in the bit field in
1443 // the map. The object has already been smi checked. 1443 // the map. The object has already been smi checked.
1444 Register scratch = result; 1444 Register scratch = result;
1445 __ movq(scratch, FieldOperand(reg, HeapObject::kMapOffset)); 1445 __ movq(scratch, FieldOperand(reg, HeapObject::kMapOffset));
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 Register result = ToRegister(instr->result()); 1556 Register result = ToRegister(instr->result());
1557 if (input_operand->IsRegister()) { 1557 if (input_operand->IsRegister()) {
1558 Register input = ToRegister(input_operand); 1558 Register input = ToRegister(input_operand);
1559 __ CheckSmiToIndicator(result, input); 1559 __ CheckSmiToIndicator(result, input);
1560 } else { 1560 } else {
1561 Operand input = ToOperand(instr->InputAt(0)); 1561 Operand input = ToOperand(instr->InputAt(0));
1562 __ CheckSmiToIndicator(result, input); 1562 __ CheckSmiToIndicator(result, input);
1563 } 1563 }
1564 // result is zero if input is a smi, and one otherwise. 1564 // result is zero if input is a smi, and one otherwise.
1565 ASSERT(Heap::kFalseValueRootIndex == Heap::kTrueValueRootIndex + 1); 1565 ASSERT(Heap::kFalseValueRootIndex == Heap::kTrueValueRootIndex + 1);
1566 __ movq(result, Operand(kRootRegister, result, times_pointer_size, 1566 __ LoadRootIndexed(result, result, Heap::kTrueValueRootIndex);
1567 Heap::kTrueValueRootIndex * kPointerSize));
1568 } 1567 }
1569 1568
1570 1569
1571 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { 1570 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) {
1572 int true_block = chunk_->LookupDestination(instr->true_block_id()); 1571 int true_block = chunk_->LookupDestination(instr->true_block_id());
1573 int false_block = chunk_->LookupDestination(instr->false_block_id()); 1572 int false_block = chunk_->LookupDestination(instr->false_block_id());
1574 1573
1575 Condition is_smi; 1574 Condition is_smi;
1576 if (instr->InputAt(0)->IsRegister()) { 1575 if (instr->InputAt(0)->IsRegister()) {
1577 Register input = ToRegister(instr->InputAt(0)); 1576 Register input = ToRegister(instr->InputAt(0));
(...skipping 2070 matching lines...) Expand 10 before | Expand all | Expand 10 after
3648 RegisterEnvironmentForDeoptimization(environment); 3647 RegisterEnvironmentForDeoptimization(environment);
3649 ASSERT(osr_pc_offset_ == -1); 3648 ASSERT(osr_pc_offset_ == -1);
3650 osr_pc_offset_ = masm()->pc_offset(); 3649 osr_pc_offset_ = masm()->pc_offset();
3651 } 3650 }
3652 3651
3653 #undef __ 3652 #undef __
3654 3653
3655 } } // namespace v8::internal 3654 } } // namespace v8::internal
3656 3655
3657 #endif // V8_TARGET_ARCH_X64 3656 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/deoptimizer-x64.cc ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698