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 4338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4349 | 4349 |
4350 | 4350 |
4351 static Object* Runtime_GetFunctionDelegate(Arguments args) { | 4351 static Object* Runtime_GetFunctionDelegate(Arguments args) { |
4352 HandleScope scope; | 4352 HandleScope scope; |
4353 ASSERT(args.length() == 1); | 4353 ASSERT(args.length() == 1); |
4354 RUNTIME_ASSERT(!args[0]->IsJSFunction()); | 4354 RUNTIME_ASSERT(!args[0]->IsJSFunction()); |
4355 return *Execution::GetFunctionDelegate(args.at<Object>(0)); | 4355 return *Execution::GetFunctionDelegate(args.at<Object>(0)); |
4356 } | 4356 } |
4357 | 4357 |
4358 | 4358 |
| 4359 static Object* Runtime_GetConstructorDelegate(Arguments args) { |
| 4360 HandleScope scope; |
| 4361 ASSERT(args.length() == 1); |
| 4362 RUNTIME_ASSERT(!args[0]->IsJSFunction()); |
| 4363 return *Execution::GetConstructorDelegate(args.at<Object>(0)); |
| 4364 } |
| 4365 |
| 4366 |
4359 static Object* Runtime_NewContext(Arguments args) { | 4367 static Object* Runtime_NewContext(Arguments args) { |
4360 NoHandleAllocation ha; | 4368 NoHandleAllocation ha; |
4361 ASSERT(args.length() == 1); | 4369 ASSERT(args.length() == 1); |
4362 | 4370 |
4363 CONVERT_CHECKED(JSFunction, function, args[0]); | 4371 CONVERT_CHECKED(JSFunction, function, args[0]); |
4364 int length = ScopeInfo<>::NumberOfContextSlots(function->code()); | 4372 int length = ScopeInfo<>::NumberOfContextSlots(function->code()); |
4365 Object* result = Heap::AllocateFunctionContext(length, function); | 4373 Object* result = Heap::AllocateFunctionContext(length, function); |
4366 if (result->IsFailure()) return result; | 4374 if (result->IsFailure()) return result; |
4367 | 4375 |
4368 Top::set_context(Context::cast(result)); | 4376 Top::set_context(Context::cast(result)); |
(...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7083 } else { | 7091 } else { |
7084 // Handle last resort GC and make sure to allow future allocations | 7092 // Handle last resort GC and make sure to allow future allocations |
7085 // to grow the heap without causing GCs (if possible). | 7093 // to grow the heap without causing GCs (if possible). |
7086 Counters::gc_last_resort_from_js.Increment(); | 7094 Counters::gc_last_resort_from_js.Increment(); |
7087 Heap::CollectAllGarbage(); | 7095 Heap::CollectAllGarbage(); |
7088 } | 7096 } |
7089 } | 7097 } |
7090 | 7098 |
7091 | 7099 |
7092 } } // namespace v8::internal | 7100 } } // namespace v8::internal |
OLD | NEW |