| 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 4298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4309 Vector< Handle<Object> > arguments = HandleVector(&constructor, 1); | 4309 Vector< Handle<Object> > arguments = HandleVector(&constructor, 1); |
| 4310 Handle<Object> type_error = | 4310 Handle<Object> type_error = |
| 4311 Factory::NewTypeError("not_constructor", arguments); | 4311 Factory::NewTypeError("not_constructor", arguments); |
| 4312 return Top::Throw(*type_error); | 4312 return Top::Throw(*type_error); |
| 4313 } | 4313 } |
| 4314 | 4314 |
| 4315 Handle<JSFunction> function = Handle<JSFunction>::cast(constructor); | 4315 Handle<JSFunction> function = Handle<JSFunction>::cast(constructor); |
| 4316 #ifdef ENABLE_DEBUGGER_SUPPORT | 4316 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 4317 // Handle stepping into constructors if step into is active. | 4317 // Handle stepping into constructors if step into is active. |
| 4318 if (Debug::StepInActive()) { | 4318 if (Debug::StepInActive()) { |
| 4319 Debug::HandleStepIn(function, 0, true); | 4319 Debug::HandleStepIn(function, Handle<Object>::null(), 0, true); |
| 4320 } | 4320 } |
| 4321 #endif | 4321 #endif |
| 4322 | 4322 |
| 4323 if (function->has_initial_map()) { | 4323 if (function->has_initial_map()) { |
| 4324 if (function->initial_map()->instance_type() == JS_FUNCTION_TYPE) { | 4324 if (function->initial_map()->instance_type() == JS_FUNCTION_TYPE) { |
| 4325 // The 'Function' function ignores the receiver object when | 4325 // The 'Function' function ignores the receiver object when |
| 4326 // called using 'new' and creates a new JSFunction object that | 4326 // called using 'new' and creates a new JSFunction object that |
| 4327 // is returned. The receiver object is only used for error | 4327 // is returned. The receiver object is only used for error |
| 4328 // reporting if an error occurs when constructing the new | 4328 // reporting if an error occurs when constructing the new |
| 4329 // JSFunction. Factory::NewJSObject() should not be used to | 4329 // JSFunction. Factory::NewJSObject() should not be used to |
| (...skipping 3229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7559 } else { | 7559 } else { |
| 7560 // Handle last resort GC and make sure to allow future allocations | 7560 // Handle last resort GC and make sure to allow future allocations |
| 7561 // to grow the heap without causing GCs (if possible). | 7561 // to grow the heap without causing GCs (if possible). |
| 7562 Counters::gc_last_resort_from_js.Increment(); | 7562 Counters::gc_last_resort_from_js.Increment(); |
| 7563 Heap::CollectAllGarbage(); | 7563 Heap::CollectAllGarbage(); |
| 7564 } | 7564 } |
| 7565 } | 7565 } |
| 7566 | 7566 |
| 7567 | 7567 |
| 7568 } } // namespace v8::internal | 7568 } } // namespace v8::internal |
| OLD | NEW |