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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 304553002: Replace STATIC_CHECK with STATIC_ASSERT. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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/spaces.h ('k') | src/x64/codegen-x64.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 "v8.h" 5 #include "v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "code-stubs.h" 10 #include "code-stubs.h"
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 __ movp(rbx, FieldOperand(rdi, HeapObject::kMapOffset)); 1442 __ movp(rbx, FieldOperand(rdi, HeapObject::kMapOffset));
1443 __ movp(rbx, FieldOperand(rbx, Map::kInstanceTypeOffset)); 1443 __ movp(rbx, FieldOperand(rbx, Map::kInstanceTypeOffset));
1444 1444
1445 // (5a) Is subject sequential two byte? If yes, go to (9). 1445 // (5a) Is subject sequential two byte? If yes, go to (9).
1446 __ testb(rbx, Immediate(kStringRepresentationMask | kStringEncodingMask)); 1446 __ testb(rbx, Immediate(kStringRepresentationMask | kStringEncodingMask));
1447 STATIC_ASSERT((kSeqStringTag | kTwoByteStringTag) == 0); 1447 STATIC_ASSERT((kSeqStringTag | kTwoByteStringTag) == 0);
1448 __ j(zero, &seq_two_byte_string); // Go to (9). 1448 __ j(zero, &seq_two_byte_string); // Go to (9).
1449 // (5b) Is subject external? If yes, go to (8). 1449 // (5b) Is subject external? If yes, go to (8).
1450 __ testb(rbx, Immediate(kStringRepresentationMask)); 1450 __ testb(rbx, Immediate(kStringRepresentationMask));
1451 // The underlying external string is never a short external string. 1451 // The underlying external string is never a short external string.
1452 STATIC_CHECK(ExternalString::kMaxShortLength < ConsString::kMinLength); 1452 STATIC_ASSERT(ExternalString::kMaxShortLength < ConsString::kMinLength);
1453 STATIC_CHECK(ExternalString::kMaxShortLength < SlicedString::kMinLength); 1453 STATIC_ASSERT(ExternalString::kMaxShortLength < SlicedString::kMinLength);
1454 __ j(not_zero, &external_string); // Go to (8) 1454 __ j(not_zero, &external_string); // Go to (8)
1455 1455
1456 // (6) One byte sequential. Load regexp code for one byte. 1456 // (6) One byte sequential. Load regexp code for one byte.
1457 __ bind(&seq_one_byte_string); 1457 __ bind(&seq_one_byte_string);
1458 // rax: RegExp data (FixedArray) 1458 // rax: RegExp data (FixedArray)
1459 __ movp(r11, FieldOperand(rax, JSRegExp::kDataAsciiCodeOffset)); 1459 __ movp(r11, FieldOperand(rax, JSRegExp::kDataAsciiCodeOffset));
1460 __ Set(rcx, 1); // Type is one byte. 1460 __ Set(rcx, 1); // Type is one byte.
1461 1461
1462 // (E) Carry on. String handling is done. 1462 // (E) Carry on. String handling is done.
1463 __ bind(&check_code); 1463 __ bind(&check_code);
(...skipping 1952 matching lines...) Expand 10 before | Expand all | Expand 10 after
3416 // The subject string can only be external or sequential string of either 3416 // The subject string can only be external or sequential string of either
3417 // encoding at this point. 3417 // encoding at this point.
3418 Label two_byte_sequential, sequential_string; 3418 Label two_byte_sequential, sequential_string;
3419 STATIC_ASSERT(kExternalStringTag != 0); 3419 STATIC_ASSERT(kExternalStringTag != 0);
3420 STATIC_ASSERT(kSeqStringTag == 0); 3420 STATIC_ASSERT(kSeqStringTag == 0);
3421 __ testb(rbx, Immediate(kExternalStringTag)); 3421 __ testb(rbx, Immediate(kExternalStringTag));
3422 __ j(zero, &sequential_string); 3422 __ j(zero, &sequential_string);
3423 3423
3424 // Handle external string. 3424 // Handle external string.
3425 // Rule out short external strings. 3425 // Rule out short external strings.
3426 STATIC_CHECK(kShortExternalStringTag != 0); 3426 STATIC_ASSERT(kShortExternalStringTag != 0);
3427 __ testb(rbx, Immediate(kShortExternalStringMask)); 3427 __ testb(rbx, Immediate(kShortExternalStringMask));
3428 __ j(not_zero, &runtime); 3428 __ j(not_zero, &runtime);
3429 __ movp(rdi, FieldOperand(rdi, ExternalString::kResourceDataOffset)); 3429 __ movp(rdi, FieldOperand(rdi, ExternalString::kResourceDataOffset));
3430 // Move the pointer so that offset-wise, it looks like a sequential string. 3430 // Move the pointer so that offset-wise, it looks like a sequential string.
3431 STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize); 3431 STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize);
3432 __ subp(rdi, Immediate(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); 3432 __ subp(rdi, Immediate(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
3433 3433
3434 __ bind(&sequential_string); 3434 __ bind(&sequential_string);
3435 STATIC_ASSERT((kOneByteStringTag & kStringEncodingMask) != 0); 3435 STATIC_ASSERT((kOneByteStringTag & kStringEncodingMask) != 0);
3436 __ testb(rbx, Immediate(kStringEncodingMask)); 3436 __ testb(rbx, Immediate(kStringEncodingMask));
(...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after
5094 return_value_operand, 5094 return_value_operand,
5095 NULL); 5095 NULL);
5096 } 5096 }
5097 5097
5098 5098
5099 #undef __ 5099 #undef __
5100 5100
5101 } } // namespace v8::internal 5101 } } // namespace v8::internal
5102 5102
5103 #endif // V8_TARGET_ARCH_X64 5103 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698