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

Unified Diff: src/heap.cc

Issue 9408: Removed some unsafe uses of StringShape.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap.h ('k') | src/jsregexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 694)
+++ src/heap.cc (working copy)
@@ -783,8 +783,7 @@
// is a candidate for being shortcut by the scavenger.
ASSERT(object->map() == map);
if (map->instance_type() >= FIRST_NONSTRING_TYPE) return false;
- StringShape shape(map);
- return (shape.representation_tag() == kConsStringTag) &&
+ return (StringShape(map).representation_tag() == kConsStringTag) &&
(ConsString::cast(object)->unchecked_second() == Heap::empty_string());
}
@@ -1347,9 +1346,9 @@
Object* Heap::AllocateConsString(String* first,
- StringShape first_shape,
- String* second,
- StringShape second_shape) {
+ String* second) {
+ StringShape first_shape(first);
+ StringShape second_shape(second);
int first_length = first->length(first_shape);
int second_length = second->length(second_shape);
int length = first_length + second_length;
@@ -1411,9 +1410,9 @@
Object* Heap::AllocateSlicedString(String* buffer,
- StringShape buffer_shape,
int start,
int end) {
+ StringShape buffer_shape(buffer);
int length = end - start;
// If the resulting string is small make a sub string.
« no previous file with comments | « src/heap.h ('k') | src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698