| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 InstallNativeFunctions(); | 1564 InstallNativeFunctions(); |
| 1565 | 1565 |
| 1566 // Store the map for the string prototype after the natives has been compiled | 1566 // Store the map for the string prototype after the natives has been compiled |
| 1567 // and the String function has been setup. | 1567 // and the String function has been setup. |
| 1568 Handle<JSFunction> string_function(global_context()->string_function()); | 1568 Handle<JSFunction> string_function(global_context()->string_function()); |
| 1569 ASSERT(JSObject::cast( | 1569 ASSERT(JSObject::cast( |
| 1570 string_function->initial_map()->prototype())->HasFastProperties()); | 1570 string_function->initial_map()->prototype())->HasFastProperties()); |
| 1571 global_context()->set_string_function_prototype_map( | 1571 global_context()->set_string_function_prototype_map( |
| 1572 HeapObject::cast(string_function->initial_map()->prototype())->map()); | 1572 HeapObject::cast(string_function->initial_map()->prototype())->map()); |
| 1573 | 1573 |
| 1574 InstallBuiltinFunctionIds(); | |
| 1575 | |
| 1576 // Install Function.prototype.call and apply. | 1574 // Install Function.prototype.call and apply. |
| 1577 { Handle<String> key = factory()->function_class_symbol(); | 1575 { Handle<String> key = factory()->function_class_symbol(); |
| 1578 Handle<JSFunction> function = | 1576 Handle<JSFunction> function = |
| 1579 Handle<JSFunction>::cast(GetProperty(isolate()->global(), key)); | 1577 Handle<JSFunction>::cast(GetProperty(isolate()->global(), key)); |
| 1580 Handle<JSObject> proto = | 1578 Handle<JSObject> proto = |
| 1581 Handle<JSObject>(JSObject::cast(function->instance_prototype())); | 1579 Handle<JSObject>(JSObject::cast(function->instance_prototype())); |
| 1582 | 1580 |
| 1583 // Install the call and the apply functions. | 1581 // Install the call and the apply functions. |
| 1584 Handle<JSFunction> call = | 1582 Handle<JSFunction> call = |
| 1585 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1583 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1599 ASSERT(call->is_compiled()); | 1597 ASSERT(call->is_compiled()); |
| 1600 | 1598 |
| 1601 // Set the expected parameters for apply to 2; required by builtin. | 1599 // Set the expected parameters for apply to 2; required by builtin. |
| 1602 apply->shared()->set_formal_parameter_count(2); | 1600 apply->shared()->set_formal_parameter_count(2); |
| 1603 | 1601 |
| 1604 // Set the lengths for the functions to satisfy ECMA-262. | 1602 // Set the lengths for the functions to satisfy ECMA-262. |
| 1605 call->shared()->set_length(1); | 1603 call->shared()->set_length(1); |
| 1606 apply->shared()->set_length(2); | 1604 apply->shared()->set_length(2); |
| 1607 } | 1605 } |
| 1608 | 1606 |
| 1607 InstallBuiltinFunctionIds(); |
| 1608 |
| 1609 // Create a constructor for RegExp results (a variant of Array that | 1609 // Create a constructor for RegExp results (a variant of Array that |
| 1610 // predefines the two properties index and match). | 1610 // predefines the two properties index and match). |
| 1611 { | 1611 { |
| 1612 // RegExpResult initial map. | 1612 // RegExpResult initial map. |
| 1613 | 1613 |
| 1614 // Find global.Array.prototype to inherit from. | 1614 // Find global.Array.prototype to inherit from. |
| 1615 Handle<JSFunction> array_constructor(global_context()->array_function()); | 1615 Handle<JSFunction> array_constructor(global_context()->array_function()); |
| 1616 Handle<JSObject> array_prototype( | 1616 Handle<JSObject> array_prototype( |
| 1617 JSObject::cast(array_constructor->instance_prototype())); | 1617 JSObject::cast(array_constructor->instance_prototype())); |
| 1618 | 1618 |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2198 return from + sizeof(NestingCounterType); | 2198 return from + sizeof(NestingCounterType); |
| 2199 } | 2199 } |
| 2200 | 2200 |
| 2201 | 2201 |
| 2202 // Called when the top-level V8 mutex is destroyed. | 2202 // Called when the top-level V8 mutex is destroyed. |
| 2203 void Bootstrapper::FreeThreadResources() { | 2203 void Bootstrapper::FreeThreadResources() { |
| 2204 ASSERT(!IsActive()); | 2204 ASSERT(!IsActive()); |
| 2205 } | 2205 } |
| 2206 | 2206 |
| 2207 } } // namespace v8::internal | 2207 } } // namespace v8::internal |
| OLD | NEW |