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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 942513002: Put the type feedback vector in the unoptimized JavaScript frame. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: ia32 lithium fix. Created 5 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
« src/deoptimizer.cc ('K') | « src/x64/macro-assembler-x64.h ('k') | no next file » | 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_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/division-by-constant.h" 10 #include "src/base/division-by-constant.h"
(...skipping 5165 matching lines...) Expand 10 before | Expand all | Expand 10 after
5176 movp(scratch1, FieldOperand(current, Map::kBitField2Offset)); 5176 movp(scratch1, FieldOperand(current, Map::kBitField2Offset));
5177 DecodeField<Map::ElementsKindBits>(scratch1); 5177 DecodeField<Map::ElementsKindBits>(scratch1);
5178 cmpp(scratch1, Immediate(DICTIONARY_ELEMENTS)); 5178 cmpp(scratch1, Immediate(DICTIONARY_ELEMENTS));
5179 j(equal, found); 5179 j(equal, found);
5180 movp(current, FieldOperand(current, Map::kPrototypeOffset)); 5180 movp(current, FieldOperand(current, Map::kPrototypeOffset));
5181 CompareRoot(current, Heap::kNullValueRootIndex); 5181 CompareRoot(current, Heap::kNullValueRootIndex);
5182 j(not_equal, &loop_again); 5182 j(not_equal, &loop_again);
5183 } 5183 }
5184 5184
5185 5185
5186 void MacroAssembler::OSRDropVectorFromStack(int unoptimized_slot_count,
5187 Register scratch0,
5188 Register scratch1) {
5189 if (unoptimized_slot_count > 0) {
5190 Label loop_start;
5191 leap(scratch0,
5192 Operand(rbp, JavaScriptFrameConstants::kFeedbackVectorOffset));
5193 bind(&loop_start);
5194 movp(scratch1, Operand(scratch0, -1 * kPointerSize));
5195 movp(Operand(scratch0, 0), scratch1);
5196 subp(scratch0, Immediate(kPointerSize));
5197 cmpp(scratch0, rsp);
5198 j(greater, &loop_start);
5199 }
5200 addp(rsp, Immediate(kPointerSize));
5201 }
5202
5203
5186 void MacroAssembler::TruncatingDiv(Register dividend, int32_t divisor) { 5204 void MacroAssembler::TruncatingDiv(Register dividend, int32_t divisor) {
5187 DCHECK(!dividend.is(rax)); 5205 DCHECK(!dividend.is(rax));
5188 DCHECK(!dividend.is(rdx)); 5206 DCHECK(!dividend.is(rdx));
5189 base::MagicNumbersForDivision<uint32_t> mag = 5207 base::MagicNumbersForDivision<uint32_t> mag =
5190 base::SignedDivisionByConstant(static_cast<uint32_t>(divisor)); 5208 base::SignedDivisionByConstant(static_cast<uint32_t>(divisor));
5191 movl(rax, Immediate(mag.multiplier)); 5209 movl(rax, Immediate(mag.multiplier));
5192 imull(dividend); 5210 imull(dividend);
5193 bool neg = (mag.multiplier & (static_cast<uint32_t>(1) << 31)) != 0; 5211 bool neg = (mag.multiplier & (static_cast<uint32_t>(1) << 31)) != 0;
5194 if (divisor > 0 && neg) addl(rdx, dividend); 5212 if (divisor > 0 && neg) addl(rdx, dividend);
5195 if (divisor < 0 && !neg && mag.multiplier > 0) subl(rdx, dividend); 5213 if (divisor < 0 && !neg && mag.multiplier > 0) subl(rdx, dividend);
5196 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); 5214 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift));
5197 movl(rax, dividend); 5215 movl(rax, dividend);
5198 shrl(rax, Immediate(31)); 5216 shrl(rax, Immediate(31));
5199 addl(rdx, rax); 5217 addl(rdx, rax);
5200 } 5218 }
5201 5219
5202 5220
5203 } } // namespace v8::internal 5221 } } // namespace v8::internal
5204 5222
5205 #endif // V8_TARGET_ARCH_X64 5223 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/deoptimizer.cc ('K') | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698