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

Unified Diff: src/builtins/builtins-number.cc

Issue 2425703007: [builtins] Fix typo in Number.parseInt TurboFan builtin. (Closed)
Patch Set: Fix Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-number.cc
diff --git a/src/builtins/builtins-number.cc b/src/builtins/builtins-number.cc
index fb92a3ca516453dfcaf16c84f68187a9047e8700..2e4aa799806c95b1aa1818f230749d4c9cc07c71 100644
--- a/src/builtins/builtins-number.cc
+++ b/src/builtins/builtins-number.cc
@@ -287,7 +287,7 @@ void Builtins::Generate_NumberParseInt(CodeStubAssembler* assembler) {
assembler->GotoIf(assembler->TaggedIsSmi(input), &if_inputissmi);
Node* input_map = assembler->LoadMap(input);
assembler->GotoIf(
- assembler->WordEqual(input_map, assembler->UndefinedConstant()),
+ assembler->WordEqual(input_map, assembler->HeapNumberMapConstant()),
&if_inputisheapnumber);
Node* input_instance_type = assembler->LoadMapInstanceType(input_map);
assembler->Branch(assembler->IsStringInstanceType(input_instance_type),
@@ -305,12 +305,14 @@ void Builtins::Generate_NumberParseInt(CodeStubAssembler* assembler) {
Node* input_value = assembler->LoadHeapNumberValue(input);
Node* input_value_abs = assembler->Float64Abs(input_value);
- assembler->GotoIf(assembler->Float64LessThan(
- input_value_abs, assembler->Float64Constant(0.01)),
- &if_generic);
- assembler->GotoIf(assembler->Float64LessThan(
- assembler->Float64Constant(1e9), input_value_abs),
- &if_generic);
+ assembler->GotoUnless(
+ assembler->Float64LessThan(input_value_abs,
+ assembler->Float64Constant(1e9)),
+ &if_generic);
+ assembler->GotoUnless(
+ assembler->Float64LessThan(assembler->Float64Constant(0.01),
+ input_value_abs),
+ &if_generic);
// Return the truncated int32 value, and return the tagged result.
Node* input_value32 = assembler->TruncateFloat64ToWord32(input_value);
« 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