| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2249 Object* flat; | 2249 Object* flat; |
| 2250 { MaybeObject* maybe_flat = subject->TryFlatten(); | 2250 { MaybeObject* maybe_flat = subject->TryFlatten(); |
| 2251 if (!maybe_flat->ToObject(&flat)) return maybe_flat; | 2251 if (!maybe_flat->ToObject(&flat)) return maybe_flat; |
| 2252 } | 2252 } |
| 2253 subject = String::cast(flat); | 2253 subject = String::cast(flat); |
| 2254 | 2254 |
| 2255 if (i >= static_cast<uint32_t>(subject->length())) { | 2255 if (i >= static_cast<uint32_t>(subject->length())) { |
| 2256 return isolate->heap()->nan_value(); | 2256 return isolate->heap()->nan_value(); |
| 2257 } | 2257 } |
| 2258 | 2258 |
| 2259 return Smi::FromInt(subject->Get(i)); | 2259 return Smi::FromInt(subject->Get(i, String::UPDATE_EXTERNAL_STRING_BUFFER)); |
| 2260 } | 2260 } |
| 2261 | 2261 |
| 2262 | 2262 |
| 2263 RUNTIME_FUNCTION(MaybeObject*, Runtime_CharFromCode) { | 2263 RUNTIME_FUNCTION(MaybeObject*, Runtime_CharFromCode) { |
| 2264 NoHandleAllocation ha; | 2264 NoHandleAllocation ha; |
| 2265 ASSERT(args.length() == 1); | 2265 ASSERT(args.length() == 1); |
| 2266 return CharFromCode(isolate, args[0]); | 2266 return CharFromCode(isolate, args[0]); |
| 2267 } | 2267 } |
| 2268 | 2268 |
| 2269 | 2269 |
| (...skipping 11267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13537 } else { | 13537 } else { |
| 13538 // Handle last resort GC and make sure to allow future allocations | 13538 // Handle last resort GC and make sure to allow future allocations |
| 13539 // to grow the heap without causing GCs (if possible). | 13539 // to grow the heap without causing GCs (if possible). |
| 13540 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13540 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13541 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13541 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
| 13542 } | 13542 } |
| 13543 } | 13543 } |
| 13544 | 13544 |
| 13545 | 13545 |
| 13546 } } // namespace v8::internal | 13546 } } // namespace v8::internal |
| OLD | NEW |