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

Side by Side Diff: src/builtins/builtins-conversion.cc

Issue 2543873003: [stubs] Use CSA::IsHeapNumberMap() instead of manual map comparing. (Closed)
Patch Set: Created 4 years 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
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/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 Label not_string(&assembler); 178 Label not_string(&assembler);
179 assembler.GotoUnless(assembler.IsStringInstanceType(input_instance_type), 179 assembler.GotoUnless(assembler.IsStringInstanceType(input_instance_type),
180 &not_string); 180 &not_string);
181 assembler.Return(input); 181 assembler.Return(input);
182 182
183 Label not_heap_number(&assembler); 183 Label not_heap_number(&assembler);
184 184
185 assembler.Bind(&not_string); 185 assembler.Bind(&not_string);
186 { 186 {
187 assembler.GotoUnless( 187 assembler.GotoUnless(assembler.IsHeapNumberMap(input_map),
188 assembler.WordEqual(input_map, assembler.HeapNumberMapConstant()), 188 &not_heap_number);
189 &not_heap_number);
190 assembler.Goto(&is_number); 189 assembler.Goto(&is_number);
191 } 190 }
192 191
193 assembler.Bind(&is_number); 192 assembler.Bind(&is_number);
194 { assembler.Return(assembler.NumberToString(context, input)); } 193 { assembler.Return(assembler.NumberToString(context, input)); }
195 194
196 assembler.Bind(&not_heap_number); 195 assembler.Bind(&not_heap_number);
197 { 196 {
198 assembler.GotoIf( 197 assembler.GotoIf(
199 assembler.Word32NotEqual(input_instance_type, 198 assembler.Word32NotEqual(input_instance_type,
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 CodeStubAssembler assembler(state); 481 CodeStubAssembler assembler(state);
483 482
484 Node* object = assembler.Parameter(Descriptor::kObject); 483 Node* object = assembler.Parameter(Descriptor::kObject);
485 Node* context = assembler.Parameter(Descriptor::kContext); 484 Node* context = assembler.Parameter(Descriptor::kContext);
486 485
487 assembler.Return(assembler.Typeof(object, context)); 486 assembler.Return(assembler.Typeof(object, context));
488 } 487 }
489 488
490 } // namespace internal 489 } // namespace internal
491 } // namespace v8 490 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698