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

Side by Side Diff: src/runtime.cc

Issue 69029: If an external string enters the symbol table, make sure to set the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 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/objects-inl.h ('k') | no next file » | 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-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-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 6507 matching lines...) Expand 10 before | Expand all | Expand 10 after
6518 } 6518 }
6519 6519
6520 6520
6521 // If an object given is an external string, check that the underlying 6521 // If an object given is an external string, check that the underlying
6522 // resource is accessible. For other kinds of objects, always return true. 6522 // resource is accessible. For other kinds of objects, always return true.
6523 static bool IsExternalStringValid(Object* str) { 6523 static bool IsExternalStringValid(Object* str) {
6524 if (!str->IsString() || !StringShape(String::cast(str)).IsExternal()) { 6524 if (!str->IsString() || !StringShape(String::cast(str)).IsExternal()) {
6525 return true; 6525 return true;
6526 } 6526 }
6527 if (StringShape(String::cast(str)).IsAsciiRepresentation()) { 6527 if (StringShape(String::cast(str)).IsAsciiRepresentation()) {
6528 return ExternalAsciiString::cast(str)->resource() != 0; 6528 return ExternalAsciiString::cast(str)->resource() != NULL;
6529 } else if (StringShape(String::cast(str)).IsTwoByteRepresentation()) { 6529 } else if (StringShape(String::cast(str)).IsTwoByteRepresentation()) {
6530 return ExternalTwoByteString::cast(str)->resource() != 0; 6530 return ExternalTwoByteString::cast(str)->resource() != NULL;
6531 } else { 6531 } else {
6532 return true; 6532 return true;
6533 } 6533 }
6534 } 6534 }
6535 6535
6536 6536
6537 // Helper function used by Runtime_DebugGetLoadedScripts below. 6537 // Helper function used by Runtime_DebugGetLoadedScripts below.
6538 static int DebugGetLoadedScripts(FixedArray* instances, int instances_size) { 6538 static int DebugGetLoadedScripts(FixedArray* instances, int instances_size) {
6539 NoHandleAllocation ha; 6539 NoHandleAllocation ha;
6540 AssertNoAllocation no_alloc; 6540 AssertNoAllocation no_alloc;
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
6953 } else { 6953 } else {
6954 // Handle last resort GC and make sure to allow future allocations 6954 // Handle last resort GC and make sure to allow future allocations
6955 // to grow the heap without causing GCs (if possible). 6955 // to grow the heap without causing GCs (if possible).
6956 Counters::gc_last_resort_from_js.Increment(); 6956 Counters::gc_last_resort_from_js.Increment();
6957 Heap::CollectAllGarbage(); 6957 Heap::CollectAllGarbage();
6958 } 6958 }
6959 } 6959 }
6960 6960
6961 6961
6962 } } // namespace v8::internal 6962 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698