OLD | NEW |
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 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 NoHandleAllocation ha; | 1201 NoHandleAllocation ha; |
1202 ASSERT(args.length() == 1); | 1202 ASSERT(args.length() == 1); |
1203 | 1203 |
1204 CONVERT_CHECKED(JSFunction, f, args[0]); | 1204 CONVERT_CHECKED(JSFunction, f, args[0]); |
1205 // The function_data field of the shared function info is used exclusively by | 1205 // The function_data field of the shared function info is used exclusively by |
1206 // the API. | 1206 // the API. |
1207 return !f->shared()->function_data()->IsUndefined() ? Heap::true_value() | 1207 return !f->shared()->function_data()->IsUndefined() ? Heap::true_value() |
1208 : Heap::false_value(); | 1208 : Heap::false_value(); |
1209 } | 1209 } |
1210 | 1210 |
| 1211 static Object* Runtime_FunctionIsBuiltin(Arguments args) { |
| 1212 NoHandleAllocation ha; |
| 1213 ASSERT(args.length() == 1); |
| 1214 |
| 1215 CONVERT_CHECKED(JSFunction, f, args[0]); |
| 1216 return f->IsBuiltin() ? Heap::true_value() : Heap::false_value(); |
| 1217 } |
| 1218 |
1211 | 1219 |
1212 static Object* Runtime_SetCode(Arguments args) { | 1220 static Object* Runtime_SetCode(Arguments args) { |
1213 HandleScope scope; | 1221 HandleScope scope; |
1214 ASSERT(args.length() == 2); | 1222 ASSERT(args.length() == 2); |
1215 | 1223 |
1216 CONVERT_ARG_CHECKED(JSFunction, target, 0); | 1224 CONVERT_ARG_CHECKED(JSFunction, target, 0); |
1217 Handle<Object> code = args.at<Object>(1); | 1225 Handle<Object> code = args.at<Object>(1); |
1218 | 1226 |
1219 Handle<Context> context(target->context()); | 1227 Handle<Context> context(target->context()); |
1220 | 1228 |
(...skipping 6501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7722 } else { | 7730 } else { |
7723 // Handle last resort GC and make sure to allow future allocations | 7731 // Handle last resort GC and make sure to allow future allocations |
7724 // to grow the heap without causing GCs (if possible). | 7732 // to grow the heap without causing GCs (if possible). |
7725 Counters::gc_last_resort_from_js.Increment(); | 7733 Counters::gc_last_resort_from_js.Increment(); |
7726 Heap::CollectAllGarbage(false); | 7734 Heap::CollectAllGarbage(false); |
7727 } | 7735 } |
7728 } | 7736 } |
7729 | 7737 |
7730 | 7738 |
7731 } } // namespace v8::internal | 7739 } } // namespace v8::internal |
OLD | NEW |