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

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

Issue 2451973003: [builtins] Don't canonicalize results of Math double operations. (Closed)
Patch Set: Same for the number builtins. Created 4 years, 1 month 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-number.cc ('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 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 #include "src/code-stub-assembler.h" 4 #include "src/code-stub-assembler.h"
5 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/frames-inl.h" 6 #include "src/frames-inl.h"
7 #include "src/frames.h" 7 #include "src/frames.h"
8 #include "src/ic/handler-configuration.h" 8 #include "src/ic/handler-configuration.h"
9 #include "src/ic/stub-cache.h" 9 #include "src/ic/stub-cache.h"
10 10
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 var_result.Bind(zero); 516 var_result.Bind(zero);
517 Goto(&return_result); 517 Goto(&return_result);
518 } 518 }
519 } 519 }
520 } 520 }
521 Bind(&if_overflow); 521 Bind(&if_overflow);
522 { 522 {
523 var_lhs_float64.Bind(SmiToFloat64(a)); 523 var_lhs_float64.Bind(SmiToFloat64(a));
524 var_rhs_float64.Bind(SmiToFloat64(b)); 524 var_rhs_float64.Bind(SmiToFloat64(b));
525 Node* value = Float64Mul(var_lhs_float64.value(), var_rhs_float64.value()); 525 Node* value = Float64Mul(var_lhs_float64.value(), var_rhs_float64.value());
526 Node* result = ChangeFloat64ToTagged(value); 526 Node* result = AllocateHeapNumberWithValue(value);
527 var_result.Bind(result); 527 var_result.Bind(result);
528 Goto(&return_result); 528 Goto(&return_result);
529 } 529 }
530 530
531 Bind(&return_result); 531 Bind(&return_result);
532 return var_result.value(); 532 return var_result.value();
533 } 533 }
534 534
535 Node* CodeStubAssembler::TaggedIsSmi(Node* a) { 535 Node* CodeStubAssembler::TaggedIsSmi(Node* a) {
536 return WordEqual(WordAnd(BitcastTaggedToWord(a), IntPtrConstant(kSmiTagMask)), 536 return WordEqual(WordAnd(BitcastTaggedToWord(a), IntPtrConstant(kSmiTagMask)),
(...skipping 7854 matching lines...) Expand 10 before | Expand all | Expand 10 after
8391 // Load the HeapNumber value. 8391 // Load the HeapNumber value.
8392 var_finc_value.Bind(LoadHeapNumberValue(value)); 8392 var_finc_value.Bind(LoadHeapNumberValue(value));
8393 Goto(&do_finc); 8393 Goto(&do_finc);
8394 } 8394 }
8395 8395
8396 Bind(&do_finc); 8396 Bind(&do_finc);
8397 { 8397 {
8398 Node* finc_value = var_finc_value.value(); 8398 Node* finc_value = var_finc_value.value();
8399 Node* one = Float64Constant(1.0); 8399 Node* one = Float64Constant(1.0);
8400 Node* finc_result = Float64Add(finc_value, one); 8400 Node* finc_result = Float64Add(finc_value, one);
8401 var_result.Bind(ChangeFloat64ToTagged(finc_result)); 8401 var_result.Bind(AllocateHeapNumberWithValue(finc_result));
8402 Goto(&end); 8402 Goto(&end);
8403 } 8403 }
8404 8404
8405 Bind(&end); 8405 Bind(&end);
8406 return var_result.value(); 8406 return var_result.value();
8407 } 8407 }
8408 8408
8409 compiler::Node* CodeStubAssembler::CreateArrayIterator( 8409 compiler::Node* CodeStubAssembler::CreateArrayIterator(
8410 compiler::Node* array, compiler::Node* array_map, 8410 compiler::Node* array, compiler::Node* array_map,
8411 compiler::Node* array_type, compiler::Node* context, IterationKind mode) { 8411 compiler::Node* array_type, compiler::Node* context, IterationKind mode) {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
8571 Node* buffer_bit_field = LoadObjectField( 8571 Node* buffer_bit_field = LoadObjectField(
8572 buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32()); 8572 buffer, JSArrayBuffer::kBitFieldOffset, MachineType::Uint32());
8573 Node* was_neutered_mask = Int32Constant(JSArrayBuffer::WasNeutered::kMask); 8573 Node* was_neutered_mask = Int32Constant(JSArrayBuffer::WasNeutered::kMask);
8574 8574
8575 return Word32NotEqual(Word32And(buffer_bit_field, was_neutered_mask), 8575 return Word32NotEqual(Word32And(buffer_bit_field, was_neutered_mask),
8576 Int32Constant(0)); 8576 Int32Constant(0));
8577 } 8577 }
8578 8578
8579 } // namespace internal 8579 } // namespace internal
8580 } // namespace v8 8580 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins/builtins-number.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698