| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 } | 885 } |
| 886 | 886 |
| 887 // array_function is used internally. JS code creating array object should | 887 // array_function is used internally. JS code creating array object should |
| 888 // search for the 'Array' property on the global object and use that one | 888 // search for the 'Array' property on the global object and use that one |
| 889 // as the constructor. 'Array' property on a global object can be | 889 // as the constructor. 'Array' property on a global object can be |
| 890 // overwritten by JS code. | 890 // overwritten by JS code. |
| 891 native_context()->set_array_function(*array_function); | 891 native_context()->set_array_function(*array_function); |
| 892 | 892 |
| 893 if (FLAG_optimize_constructed_arrays) { | 893 if (FLAG_optimize_constructed_arrays) { |
| 894 // Cache the array maps, needed by ArrayConstructorStub | 894 // Cache the array maps, needed by ArrayConstructorStub |
| 895 MaybeObject* cache_result = CacheInitialJSArrayMaps(*native_context(), | 895 CacheInitialJSArrayMaps(native_context(), initial_map); |
| 896 *initial_map); | |
| 897 if (cache_result->IsFailure()) return false; | |
| 898 | |
| 899 ArrayConstructorStub array_constructor_stub(isolate); | 896 ArrayConstructorStub array_constructor_stub(isolate); |
| 900 Handle<Code> code = array_constructor_stub.GetCode(isolate); | 897 Handle<Code> code = array_constructor_stub.GetCode(isolate); |
| 901 array_function->shared()->set_construct_stub(*code); | 898 array_function->shared()->set_construct_stub(*code); |
| 902 } else { | 899 } else { |
| 903 array_function->shared()->set_construct_stub( | 900 array_function->shared()->set_construct_stub( |
| 904 isolate->builtins()->builtin(Builtins::kCommonArrayConstructCode)); | 901 isolate->builtins()->builtin(Builtins::kCommonArrayConstructCode)); |
| 905 } | 902 } |
| 906 } | 903 } |
| 907 | 904 |
| 908 { // --- N u m b e r --- | 905 { // --- N u m b e r --- |
| (...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2564 return from + sizeof(NestingCounterType); | 2561 return from + sizeof(NestingCounterType); |
| 2565 } | 2562 } |
| 2566 | 2563 |
| 2567 | 2564 |
| 2568 // Called when the top-level V8 mutex is destroyed. | 2565 // Called when the top-level V8 mutex is destroyed. |
| 2569 void Bootstrapper::FreeThreadResources() { | 2566 void Bootstrapper::FreeThreadResources() { |
| 2570 ASSERT(!IsActive()); | 2567 ASSERT(!IsActive()); |
| 2571 } | 2568 } |
| 2572 | 2569 |
| 2573 } } // namespace v8::internal | 2570 } } // namespace v8::internal |
| OLD | NEW |