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

Side by Side Diff: src/runtime.cc

Issue 8568013: Introduce read buffer for external strings when using charAt (ia32). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects-visiting.cc ('k') | src/x64/macro-assembler-x64.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 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
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
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
OLDNEW
« no previous file with comments | « src/objects-visiting.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698