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

Side by Side Diff: src/heap.cc

Issue 196139: X64: Convert smis to holding 32 bits of payload. (Closed)
Patch Set: Addressed review comments. Forwarded to head. Created 11 years, 2 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
« no previous file with comments | « src/execution.cc ('k') | src/macros.py » ('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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 if (first_length == 0) return second; 1672 if (first_length == 0) return second;
1673 1673
1674 int second_length = second->length(); 1674 int second_length = second->length();
1675 if (second_length == 0) return first; 1675 if (second_length == 0) return first;
1676 1676
1677 int length = first_length + second_length; 1677 int length = first_length + second_length;
1678 bool is_ascii = first->IsAsciiRepresentation() 1678 bool is_ascii = first->IsAsciiRepresentation()
1679 && second->IsAsciiRepresentation(); 1679 && second->IsAsciiRepresentation();
1680 1680
1681 // Make sure that an out of memory exception is thrown if the length 1681 // Make sure that an out of memory exception is thrown if the length
1682 // of the new cons string is too large to fit in a Smi. 1682 // of the new cons string is too large.
1683 if (length > Smi::kMaxValue || length < -0) { 1683 if (length > String::kMaxLength || length < 0) {
1684 Top::context()->mark_out_of_memory(); 1684 Top::context()->mark_out_of_memory();
1685 return Failure::OutOfMemoryException(); 1685 return Failure::OutOfMemoryException();
1686 } 1686 }
1687 1687
1688 // If the resulting string is small make a flat string. 1688 // If the resulting string is small make a flat string.
1689 if (length < String::kMinNonFlatLength) { 1689 if (length < String::kMinNonFlatLength) {
1690 ASSERT(first->IsFlat()); 1690 ASSERT(first->IsFlat());
1691 ASSERT(second->IsFlat()); 1691 ASSERT(second->IsFlat());
1692 if (is_ascii) { 1692 if (is_ascii) {
1693 Object* result = AllocateRawAsciiString(length); 1693 Object* result = AllocateRawAsciiString(length);
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after
3887 for (int i = 0; i < kNumberOfCaches; i++) { 3887 for (int i = 0; i < kNumberOfCaches; i++) {
3888 if (caches_[i] != NULL) { 3888 if (caches_[i] != NULL) {
3889 delete caches_[i]; 3889 delete caches_[i];
3890 caches_[i] = NULL; 3890 caches_[i] = NULL;
3891 } 3891 }
3892 } 3892 }
3893 } 3893 }
3894 3894
3895 3895
3896 } } // namespace v8::internal 3896 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698