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

Side by Side Diff: src/objects.cc

Issue 11644097: Use C++ style type casts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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/mips/simulator-mips.cc ('k') | src/objects-inl.h » ('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 // 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 6860 matching lines...) Expand 10 before | Expand all | Expand 10 after
6871 *blew_stack = true; 6871 *blew_stack = true;
6872 return NULL; 6872 return NULL;
6873 } 6873 }
6874 // Go right. 6874 // Go right.
6875 ConsString* cons_string = frames_[OffsetForDepth(depth_ - 1)]; 6875 ConsString* cons_string = frames_[OffsetForDepth(depth_ - 1)];
6876 String* string = cons_string->second(); 6876 String* string = cons_string->second();
6877 int32_t type = string->map()->instance_type(); 6877 int32_t type = string->map()->instance_type();
6878 if ((type & kStringRepresentationMask) != kConsStringTag) { 6878 if ((type & kStringRepresentationMask) != kConsStringTag) {
6879 // Pop stack so next iteration is in correct place. 6879 // Pop stack so next iteration is in correct place.
6880 Pop(); 6880 Pop();
6881 unsigned length = (unsigned) string->length(); 6881 unsigned length = static_cast<unsigned>(string->length());
6882 // Could be a flattened ConsString. 6882 // Could be a flattened ConsString.
6883 if (length == 0) continue; 6883 if (length == 0) continue;
6884 *length_out = length; 6884 *length_out = length;
6885 *type_out = type; 6885 *type_out = type;
6886 consumed_ += length; 6886 consumed_ += length;
6887 return string; 6887 return string;
6888 } 6888 }
6889 cons_string = ConsString::cast(string); 6889 cons_string = ConsString::cast(string);
6890 // TODO(dcarney) Add back root optimization. 6890 // TODO(dcarney) Add back root optimization.
6891 PushRight(cons_string); 6891 PushRight(cons_string);
6892 // Need to traverse all the way left. 6892 // Need to traverse all the way left.
6893 while (true) { 6893 while (true) {
6894 // Continue left. 6894 // Continue left.
6895 string = cons_string->first(); 6895 string = cons_string->first();
6896 type = string->map()->instance_type(); 6896 type = string->map()->instance_type();
6897 if ((type & kStringRepresentationMask) != kConsStringTag) { 6897 if ((type & kStringRepresentationMask) != kConsStringTag) {
6898 AdjustMaximumDepth(); 6898 AdjustMaximumDepth();
6899 unsigned length = (unsigned) string->length(); 6899 unsigned length = static_cast<unsigned>(string->length());
6900 ASSERT(length != 0); 6900 ASSERT(length != 0);
6901 *length_out = length; 6901 *length_out = length;
6902 *type_out = type; 6902 *type_out = type;
6903 consumed_ += length; 6903 consumed_ += length;
6904 return string; 6904 return string;
6905 } 6905 }
6906 cons_string = ConsString::cast(string); 6906 cons_string = ConsString::cast(string);
6907 PushLeft(cons_string); 6907 PushLeft(cons_string);
6908 } 6908 }
6909 } 6909 }
(...skipping 6814 matching lines...) Expand 10 before | Expand all | Expand 10 after
13724 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 13724 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
13725 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 13725 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
13726 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 13726 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
13727 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 13727 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
13728 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 13728 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
13729 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 13729 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
13730 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 13730 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
13731 } 13731 }
13732 13732
13733 } } // namespace v8::internal 13733 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/simulator-mips.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698