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

Side by Side Diff: src/runtime.cc

Issue 12084062: Merged r13361, r13481 into 3.15 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.15
Patch Set: Created 7 years, 10 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') | src/version.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 2128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2139 2139
2140 if (!JSFunction::EnsureCompiled(source, KEEP_EXCEPTION)) { 2140 if (!JSFunction::EnsureCompiled(source, KEEP_EXCEPTION)) {
2141 return Failure::Exception(); 2141 return Failure::Exception();
2142 } 2142 }
2143 2143
2144 // Set the code, scope info, formal parameter count, and the length 2144 // Set the code, scope info, formal parameter count, and the length
2145 // of the target shared function info. Set the source code of the 2145 // of the target shared function info. Set the source code of the
2146 // target function to undefined. SetCode is only used for built-in 2146 // target function to undefined. SetCode is only used for built-in
2147 // constructors like String, Array, and Object, and some web code 2147 // constructors like String, Array, and Object, and some web code
2148 // doesn't like seeing source code for constructors. 2148 // doesn't like seeing source code for constructors.
2149 target_shared->set_code(source_shared->code()); 2149 target_shared->ReplaceCode(source_shared->code());
2150 target_shared->set_scope_info(source_shared->scope_info()); 2150 target_shared->set_scope_info(source_shared->scope_info());
2151 target_shared->set_length(source_shared->length()); 2151 target_shared->set_length(source_shared->length());
2152 target_shared->set_formal_parameter_count( 2152 target_shared->set_formal_parameter_count(
2153 source_shared->formal_parameter_count()); 2153 source_shared->formal_parameter_count());
2154 target_shared->set_script(isolate->heap()->undefined_value()); 2154 target_shared->set_script(isolate->heap()->undefined_value());
2155 2155
2156 // Since we don't store the source we should never optimize this. 2156 // Since we don't store the source we should never optimize this.
2157 target_shared->code()->set_optimizable(false); 2157 target_shared->code()->set_optimizable(false);
2158 2158
2159 // Clear the optimization hints related to the compiled code as these 2159 // Clear the optimization hints related to the compiled code as these
(...skipping 11345 matching lines...) Expand 10 before | Expand all | Expand 10 after
13505 // Handle last resort GC and make sure to allow future allocations 13505 // Handle last resort GC and make sure to allow future allocations
13506 // to grow the heap without causing GCs (if possible). 13506 // to grow the heap without causing GCs (if possible).
13507 isolate->counters()->gc_last_resort_from_js()->Increment(); 13507 isolate->counters()->gc_last_resort_from_js()->Increment();
13508 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13508 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13509 "Runtime::PerformGC"); 13509 "Runtime::PerformGC");
13510 } 13510 }
13511 } 13511 }
13512 13512
13513 13513
13514 } } // namespace v8::internal 13514 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698