| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2716 | 2716 |
| 2717 HandleScope scope; | 2717 HandleScope scope; |
| 2718 Handle<Object> cons(constructor); | 2718 Handle<Object> cons(constructor); |
| 2719 // The constructor is not a function; throw a type error. | 2719 // The constructor is not a function; throw a type error. |
| 2720 Handle<Object> type_error = | 2720 Handle<Object> type_error = |
| 2721 Factory::NewTypeError("not_constructor", HandleVector(&cons, 1)); | 2721 Factory::NewTypeError("not_constructor", HandleVector(&cons, 1)); |
| 2722 return Top::Throw(*type_error); | 2722 return Top::Throw(*type_error); |
| 2723 } | 2723 } |
| 2724 | 2724 |
| 2725 | 2725 |
| 2726 #ifdef DEBUG | |
| 2727 DEFINE_bool(trace_lazy, false, "trace lazy compilation"); | |
| 2728 #endif | |
| 2729 | |
| 2730 | |
| 2731 static Object* Runtime_LazyCompile(Arguments args) { | 2726 static Object* Runtime_LazyCompile(Arguments args) { |
| 2732 HandleScope scope; | 2727 HandleScope scope; |
| 2733 ASSERT(args.length() == 1); | 2728 ASSERT(args.length() == 1); |
| 2734 | 2729 |
| 2735 Handle<JSFunction> function = args.at<JSFunction>(0); | 2730 Handle<JSFunction> function = args.at<JSFunction>(0); |
| 2736 #ifdef DEBUG | 2731 #ifdef DEBUG |
| 2737 if (FLAG_trace_lazy) { | 2732 if (FLAG_trace_lazy) { |
| 2738 PrintF("[lazy: "); | 2733 PrintF("[lazy: "); |
| 2739 function->shared()->name()->Print(); | 2734 function->shared()->name()->Print(); |
| 2740 PrintF("]\n"); | 2735 PrintF("]\n"); |
| (...skipping 2224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4965 | 4960 |
| 4966 void Runtime::PerformGC(Object* result) { | 4961 void Runtime::PerformGC(Object* result) { |
| 4967 Failure* failure = Failure::cast(result); | 4962 Failure* failure = Failure::cast(result); |
| 4968 // Try to do a garbage collection; ignore it if it fails. The C | 4963 // Try to do a garbage collection; ignore it if it fails. The C |
| 4969 // entry stub will throw an out-of-memory exception in that case. | 4964 // entry stub will throw an out-of-memory exception in that case. |
| 4970 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); | 4965 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); |
| 4971 } | 4966 } |
| 4972 | 4967 |
| 4973 | 4968 |
| 4974 } } // namespace v8::internal | 4969 } } // namespace v8::internal |
| OLD | NEW |