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

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

Issue 166653005: Fix dictionary element load to pass correct elements kind. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: x64 checks Created 6 years, 10 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/hydrogen.cc ('k') | test/mjsunit/regress/regress-3158.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 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 2774
2775 Register result = ToRegister(instr->result()); 2775 Register result = ToRegister(instr->result());
2776 if (!access.IsInobject()) { 2776 if (!access.IsInobject()) {
2777 __ movp(result, FieldOperand(object, JSObject::kPropertiesOffset)); 2777 __ movp(result, FieldOperand(object, JSObject::kPropertiesOffset));
2778 object = result; 2778 object = result;
2779 } 2779 }
2780 2780
2781 Representation representation = access.representation(); 2781 Representation representation = access.representation();
2782 if (representation.IsSmi() && 2782 if (representation.IsSmi() &&
2783 instr->hydrogen()->representation().IsInteger32()) { 2783 instr->hydrogen()->representation().IsInteger32()) {
2784 if (FLAG_debug_code) {
Igor Sheludko 2014/02/14 15:16:31 I think it is better to use #ifdef DEBUG as we did
ulan 2014/02/14 15:22:39 Done.
2785 Register scratch = kScratchRegister;
2786 __ Load(scratch, FieldOperand(object, offset), representation);
2787 __ AssertSmi(scratch);
2788 }
2784 // Read int value directly from upper half of the smi. 2789 // Read int value directly from upper half of the smi.
2785 STATIC_ASSERT(kSmiTag == 0); 2790 STATIC_ASSERT(kSmiTag == 0);
2786 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); 2791 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
2787 offset += kPointerSize / 2; 2792 offset += kPointerSize / 2;
2788 representation = Representation::Integer32(); 2793 representation = Representation::Integer32();
2789 } 2794 }
2790 __ Load(result, FieldOperand(object, offset), representation); 2795 __ Load(result, FieldOperand(object, offset), representation);
2791 } 2796 }
2792 2797
2793 2798
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
3019 } 3024 }
3020 } 3025 }
3021 3026
3022 bool requires_hole_check = hinstr->RequiresHoleCheck(); 3027 bool requires_hole_check = hinstr->RequiresHoleCheck();
3023 int offset = FixedArray::kHeaderSize - kHeapObjectTag; 3028 int offset = FixedArray::kHeaderSize - kHeapObjectTag;
3024 Representation representation = hinstr->representation(); 3029 Representation representation = hinstr->representation();
3025 3030
3026 if (representation.IsInteger32() && 3031 if (representation.IsInteger32() &&
3027 hinstr->elements_kind() == FAST_SMI_ELEMENTS) { 3032 hinstr->elements_kind() == FAST_SMI_ELEMENTS) {
3028 ASSERT(!requires_hole_check); 3033 ASSERT(!requires_hole_check);
3034 if (FLAG_debug_code) {
Igor Sheludko 2014/02/14 15:16:31 Same as above.
ulan 2014/02/14 15:22:39 Done.
3035 Register scratch = kScratchRegister;
3036 __ Load(scratch,
3037 BuildFastArrayOperand(instr->elements(),
3038 key,
3039 FAST_ELEMENTS,
3040 offset,
3041 instr->additional_index()),
3042 Representation::Smi());
3043 __ AssertSmi(scratch);
3044 }
3029 // Read int value directly from upper half of the smi. 3045 // Read int value directly from upper half of the smi.
3030 STATIC_ASSERT(kSmiTag == 0); 3046 STATIC_ASSERT(kSmiTag == 0);
3031 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); 3047 STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
3032 offset += kPointerSize / 2; 3048 offset += kPointerSize / 2;
3033 } 3049 }
3034 3050
3035 __ Load(result, 3051 __ Load(result,
3036 BuildFastArrayOperand(instr->elements(), 3052 BuildFastArrayOperand(instr->elements(),
3037 key, 3053 key,
3038 FAST_ELEMENTS, 3054 FAST_ELEMENTS,
(...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after
5552 FixedArray::kHeaderSize - kPointerSize)); 5568 FixedArray::kHeaderSize - kPointerSize));
5553 __ bind(&done); 5569 __ bind(&done);
5554 } 5570 }
5555 5571
5556 5572
5557 #undef __ 5573 #undef __
5558 5574
5559 } } // namespace v8::internal 5575 } } // namespace v8::internal
5560 5576
5561 #endif // V8_TARGET_ARCH_X64 5577 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | test/mjsunit/regress/regress-3158.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698