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

Side by Side Diff: src/arm64/full-codegen-arm64.cc

Issue 378503003: ARM64: Use UntagSmi helpers and clean up assertions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Replace one '32' with 'kWRegSizeInBits'. Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/arm64/debug-arm64.cc ('k') | src/arm64/lithium-codegen-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 __ B(vs, &stub_call); 2022 __ B(vs, &stub_call);
2023 __ Mov(result, x10); 2023 __ Mov(result, x10);
2024 break; 2024 break;
2025 case Token::SUB: 2025 case Token::SUB:
2026 __ Subs(x10, left, right); 2026 __ Subs(x10, left, right);
2027 __ B(vs, &stub_call); 2027 __ B(vs, &stub_call);
2028 __ Mov(result, x10); 2028 __ Mov(result, x10);
2029 break; 2029 break;
2030 case Token::MUL: { 2030 case Token::MUL: {
2031 Label not_minus_zero, done; 2031 Label not_minus_zero, done;
2032 STATIC_ASSERT(kSmiShift == (kXRegSizeInBits / 2));
2033 STATIC_ASSERT(kSmiTag == 0);
2032 __ Smulh(x10, left, right); 2034 __ Smulh(x10, left, right);
2033 __ Cbnz(x10, &not_minus_zero); 2035 __ Cbnz(x10, &not_minus_zero);
2034 __ Eor(x11, left, right); 2036 __ Eor(x11, left, right);
2035 __ Tbnz(x11, kXSignBit, &stub_call); 2037 __ Tbnz(x11, kXSignBit, &stub_call);
2036 STATIC_ASSERT(kSmiTag == 0);
2037 __ Mov(result, x10); 2038 __ Mov(result, x10);
2038 __ B(&done); 2039 __ B(&done);
2039 __ Bind(&not_minus_zero); 2040 __ Bind(&not_minus_zero);
2040 __ Cls(x11, x10); 2041 __ Cls(x11, x10);
2041 __ Cmp(x11, kXRegSizeInBits - kSmiShift); 2042 __ Cmp(x11, kXRegSizeInBits - kSmiShift);
2042 __ B(lt, &stub_call); 2043 __ B(lt, &stub_call);
2043 __ SmiTag(result, x10); 2044 __ SmiTag(result, x10);
2044 __ Bind(&done); 2045 __ Bind(&done);
2045 break; 2046 break;
2046 } 2047 }
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
2585 2586
2586 VisitForAccumulatorValue(args->at(0)); 2587 VisitForAccumulatorValue(args->at(0));
2587 2588
2588 Label materialize_true, materialize_false; 2589 Label materialize_true, materialize_false;
2589 Label* if_true = NULL; 2590 Label* if_true = NULL;
2590 Label* if_false = NULL; 2591 Label* if_false = NULL;
2591 Label* fall_through = NULL; 2592 Label* fall_through = NULL;
2592 context()->PrepareTest(&materialize_true, &materialize_false, 2593 context()->PrepareTest(&materialize_true, &materialize_false,
2593 &if_true, &if_false, &fall_through); 2594 &if_true, &if_false, &fall_through);
2594 2595
2596 uint64_t sign_mask = V8_UINT64_C(1) << (kSmiShift + kSmiValueSize - 1);
2597
2595 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false); 2598 PrepareForBailoutBeforeSplit(expr, true, if_true, if_false);
2596 __ TestAndSplit(x0, kSmiTagMask | (0x80000000UL << kSmiShift), if_true, 2599 __ TestAndSplit(x0, kSmiTagMask | sign_mask, if_true, if_false, fall_through);
2597 if_false, fall_through);
2598 2600
2599 context()->Plug(if_true, if_false); 2601 context()->Plug(if_true, if_false);
2600 } 2602 }
2601 2603
2602 2604
2603 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) { 2605 void FullCodeGenerator::EmitIsObject(CallRuntime* expr) {
2604 ZoneList<Expression*>* args = expr->arguments(); 2606 ZoneList<Expression*>* args = expr->arguments();
2605 ASSERT(args->length() == 1); 2607 ASSERT(args->length() == 1);
2606 2608
2607 VisitForAccumulatorValue(args->at(0)); 2609 VisitForAccumulatorValue(args->at(0));
(...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after
4889 return previous_; 4891 return previous_;
4890 } 4892 }
4891 4893
4892 4894
4893 #undef __ 4895 #undef __
4894 4896
4895 4897
4896 } } // namespace v8::internal 4898 } } // namespace v8::internal
4897 4899
4898 #endif // V8_TARGET_ARCH_ARM64 4900 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/debug-arm64.cc ('k') | src/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698