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

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

Issue 1100083002: Don't MISS if you read the hole from certain FastHoley arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE and fix arm64 compilation. Created 5 years, 7 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
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ia32/lithium-ia32.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after
3178 3178
3179 // Check for the hole value. 3179 // Check for the hole value.
3180 if (instr->hydrogen()->RequiresHoleCheck()) { 3180 if (instr->hydrogen()->RequiresHoleCheck()) {
3181 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { 3181 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
3182 __ test(result, Immediate(kSmiTagMask)); 3182 __ test(result, Immediate(kSmiTagMask));
3183 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotASmi); 3183 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotASmi);
3184 } else { 3184 } else {
3185 __ cmp(result, factory()->the_hole_value()); 3185 __ cmp(result, factory()->the_hole_value());
3186 DeoptimizeIf(equal, instr, Deoptimizer::kHole); 3186 DeoptimizeIf(equal, instr, Deoptimizer::kHole);
3187 } 3187 }
3188 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) {
3189 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS);
3190 Label done;
3191 __ cmp(result, factory()->the_hole_value());
3192 __ j(not_equal, &done);
3193 if (info()->IsStub()) {
3194 // A stub can safely convert the hole to undefined only if the array
3195 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise
3196 // it needs to bail out.
3197 __ mov(result, isolate()->factory()->array_protector());
3198 __ cmp(FieldOperand(result, PropertyCell::kValueOffset),
3199 Immediate(Smi::FromInt(Isolate::kArrayProtectorValid)));
3200 DeoptimizeIf(not_equal, instr, Deoptimizer::kHole);
3201 }
3202 __ mov(result, isolate()->factory()->undefined_value());
3203 __ bind(&done);
3188 } 3204 }
3189 } 3205 }
3190 3206
3191 3207
3192 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { 3208 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) {
3193 if (instr->is_typed_elements()) { 3209 if (instr->is_typed_elements()) {
3194 DoLoadKeyedExternalArray(instr); 3210 DoLoadKeyedExternalArray(instr);
3195 } else if (instr->hydrogen()->representation().IsDouble()) { 3211 } else if (instr->hydrogen()->representation().IsDouble()) {
3196 DoLoadKeyedFixedDoubleArray(instr); 3212 DoLoadKeyedFixedDoubleArray(instr);
3197 } else { 3213 } else {
(...skipping 2541 matching lines...) Expand 10 before | Expand all | Expand 10 after
5739 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5755 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5740 RecordSafepoint(Safepoint::kNoLazyDeopt); 5756 RecordSafepoint(Safepoint::kNoLazyDeopt);
5741 } 5757 }
5742 5758
5743 5759
5744 #undef __ 5760 #undef __
5745 5761
5746 } } // namespace v8::internal 5762 } } // namespace v8::internal
5747 5763
5748 #endif // V8_TARGET_ARCH_IA32 5764 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698