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 14 matching lines...) Expand all Loading... |
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" | |
36 #include "codegen.h" | 35 #include "codegen.h" |
37 #include "compilation-cache.h" | 36 #include "compilation-cache.h" |
38 #include "compiler.h" | 37 #include "compiler.h" |
39 #include "cpu.h" | 38 #include "cpu.h" |
40 #include "dateparser-inl.h" | 39 #include "dateparser-inl.h" |
41 #include "debug.h" | 40 #include "debug.h" |
42 #include "deoptimizer.h" | 41 #include "deoptimizer.h" |
43 #include "execution.h" | 42 #include "execution.h" |
44 #include "global-handles.h" | 43 #include "global-handles.h" |
45 #include "jsregexp.h" | 44 #include "jsregexp.h" |
(...skipping 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2147 RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionIsBuiltin) { | 2146 RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionIsBuiltin) { |
2148 NoHandleAllocation ha; | 2147 NoHandleAllocation ha; |
2149 ASSERT(args.length() == 1); | 2148 ASSERT(args.length() == 1); |
2150 | 2149 |
2151 CONVERT_CHECKED(JSFunction, f, args[0]); | 2150 CONVERT_CHECKED(JSFunction, f, args[0]); |
2152 return isolate->heap()->ToBoolean(f->IsBuiltin()); | 2151 return isolate->heap()->ToBoolean(f->IsBuiltin()); |
2153 } | 2152 } |
2154 | 2153 |
2155 | 2154 |
2156 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetCode) { | 2155 RUNTIME_FUNCTION(MaybeObject*, Runtime_SetCode) { |
2157 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); | |
2158 HandleScope scope(isolate); | 2156 HandleScope scope(isolate); |
2159 ASSERT(args.length() == 2); | 2157 ASSERT(args.length() == 2); |
2160 | 2158 |
2161 CONVERT_ARG_CHECKED(JSFunction, target, 0); | 2159 CONVERT_ARG_CHECKED(JSFunction, target, 0); |
2162 Handle<Object> code = args.at<Object>(1); | 2160 Handle<Object> code = args.at<Object>(1); |
2163 | 2161 |
2164 Handle<Context> context(target->context()); | 2162 Handle<Context> context(target->context()); |
2165 | 2163 |
2166 if (!code->IsNull()) { | 2164 if (!code->IsNull()) { |
2167 RUNTIME_ASSERT(code->IsJSFunction()); | 2165 RUNTIME_ASSERT(code->IsJSFunction()); |
(...skipping 6083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8251 return Smi::FromInt(ast_id); | 8249 return Smi::FromInt(ast_id); |
8252 } else { | 8250 } else { |
8253 if (function->IsMarkedForLazyRecompilation()) { | 8251 if (function->IsMarkedForLazyRecompilation()) { |
8254 function->ReplaceCode(function->shared()->code()); | 8252 function->ReplaceCode(function->shared()->code()); |
8255 } | 8253 } |
8256 return Smi::FromInt(-1); | 8254 return Smi::FromInt(-1); |
8257 } | 8255 } |
8258 } | 8256 } |
8259 | 8257 |
8260 | 8258 |
8261 RUNTIME_FUNCTION(MaybeObject*, Runtime_CheckIsBootstrapping) { | |
8262 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive()); | |
8263 return isolate->heap()->undefined_value(); | |
8264 } | |
8265 | |
8266 | |
8267 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFunctionDelegate) { | 8259 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFunctionDelegate) { |
8268 HandleScope scope(isolate); | 8260 HandleScope scope(isolate); |
8269 ASSERT(args.length() == 1); | 8261 ASSERT(args.length() == 1); |
8270 RUNTIME_ASSERT(!args[0]->IsJSFunction()); | 8262 RUNTIME_ASSERT(!args[0]->IsJSFunction()); |
8271 return *Execution::GetFunctionDelegate(args.at<Object>(0)); | 8263 return *Execution::GetFunctionDelegate(args.at<Object>(0)); |
8272 } | 8264 } |
8273 | 8265 |
8274 | 8266 |
8275 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetConstructorDelegate) { | 8267 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetConstructorDelegate) { |
8276 HandleScope scope(isolate); | 8268 HandleScope scope(isolate); |
(...skipping 4724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13001 } else { | 12993 } else { |
13002 // Handle last resort GC and make sure to allow future allocations | 12994 // Handle last resort GC and make sure to allow future allocations |
13003 // to grow the heap without causing GCs (if possible). | 12995 // to grow the heap without causing GCs (if possible). |
13004 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12996 isolate->counters()->gc_last_resort_from_js()->Increment(); |
13005 isolate->heap()->CollectAllGarbage(false); | 12997 isolate->heap()->CollectAllGarbage(false); |
13006 } | 12998 } |
13007 } | 12999 } |
13008 | 13000 |
13009 | 13001 |
13010 } } // namespace v8::internal | 13002 } } // namespace v8::internal |
OLD | NEW |