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

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

Issue 6676009: Fix x64 array length operations in Crankshaft (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | src/x64/lithium-x64.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 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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 1038
1039 void LCodeGen::DoConstantT(LConstantT* instr) { 1039 void LCodeGen::DoConstantT(LConstantT* instr) {
1040 ASSERT(instr->result()->IsRegister()); 1040 ASSERT(instr->result()->IsRegister());
1041 __ Move(ToRegister(instr->result()), instr->value()); 1041 __ Move(ToRegister(instr->result()), instr->value());
1042 } 1042 }
1043 1043
1044 1044
1045 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { 1045 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) {
1046 Register result = ToRegister(instr->result()); 1046 Register result = ToRegister(instr->result());
1047 Register array = ToRegister(instr->InputAt(0)); 1047 Register array = ToRegister(instr->InputAt(0));
1048 __ movq(result, FieldOperand(array, JSArray::kLengthOffset)); 1048 __ movl(result, FieldOperand(array, JSArray::kLengthOffset));
1049 } 1049 }
1050 1050
1051 1051
1052 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { 1052 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) {
1053 Register result = ToRegister(instr->result()); 1053 Register result = ToRegister(instr->result());
1054 Register array = ToRegister(instr->InputAt(0)); 1054 Register array = ToRegister(instr->InputAt(0));
1055 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset)); 1055 __ movl(result, FieldOperand(array, FixedArray::kLengthOffset));
1056 } 1056 }
1057 1057
1058 1058
1059 void LCodeGen::DoExternalArrayLength(LExternalArrayLength* instr) { 1059 void LCodeGen::DoExternalArrayLength(LExternalArrayLength* instr) {
1060 Register result = ToRegister(instr->result()); 1060 Register result = ToRegister(instr->result());
1061 Register array = ToRegister(instr->InputAt(0)); 1061 Register array = ToRegister(instr->InputAt(0));
1062 __ movq(result, FieldOperand(array, ExternalPixelArray::kLengthOffset)); 1062 __ movl(result, FieldOperand(array, ExternalPixelArray::kLengthOffset));
1063 } 1063 }
1064 1064
1065 1065
1066 void LCodeGen::DoValueOf(LValueOf* instr) { 1066 void LCodeGen::DoValueOf(LValueOf* instr) {
1067 Register input = ToRegister(instr->InputAt(0)); 1067 Register input = ToRegister(instr->InputAt(0));
1068 Register result = ToRegister(instr->result()); 1068 Register result = ToRegister(instr->result());
1069 ASSERT(input.is(result)); 1069 ASSERT(input.is(result));
1070 NearLabel done; 1070 NearLabel done;
1071 // If the object is a smi return the object. 1071 // If the object is a smi return the object.
1072 __ JumpIfSmi(input, &done); 1072 __ JumpIfSmi(input, &done);
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 __ decb(value); // 0 if negative, 255 if positive. 2780 __ decb(value); // 0 if negative, 255 if positive.
2781 __ bind(&done); 2781 __ bind(&done);
2782 } 2782 }
2783 2783
2784 __ movb(Operand(external_pointer, key, times_1, 0), value); 2784 __ movb(Operand(external_pointer, key, times_1, 0), value);
2785 } 2785 }
2786 2786
2787 2787
2788 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 2788 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
2789 if (instr->length()->IsRegister()) { 2789 if (instr->length()->IsRegister()) {
2790 __ cmpq(ToRegister(instr->index()), ToRegister(instr->length())); 2790 __ cmpl(ToRegister(instr->index()), ToRegister(instr->length()));
2791 } else { 2791 } else {
2792 __ cmpq(ToRegister(instr->index()), ToOperand(instr->length())); 2792 __ cmpl(ToRegister(instr->index()), ToOperand(instr->length()));
2793 } 2793 }
2794 DeoptimizeIf(above_equal, instr->environment()); 2794 DeoptimizeIf(above_equal, instr->environment());
2795 } 2795 }
2796 2796
2797 2797
2798 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) { 2798 void LCodeGen::DoStoreKeyedFastElement(LStoreKeyedFastElement* instr) {
2799 Register value = ToRegister(instr->value()); 2799 Register value = ToRegister(instr->value());
2800 Register elements = ToRegister(instr->object()); 2800 Register elements = ToRegister(instr->object());
2801 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg; 2801 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg;
2802 2802
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
3691 RegisterEnvironmentForDeoptimization(environment); 3691 RegisterEnvironmentForDeoptimization(environment);
3692 ASSERT(osr_pc_offset_ == -1); 3692 ASSERT(osr_pc_offset_ == -1);
3693 osr_pc_offset_ = masm()->pc_offset(); 3693 osr_pc_offset_ = masm()->pc_offset();
3694 } 3694 }
3695 3695
3696 #undef __ 3696 #undef __
3697 3697
3698 } } // namespace v8::internal 3698 } } // namespace v8::internal
3699 3699
3700 #endif // V8_TARGET_ARCH_X64 3700 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698