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

Side by Side Diff: src/runtime.cc

Issue 7799027: Lock the prototype of internal classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Final commit. Created 9 years, 3 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/runtime.h ('k') | src/string.js » ('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 14 matching lines...) Expand all
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #include <stdlib.h> 28 #include <stdlib.h>
29 29
30 #include "v8.h" 30 #include "v8.h"
31 31
32 #include "accessors.h" 32 #include "accessors.h"
33 #include "api.h" 33 #include "api.h"
34 #include "arguments.h" 34 #include "arguments.h"
35 #include "bootstrapper.h"
35 #include "codegen.h" 36 #include "codegen.h"
36 #include "compilation-cache.h" 37 #include "compilation-cache.h"
37 #include "compiler.h" 38 #include "compiler.h"
38 #include "cpu.h" 39 #include "cpu.h"
39 #include "dateparser-inl.h" 40 #include "dateparser-inl.h"
40 #include "debug.h" 41 #include "debug.h"
41 #include "deoptimizer.h" 42 #include "deoptimizer.h"
42 #include "execution.h" 43 #include "execution.h"
43 #include "global-handles.h" 44 #include "global-handles.h"
44 #include "jsregexp.h" 45 #include "jsregexp.h"
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionIsBuiltin) { 2147 RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionIsBuiltin) {
2147 NoHandleAllocation ha; 2148 NoHandleAllocation ha;
2148 ASSERT(args.length() == 1); 2149 ASSERT(args.length() == 1);
2149 2150
2150 CONVERT_CHECKED(JSFunction, f, args[0]); 2151 CONVERT_CHECKED(JSFunction, f, args[0]);
2151 return isolate->heap()->ToBoolean(f->IsBuiltin()); 2152 return isolate->heap()->ToBoolean(f->IsBuiltin());
2152 } 2153 }
2153 2154
2154 2155
2155 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetCode) { 2156 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetCode) {
2157 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
2156 HandleScope scope(isolate); 2158 HandleScope scope(isolate);
2157 ASSERT(args.length() == 2); 2159 ASSERT(args.length() == 2);
2158 2160
2159 CONVERT_ARG_CHECKED(JSFunction, target, 0); 2161 CONVERT_ARG_CHECKED(JSFunction, target, 0);
2160 Handle<Object> code = args.at<Object>(1); 2162 Handle<Object> code = args.at<Object>(1);
2161 2163
2162 Handle<Context> context(target->context()); 2164 Handle<Context> context(target->context());
2163 2165
2164 if (!code->IsNull()) { 2166 if (!code->IsNull()) {
2165 RUNTIME_ASSERT(code->IsJSFunction()); 2167 RUNTIME_ASSERT(code->IsJSFunction());
(...skipping 6083 matching lines...) Expand 10 before | Expand all | Expand 10 after
8249 return Smi::FromInt(ast_id); 8251 return Smi::FromInt(ast_id);
8250 } else { 8252 } else {
8251 if (function->IsMarkedForLazyRecompilation()) { 8253 if (function->IsMarkedForLazyRecompilation()) {
8252 function->ReplaceCode(function->shared()->code()); 8254 function->ReplaceCode(function->shared()->code());
8253 } 8255 }
8254 return Smi::FromInt(-1); 8256 return Smi::FromInt(-1);
8255 } 8257 }
8256 } 8258 }
8257 8259
8258 8260
8261 RUNTIME_FUNCTION(MaybeObject*, Runtime_CheckIsBootstrapping) {
8262 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
8263 return isolate->heap()->undefined_value();
8264 }
8265
8266
8259 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFunctionDelegate) { 8267 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFunctionDelegate) {
8260 HandleScope scope(isolate); 8268 HandleScope scope(isolate);
8261 ASSERT(args.length() == 1); 8269 ASSERT(args.length() == 1);
8262 RUNTIME_ASSERT(!args[0]->IsJSFunction()); 8270 RUNTIME_ASSERT(!args[0]->IsJSFunction());
8263 return *Execution::GetFunctionDelegate(args.at<Object>(0)); 8271 return *Execution::GetFunctionDelegate(args.at<Object>(0));
8264 } 8272 }
8265 8273
8266 8274
8267 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetConstructorDelegate) { 8275 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetConstructorDelegate) {
8268 HandleScope scope(isolate); 8276 HandleScope scope(isolate);
(...skipping 4724 matching lines...) Expand 10 before | Expand all | Expand 10 after
12993 } else { 13001 } else {
12994 // Handle last resort GC and make sure to allow future allocations 13002 // Handle last resort GC and make sure to allow future allocations
12995 // to grow the heap without causing GCs (if possible). 13003 // to grow the heap without causing GCs (if possible).
12996 isolate->counters()->gc_last_resort_from_js()->Increment(); 13004 isolate->counters()->gc_last_resort_from_js()->Increment();
12997 isolate->heap()->CollectAllGarbage(false); 13005 isolate->heap()->CollectAllGarbage(false);
12998 } 13006 }
12999 } 13007 }
13000 13008
13001 13009
13002 } } // namespace v8::internal 13010 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698