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

Side by Side Diff: src/handles.cc

Issue 18552: Fix bug where strings were not flattened before regexp. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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/api.cc ('k') | src/jsregexp.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 void TransformToFastProperties(Handle<JSObject> object, 113 void TransformToFastProperties(Handle<JSObject> object,
114 int unused_property_fields) { 114 int unused_property_fields) {
115 CALL_HEAP_FUNCTION_VOID( 115 CALL_HEAP_FUNCTION_VOID(
116 object->TransformToFastProperties(unused_property_fields)); 116 object->TransformToFastProperties(unused_property_fields));
117 } 117 }
118 118
119 119
120 void FlattenString(Handle<String> string) { 120 void FlattenString(Handle<String> string) {
121 StringShape shape(*string); 121 StringShape shape(*string);
122 if (string->IsFlat(shape)) return; 122 if (string->IsFlat(shape)) return;
123 CALL_HEAP_FUNCTION_VOID(string->Flatten(shape)); 123 CALL_HEAP_FUNCTION_VOID(string->TryFlatten(shape));
124 ASSERT(string->IsFlat(StringShape(*string))); 124 ASSERT(string->IsFlat(StringShape(*string)));
125 } 125 }
126 126
127 127
128 Handle<Object> SetPrototype(Handle<JSFunction> function, 128 Handle<Object> SetPrototype(Handle<JSFunction> function,
129 Handle<Object> prototype) { 129 Handle<Object> prototype) {
130 CALL_HEAP_FUNCTION(Accessors::FunctionSetPrototype(*function, 130 CALL_HEAP_FUNCTION(Accessors::FunctionSetPrototype(*function,
131 *prototype, 131 *prototype,
132 NULL), 132 NULL),
133 Object); 133 Object);
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 Handle<Context> compile_context, 535 Handle<Context> compile_context,
536 Handle<Context> function_context) { 536 Handle<Context> function_context) {
537 Handle<FixedArray> arr = Factory::NewFixedArray(3); 537 Handle<FixedArray> arr = Factory::NewFixedArray(3);
538 arr->set(0, Smi::FromInt(index)); 538 arr->set(0, Smi::FromInt(index));
539 arr->set(1, *compile_context); // Compile in this context 539 arr->set(1, *compile_context); // Compile in this context
540 arr->set(2, *function_context); // Set function context to this 540 arr->set(2, *function_context); // Set function context to this
541 fun->shared()->set_lazy_load_data(*arr); 541 fun->shared()->set_lazy_load_data(*arr);
542 } 542 }
543 543
544 } } // namespace v8::internal 544 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698