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

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

Issue 201763002: Merged r19693, r19694, r19847, r19893 into 3.24 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.24
Patch Set: Created 6 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/version.cc ('k') | test/mjsunit/regress/regress-350884.js » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 3981 matching lines...) Expand 10 before | Expand all | Expand 10 after
3992 __ j(NegateCondition(cc), &done, Label::kNear); 3992 __ j(NegateCondition(cc), &done, Label::kNear);
3993 __ int3(); 3993 __ int3();
3994 __ bind(&done); 3994 __ bind(&done);
3995 } else { 3995 } else {
3996 DeoptimizeIf(cc, check->environment()); 3996 DeoptimizeIf(cc, check->environment());
3997 } 3997 }
3998 } 3998 }
3999 3999
4000 4000
4001 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { 4001 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) {
4002 if (instr->hydrogen()->skip_check()) return; 4002 HBoundsCheck* hinstr = instr->hydrogen();
4003 if (hinstr->skip_check()) return;
4004
4005 Representation representation = hinstr->length()->representation();
4006 ASSERT(representation.Equals(hinstr->index()->representation()));
4007 ASSERT(representation.IsSmiOrInteger32());
4003 4008
4004 if (instr->length()->IsRegister()) { 4009 if (instr->length()->IsRegister()) {
4005 Register reg = ToRegister(instr->length()); 4010 Register reg = ToRegister(instr->length());
4006 if (!instr->hydrogen()->length()->representation().IsSmi()) { 4011
4007 __ AssertZeroExtended(reg);
4008 }
4009 if (instr->index()->IsConstantOperand()) { 4012 if (instr->index()->IsConstantOperand()) {
4010 int32_t constant_index = 4013 int32_t constant_index =
4011 ToInteger32(LConstantOperand::cast(instr->index())); 4014 ToInteger32(LConstantOperand::cast(instr->index()));
4012 if (instr->hydrogen()->length()->representation().IsSmi()) { 4015 if (representation.IsSmi()) {
4013 __ Cmp(reg, Smi::FromInt(constant_index)); 4016 __ Cmp(reg, Smi::FromInt(constant_index));
4014 } else { 4017 } else {
4015 __ cmpq(reg, Immediate(constant_index)); 4018 __ cmpl(reg, Immediate(constant_index));
4016 } 4019 }
4017 } else { 4020 } else {
4018 Register reg2 = ToRegister(instr->index()); 4021 Register reg2 = ToRegister(instr->index());
4019 if (!instr->hydrogen()->index()->representation().IsSmi()) { 4022 if (representation.IsSmi()) {
4020 __ AssertZeroExtended(reg2); 4023 __ cmpq(reg, reg2);
4024 } else {
4025 __ cmpl(reg, reg2);
4021 } 4026 }
4022 __ cmpq(reg, reg2);
4023 } 4027 }
4024 } else { 4028 } else {
4025 Operand length = ToOperand(instr->length()); 4029 Operand length = ToOperand(instr->length());
4026 if (instr->index()->IsConstantOperand()) { 4030 if (instr->index()->IsConstantOperand()) {
4027 int32_t constant_index = 4031 int32_t constant_index =
4028 ToInteger32(LConstantOperand::cast(instr->index())); 4032 ToInteger32(LConstantOperand::cast(instr->index()));
4029 if (instr->hydrogen()->length()->representation().IsSmi()) { 4033 if (representation.IsSmi()) {
4030 __ Cmp(length, Smi::FromInt(constant_index)); 4034 __ Cmp(length, Smi::FromInt(constant_index));
4031 } else { 4035 } else {
4032 __ cmpq(length, Immediate(constant_index)); 4036 __ cmpl(length, Immediate(constant_index));
4033 } 4037 }
4034 } else { 4038 } else {
4035 __ cmpq(length, ToRegister(instr->index())); 4039 if (representation.IsSmi()) {
4040 __ cmpq(length, ToRegister(instr->index()));
4041 } else {
4042 __ cmpl(length, ToRegister(instr->index()));
4043 }
4036 } 4044 }
4037 } 4045 }
4038 Condition condition = 4046 Condition condition = hinstr->allow_equality() ? below : below_equal;
4039 instr->hydrogen()->allow_equality() ? below : below_equal;
4040 ApplyCheckIf(condition, instr); 4047 ApplyCheckIf(condition, instr);
4041 } 4048 }
4042 4049
4043 4050
4044 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { 4051 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
4045 ElementsKind elements_kind = instr->elements_kind(); 4052 ElementsKind elements_kind = instr->elements_kind();
4046 LOperand* key = instr->key(); 4053 LOperand* key = instr->key();
4047 if (!key->IsConstantOperand()) { 4054 if (!key->IsConstantOperand()) {
4048 Register key_reg = ToRegister(key); 4055 Register key_reg = ToRegister(key);
4049 // Even though the HLoad/StoreKeyedFastElement instructions force 4056 // Even though the HLoad/StoreKeyedFastElement instructions force
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
5548 FixedArray::kHeaderSize - kPointerSize)); 5555 FixedArray::kHeaderSize - kPointerSize));
5549 __ bind(&done); 5556 __ bind(&done);
5550 } 5557 }
5551 5558
5552 5559
5553 #undef __ 5560 #undef __
5554 5561
5555 } } // namespace v8::internal 5562 } } // namespace v8::internal
5556 5563
5557 #endif // V8_TARGET_ARCH_X64 5564 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/version.cc ('k') | test/mjsunit/regress/regress-350884.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698