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

Side by Side Diff: src/x87/code-stubs-x87.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/x64/codegen-x64.cc ('k') | src/x87/codegen-x87.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "bootstrapper.h" 9 #include "bootstrapper.h"
10 #include "code-stubs.h" 10 #include "code-stubs.h"
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1232 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); 1232 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
1233 __ mov(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset)); 1233 __ mov(ebx, FieldOperand(ebx, Map::kInstanceTypeOffset));
1234 1234
1235 // (5a) Is subject sequential two byte? If yes, go to (9). 1235 // (5a) Is subject sequential two byte? If yes, go to (9).
1236 __ test_b(ebx, kStringRepresentationMask | kStringEncodingMask); 1236 __ test_b(ebx, kStringRepresentationMask | kStringEncodingMask);
1237 STATIC_ASSERT((kSeqStringTag | kTwoByteStringTag) == 0); 1237 STATIC_ASSERT((kSeqStringTag | kTwoByteStringTag) == 0);
1238 __ j(zero, &seq_two_byte_string); // Go to (9). 1238 __ j(zero, &seq_two_byte_string); // Go to (9).
1239 // (5b) Is subject external? If yes, go to (8). 1239 // (5b) Is subject external? If yes, go to (8).
1240 __ test_b(ebx, kStringRepresentationMask); 1240 __ test_b(ebx, kStringRepresentationMask);
1241 // The underlying external string is never a short external string. 1241 // The underlying external string is never a short external string.
1242 STATIC_CHECK(ExternalString::kMaxShortLength < ConsString::kMinLength); 1242 STATIC_ASSERT(ExternalString::kMaxShortLength < ConsString::kMinLength);
1243 STATIC_CHECK(ExternalString::kMaxShortLength < SlicedString::kMinLength); 1243 STATIC_ASSERT(ExternalString::kMaxShortLength < SlicedString::kMinLength);
1244 __ j(not_zero, &external_string); // Go to (8). 1244 __ j(not_zero, &external_string); // Go to (8).
1245 1245
1246 // eax: sequential subject string (or look-alike, external string) 1246 // eax: sequential subject string (or look-alike, external string)
1247 // edx: original subject string 1247 // edx: original subject string
1248 // ecx: RegExp data (FixedArray) 1248 // ecx: RegExp data (FixedArray)
1249 // (6) One byte sequential. Load regexp code for one byte. 1249 // (6) One byte sequential. Load regexp code for one byte.
1250 __ bind(&seq_one_byte_string); 1250 __ bind(&seq_one_byte_string);
1251 // Load previous index and check range before edx is overwritten. We have 1251 // Load previous index and check range before edx is overwritten. We have
1252 // to use edx instead of eax here because it might have been only made to 1252 // to use edx instead of eax here because it might have been only made to
1253 // look like a sequential string when it actually is an external string. 1253 // look like a sequential string when it actually is an external string.
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 // The subject string can only be external or sequential string of either 3133 // The subject string can only be external or sequential string of either
3134 // encoding at this point. 3134 // encoding at this point.
3135 Label two_byte_sequential, runtime_drop_two, sequential_string; 3135 Label two_byte_sequential, runtime_drop_two, sequential_string;
3136 STATIC_ASSERT(kExternalStringTag != 0); 3136 STATIC_ASSERT(kExternalStringTag != 0);
3137 STATIC_ASSERT(kSeqStringTag == 0); 3137 STATIC_ASSERT(kSeqStringTag == 0);
3138 __ test_b(ebx, kExternalStringTag); 3138 __ test_b(ebx, kExternalStringTag);
3139 __ j(zero, &sequential_string); 3139 __ j(zero, &sequential_string);
3140 3140
3141 // Handle external string. 3141 // Handle external string.
3142 // Rule out short external strings. 3142 // Rule out short external strings.
3143 STATIC_CHECK(kShortExternalStringTag != 0); 3143 STATIC_ASSERT(kShortExternalStringTag != 0);
3144 __ test_b(ebx, kShortExternalStringMask); 3144 __ test_b(ebx, kShortExternalStringMask);
3145 __ j(not_zero, &runtime); 3145 __ j(not_zero, &runtime);
3146 __ mov(edi, FieldOperand(edi, ExternalString::kResourceDataOffset)); 3146 __ mov(edi, FieldOperand(edi, ExternalString::kResourceDataOffset));
3147 // Move the pointer so that offset-wise, it looks like a sequential string. 3147 // Move the pointer so that offset-wise, it looks like a sequential string.
3148 STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize); 3148 STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize);
3149 __ sub(edi, Immediate(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); 3149 __ sub(edi, Immediate(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
3150 3150
3151 __ bind(&sequential_string); 3151 __ bind(&sequential_string);
3152 // Stash away (adjusted) index and (underlying) string. 3152 // Stash away (adjusted) index and (underlying) string.
3153 __ push(edx); 3153 __ push(edx);
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
4771 Operand(ebp, 7 * kPointerSize), 4771 Operand(ebp, 7 * kPointerSize),
4772 NULL); 4772 NULL);
4773 } 4773 }
4774 4774
4775 4775
4776 #undef __ 4776 #undef __
4777 4777
4778 } } // namespace v8::internal 4778 } } // namespace v8::internal
4779 4779
4780 #endif // V8_TARGET_ARCH_X87 4780 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.cc ('k') | src/x87/codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698