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

Side by Side Diff: src/code-stub-assembler.cc

Issue 1986043002: Fix improper usage of SmiUntag operation in CodeStubAssembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « no previous file | 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/code-stub-assembler.h" 5 #include "src/code-stub-assembler.h"
6 #include "src/code-factory.h" 6 #include "src/code-factory.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 Node* CodeStubAssembler::SmiToWord32(Node* value) { 253 Node* CodeStubAssembler::SmiToWord32(Node* value) {
254 Node* result = WordSar(value, SmiShiftBitsConstant()); 254 Node* result = WordSar(value, SmiShiftBitsConstant());
255 if (Is64()) { 255 if (Is64()) {
256 result = TruncateInt64ToInt32(result); 256 result = TruncateInt64ToInt32(result);
257 } 257 }
258 return result; 258 return result;
259 } 259 }
260 260
261 Node* CodeStubAssembler::SmiToFloat64(Node* value) { 261 Node* CodeStubAssembler::SmiToFloat64(Node* value) {
262 return ChangeInt32ToFloat64(SmiUntag(value)); 262 return ChangeInt32ToFloat64(SmiToWord32(value));
263 } 263 }
264 264
265 Node* CodeStubAssembler::SmiAdd(Node* a, Node* b) { return IntPtrAdd(a, b); } 265 Node* CodeStubAssembler::SmiAdd(Node* a, Node* b) { return IntPtrAdd(a, b); }
266 266
267 Node* CodeStubAssembler::SmiAddWithOverflow(Node* a, Node* b) { 267 Node* CodeStubAssembler::SmiAddWithOverflow(Node* a, Node* b) {
268 return IntPtrAddWithOverflow(a, b); 268 return IntPtrAddWithOverflow(a, b);
269 } 269 }
270 270
271 Node* CodeStubAssembler::SmiSub(Node* a, Node* b) { return IntPtrSub(a, b); } 271 Node* CodeStubAssembler::SmiSub(Node* a, Node* b) { return IntPtrSub(a, b); }
272 272
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 1411
1412 Bind(&if_iskeyinrange); 1412 Bind(&if_iskeyinrange);
1413 Node* element = LoadFixedArrayElementInt32Index(elements, index); 1413 Node* element = LoadFixedArrayElementInt32Index(elements, index);
1414 Node* the_hole = LoadRoot(Heap::kTheHoleValueRootIndex); 1414 Node* the_hole = LoadRoot(Heap::kTheHoleValueRootIndex);
1415 Branch(WordEqual(element, the_hole), if_not_found, if_found); 1415 Branch(WordEqual(element, the_hole), if_not_found, if_found);
1416 } 1416 }
1417 } 1417 }
1418 1418
1419 } // namespace internal 1419 } // namespace internal
1420 } // namespace v8 1420 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698