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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 name, | 1477 name, |
1478 JS_ARRAY_TYPE, | 1478 JS_ARRAY_TYPE, |
1479 JSArray::kSize, | 1479 JSArray::kSize, |
1480 isolate()->initial_object_prototype(), | 1480 isolate()->initial_object_prototype(), |
1481 Builtins::kInternalArrayCode, | 1481 Builtins::kInternalArrayCode, |
1482 true); | 1482 true); |
1483 Handle<JSObject> prototype = | 1483 Handle<JSObject> prototype = |
1484 factory()->NewJSObject(isolate()->object_function(), TENURED); | 1484 factory()->NewJSObject(isolate()->object_function(), TENURED); |
1485 SetPrototype(array_function, prototype); | 1485 SetPrototype(array_function, prototype); |
1486 | 1486 |
| 1487 // TODO(mvstanton): For performance reasons, this code would have to |
| 1488 // be changed to successfully run with FLAG_optimize_constructed_arrays. |
| 1489 // The next checkin to enable FLAG_optimize_constructed_arrays by |
| 1490 // default will address this. |
| 1491 CHECK(!FLAG_optimize_constructed_arrays); |
1487 array_function->shared()->set_construct_stub( | 1492 array_function->shared()->set_construct_stub( |
1488 isolate()->builtins()->builtin(Builtins::kArrayConstructCode)); | 1493 isolate()->builtins()->builtin(Builtins::kArrayConstructCode)); |
| 1494 |
1489 array_function->shared()->DontAdaptArguments(); | 1495 array_function->shared()->DontAdaptArguments(); |
1490 | 1496 |
1491 MaybeObject* maybe_map = array_function->initial_map()->Copy(); | 1497 MaybeObject* maybe_map = array_function->initial_map()->Copy(); |
1492 Map* new_map; | 1498 Map* new_map; |
1493 if (!maybe_map->To(&new_map)) return Handle<JSFunction>::null(); | 1499 if (!maybe_map->To(&new_map)) return Handle<JSFunction>::null(); |
1494 new_map->set_elements_kind(elements_kind); | 1500 new_map->set_elements_kind(elements_kind); |
1495 array_function->set_initial_map(new_map); | 1501 array_function->set_initial_map(new_map); |
1496 | 1502 |
1497 // Make "length" magic on instances. | 1503 // Make "length" magic on instances. |
1498 Handle<Map> initial_map(array_function->initial_map()); | 1504 Handle<Map> initial_map(array_function->initial_map()); |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2482 return from + sizeof(NestingCounterType); | 2488 return from + sizeof(NestingCounterType); |
2483 } | 2489 } |
2484 | 2490 |
2485 | 2491 |
2486 // Called when the top-level V8 mutex is destroyed. | 2492 // Called when the top-level V8 mutex is destroyed. |
2487 void Bootstrapper::FreeThreadResources() { | 2493 void Bootstrapper::FreeThreadResources() { |
2488 ASSERT(!IsActive()); | 2494 ASSERT(!IsActive()); |
2489 } | 2495 } |
2490 | 2496 |
2491 } } // namespace v8::internal | 2497 } } // namespace v8::internal |
OLD | NEW |