OLD | NEW |
---|---|
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 #include "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
8 #include "src/frames.h" | 8 #include "src/frames.h" |
9 #include "src/ic/stub-cache.h" | 9 #include "src/ic/stub-cache.h" |
10 | 10 |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
464 | 464 |
465 Node* CodeStubAssembler::WordIsSmi(Node* a) { | 465 Node* CodeStubAssembler::WordIsSmi(Node* a) { |
466 return WordEqual(WordAnd(a, IntPtrConstant(kSmiTagMask)), IntPtrConstant(0)); | 466 return WordEqual(WordAnd(a, IntPtrConstant(kSmiTagMask)), IntPtrConstant(0)); |
467 } | 467 } |
468 | 468 |
469 Node* CodeStubAssembler::WordIsPositiveSmi(Node* a) { | 469 Node* CodeStubAssembler::WordIsPositiveSmi(Node* a) { |
470 return WordEqual(WordAnd(a, IntPtrConstant(kSmiTagMask | kSmiSignMask)), | 470 return WordEqual(WordAnd(a, IntPtrConstant(kSmiTagMask | kSmiSignMask)), |
471 IntPtrConstant(0)); | 471 IntPtrConstant(0)); |
472 } | 472 } |
473 | 473 |
474 void CodeStubAssembler::BranchIfSameValueZero(Node* a, Node* b, Node* context, | |
475 Label* if_true, Label* if_false) { | |
476 Label if_noteq(this), if_a_isnan(this); | |
477 Node* heap_number_type = Int32Constant(HEAP_NUMBER_TYPE); | |
478 BranchIf(CallRuntime(Runtime::kInlineStrictEqual, context, a, b), if_true, | |
caitp
2016/07/15 17:24:35
this was the problem --- fixing this made the perf
| |
479 &if_noteq); | |
480 | |
481 Bind(&if_noteq); | |
482 GotoIf(WordIsSmi(a), if_false); | |
483 | |
484 Node* a_type = LoadInstanceType(a); | |
485 GotoIf(WordNotEqual(a_type, heap_number_type), if_false); | |
486 | |
487 Node* a_value = LoadHeapNumberValue(a); | |
488 BranchIfFloat64IsNaN(a_value, &if_a_isnan, if_false); | |
489 | |
490 Bind(&if_a_isnan); | |
491 GotoIf(WordIsSmi(b), if_false); | |
492 | |
493 Node* b_type = LoadInstanceType(b); | |
494 GotoIf(WordNotEqual(b_type, heap_number_type), if_false); | |
495 | |
496 Node* b_value = LoadHeapNumberValue(b); | |
497 BranchIfFloat64IsNaN(b_value, if_true, if_false); | |
498 } | |
499 | |
474 Node* CodeStubAssembler::AllocateRawUnaligned(Node* size_in_bytes, | 500 Node* CodeStubAssembler::AllocateRawUnaligned(Node* size_in_bytes, |
475 AllocationFlags flags, | 501 AllocationFlags flags, |
476 Node* top_address, | 502 Node* top_address, |
477 Node* limit_address) { | 503 Node* limit_address) { |
478 Node* top = Load(MachineType::Pointer(), top_address); | 504 Node* top = Load(MachineType::Pointer(), top_address); |
479 Node* limit = Load(MachineType::Pointer(), limit_address); | 505 Node* limit = Load(MachineType::Pointer(), limit_address); |
480 | 506 |
481 // If there's not enough space, call the runtime. | 507 // If there's not enough space, call the runtime. |
482 Variable result(this, MachineRepresentation::kTagged); | 508 Variable result(this, MachineRepresentation::kTagged); |
483 Label runtime_call(this, Label::kDeferred), no_runtime_call(this); | 509 Label runtime_call(this, Label::kDeferred), no_runtime_call(this); |
(...skipping 2506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2990 } | 3016 } |
2991 Bind(&miss); | 3017 Bind(&miss); |
2992 { | 3018 { |
2993 TailCallRuntime(Runtime::kLoadGlobalIC_Miss, p->context, p->slot, | 3019 TailCallRuntime(Runtime::kLoadGlobalIC_Miss, p->context, p->slot, |
2994 p->vector); | 3020 p->vector); |
2995 } | 3021 } |
2996 } | 3022 } |
2997 | 3023 |
2998 } // namespace internal | 3024 } // namespace internal |
2999 } // namespace v8 | 3025 } // namespace v8 |
OLD | NEW |