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

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

Issue 2381843002: Add Smi::Zero and replace all Smi::FromInt(0) calls (Closed)
Patch Set: Mark Smi::kZero as V8_EXPORT_PRIVATE 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 unified diff | Download patch
« no previous file with comments | « src/builtins/builtins-array.cc ('k') | src/builtins/builtins-dataview.cc » ('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 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 assembler->Goto(&loop); 383 assembler->Goto(&loop);
384 } 384 }
385 385
386 assembler->Bind(&return_len); 386 assembler->Bind(&return_len);
387 assembler->Return(var_len.value()); 387 assembler->Return(var_len.value());
388 388
389 assembler->Bind(&return_two53minus1); 389 assembler->Bind(&return_two53minus1);
390 assembler->Return(assembler->NumberConstant(kMaxSafeInteger)); 390 assembler->Return(assembler->NumberConstant(kMaxSafeInteger));
391 391
392 assembler->Bind(&return_zero); 392 assembler->Bind(&return_zero);
393 assembler->Return(assembler->SmiConstant(Smi::FromInt(0))); 393 assembler->Return(assembler->SmiConstant(Smi::kZero));
394 } 394 }
395 } 395 }
396 396
397 void Builtins::Generate_ToInteger(CodeStubAssembler* assembler) { 397 void Builtins::Generate_ToInteger(CodeStubAssembler* assembler) {
398 typedef TypeConversionDescriptor Descriptor; 398 typedef TypeConversionDescriptor Descriptor;
399 399
400 compiler::Node* input = assembler->Parameter(Descriptor::kArgument); 400 compiler::Node* input = assembler->Parameter(Descriptor::kArgument);
401 compiler::Node* context = assembler->Parameter(Descriptor::kContext); 401 compiler::Node* context = assembler->Parameter(Descriptor::kContext);
402 402
403 assembler->Return(assembler->ToInteger(context, input)); 403 assembler->Return(assembler->ToInteger(context, input));
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 typedef TypeofDescriptor Descriptor; 477 typedef TypeofDescriptor Descriptor;
478 478
479 Node* object = assembler->Parameter(Descriptor::kObject); 479 Node* object = assembler->Parameter(Descriptor::kObject);
480 Node* context = assembler->Parameter(Descriptor::kContext); 480 Node* context = assembler->Parameter(Descriptor::kContext);
481 481
482 assembler->Return(assembler->Typeof(object, context)); 482 assembler->Return(assembler->Typeof(object, context));
483 } 483 }
484 484
485 } // namespace internal 485 } // namespace internal
486 } // namespace v8 486 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-array.cc ('k') | src/builtins/builtins-dataview.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698