OLD | NEW |
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 void TransformToFastProperties(Handle<JSObject> object, | 191 void TransformToFastProperties(Handle<JSObject> object, |
192 int unused_property_fields) { | 192 int unused_property_fields) { |
193 CALL_HEAP_FUNCTION_VOID( | 193 CALL_HEAP_FUNCTION_VOID( |
194 object->TransformToFastProperties(unused_property_fields)); | 194 object->TransformToFastProperties(unused_property_fields)); |
195 } | 195 } |
196 | 196 |
197 | 197 |
198 void FlattenString(Handle<String> string) { | 198 void FlattenString(Handle<String> string) { |
199 CALL_HEAP_FUNCTION_VOID(string->TryFlatten()); | 199 CALL_HEAP_FUNCTION_VOID(string->TryFlatten()); |
200 ASSERT(string->IsFlat()); | |
201 } | 200 } |
202 | 201 |
203 | 202 |
| 203 Handle<String> FlattenGetString(Handle<String> string) { |
| 204 Handle<String> result; |
| 205 CALL_AND_RETRY(string->TryFlatten(), |
| 206 { result = Handle<String>(String::cast(__object__)); |
| 207 break; }, |
| 208 return Handle<String>()); |
| 209 ASSERT(string->IsFlat()); |
| 210 return result; |
| 211 } |
| 212 |
| 213 |
204 Handle<Object> SetPrototype(Handle<JSFunction> function, | 214 Handle<Object> SetPrototype(Handle<JSFunction> function, |
205 Handle<Object> prototype) { | 215 Handle<Object> prototype) { |
206 ASSERT(function->should_have_prototype()); | 216 ASSERT(function->should_have_prototype()); |
207 CALL_HEAP_FUNCTION(Accessors::FunctionSetPrototype(*function, | 217 CALL_HEAP_FUNCTION(Accessors::FunctionSetPrototype(*function, |
208 *prototype, | 218 *prototype, |
209 NULL), | 219 NULL), |
210 Object); | 220 Object); |
211 } | 221 } |
212 | 222 |
213 | 223 |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 | 812 |
803 OptimizedObjectForAddingMultipleProperties:: | 813 OptimizedObjectForAddingMultipleProperties:: |
804 ~OptimizedObjectForAddingMultipleProperties() { | 814 ~OptimizedObjectForAddingMultipleProperties() { |
805 // Reoptimize the object to allow fast property access. | 815 // Reoptimize the object to allow fast property access. |
806 if (has_been_transformed_) { | 816 if (has_been_transformed_) { |
807 TransformToFastProperties(object_, unused_property_fields_); | 817 TransformToFastProperties(object_, unused_property_fields_); |
808 } | 818 } |
809 } | 819 } |
810 | 820 |
811 } } // namespace v8::internal | 821 } } // namespace v8::internal |
OLD | NEW |