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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 7744052: Generated code for substring slices in ia32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Another set of small changes. Created 9 years, 3 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3216 matching lines...) Expand 10 before | Expand all | Expand 10 after
3227 __ mov(result, FieldOperand(string, HeapObject::kMapOffset)); 3227 __ mov(result, FieldOperand(string, HeapObject::kMapOffset));
3228 __ movzx_b(result, FieldOperand(result, Map::kInstanceTypeOffset)); 3228 __ movzx_b(result, FieldOperand(result, Map::kInstanceTypeOffset));
3229 3229
3230 // We need special handling for indirect strings. 3230 // We need special handling for indirect strings.
3231 Label check_sequential; 3231 Label check_sequential;
3232 __ test(result, Immediate(kIsIndirectStringMask)); 3232 __ test(result, Immediate(kIsIndirectStringMask));
3233 __ j(zero, &check_sequential, Label::kNear); 3233 __ j(zero, &check_sequential, Label::kNear);
3234 3234
3235 // Dispatch on the indirect string shape: slice or cons. 3235 // Dispatch on the indirect string shape: slice or cons.
3236 Label cons_string; 3236 Label cons_string;
3237 const uint32_t kSlicedNotConsMask = kSlicedStringTag & ~kConsStringTag;
3238 ASSERT(IsPowerOf2(kSlicedNotConsMask) && kSlicedNotConsMask != 0);
3239 __ test(result, Immediate(kSlicedNotConsMask)); 3237 __ test(result, Immediate(kSlicedNotConsMask));
3240 __ j(zero, &cons_string, Label::kNear); 3238 __ j(zero, &cons_string, Label::kNear);
3241 3239
3242 // Handle slices. 3240 // Handle slices.
3243 Label indirect_string_loaded; 3241 Label indirect_string_loaded;
3244 __ mov(result, FieldOperand(string, SlicedString::kOffsetOffset)); 3242 __ mov(result, FieldOperand(string, SlicedString::kOffsetOffset));
3245 __ SmiUntag(result); 3243 __ SmiUntag(result);
3246 __ add(index, Operand(result)); 3244 __ add(index, Operand(result));
3247 __ mov(string, FieldOperand(string, SlicedString::kParentOffset)); 3245 __ mov(string, FieldOperand(string, SlicedString::kParentOffset));
3248 __ jmp(&indirect_string_loaded, Label::kNear); 3246 __ jmp(&indirect_string_loaded, Label::kNear);
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
4379 env->deoptimization_index()); 4377 env->deoptimization_index());
4380 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); 4378 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4381 } 4379 }
4382 4380
4383 4381
4384 #undef __ 4382 #undef __
4385 4383
4386 } } // namespace v8::internal 4384 } } // namespace v8::internal
4387 4385
4388 #endif // V8_TARGET_ARCH_IA32 4386 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698