| 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 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 InstallNativeFunctions(); | 1541 InstallNativeFunctions(); |
| 1542 | 1542 |
| 1543 // Store the map for the string prototype after the natives has been compiled | 1543 // Store the map for the string prototype after the natives has been compiled |
| 1544 // and the String function has been setup. | 1544 // and the String function has been setup. |
| 1545 Handle<JSFunction> string_function(global_context()->string_function()); | 1545 Handle<JSFunction> string_function(global_context()->string_function()); |
| 1546 ASSERT(JSObject::cast( | 1546 ASSERT(JSObject::cast( |
| 1547 string_function->initial_map()->prototype())->HasFastProperties()); | 1547 string_function->initial_map()->prototype())->HasFastProperties()); |
| 1548 global_context()->set_string_function_prototype_map( | 1548 global_context()->set_string_function_prototype_map( |
| 1549 HeapObject::cast(string_function->initial_map()->prototype())->map()); | 1549 HeapObject::cast(string_function->initial_map()->prototype())->map()); |
| 1550 | 1550 |
| 1551 InstallBuiltinFunctionIds(); | |
| 1552 | |
| 1553 // Install Function.prototype.call and apply. | 1551 // Install Function.prototype.call and apply. |
| 1554 { Handle<String> key = factory()->function_class_symbol(); | 1552 { Handle<String> key = factory()->function_class_symbol(); |
| 1555 Handle<JSFunction> function = | 1553 Handle<JSFunction> function = |
| 1556 Handle<JSFunction>::cast(GetProperty(isolate()->global(), key)); | 1554 Handle<JSFunction>::cast(GetProperty(isolate()->global(), key)); |
| 1557 Handle<JSObject> proto = | 1555 Handle<JSObject> proto = |
| 1558 Handle<JSObject>(JSObject::cast(function->instance_prototype())); | 1556 Handle<JSObject>(JSObject::cast(function->instance_prototype())); |
| 1559 | 1557 |
| 1560 // Install the call and the apply functions. | 1558 // Install the call and the apply functions. |
| 1561 Handle<JSFunction> call = | 1559 Handle<JSFunction> call = |
| 1562 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1560 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1576 ASSERT(call->is_compiled()); | 1574 ASSERT(call->is_compiled()); |
| 1577 | 1575 |
| 1578 // Set the expected parameters for apply to 2; required by builtin. | 1576 // Set the expected parameters for apply to 2; required by builtin. |
| 1579 apply->shared()->set_formal_parameter_count(2); | 1577 apply->shared()->set_formal_parameter_count(2); |
| 1580 | 1578 |
| 1581 // Set the lengths for the functions to satisfy ECMA-262. | 1579 // Set the lengths for the functions to satisfy ECMA-262. |
| 1582 call->shared()->set_length(1); | 1580 call->shared()->set_length(1); |
| 1583 apply->shared()->set_length(2); | 1581 apply->shared()->set_length(2); |
| 1584 } | 1582 } |
| 1585 | 1583 |
| 1584 InstallBuiltinFunctionIds(); |
| 1585 |
| 1586 // Create a constructor for RegExp results (a variant of Array that | 1586 // Create a constructor for RegExp results (a variant of Array that |
| 1587 // predefines the two properties index and match). | 1587 // predefines the two properties index and match). |
| 1588 { | 1588 { |
| 1589 // RegExpResult initial map. | 1589 // RegExpResult initial map. |
| 1590 | 1590 |
| 1591 // Find global.Array.prototype to inherit from. | 1591 // Find global.Array.prototype to inherit from. |
| 1592 Handle<JSFunction> array_constructor(global_context()->array_function()); | 1592 Handle<JSFunction> array_constructor(global_context()->array_function()); |
| 1593 Handle<JSObject> array_prototype( | 1593 Handle<JSObject> array_prototype( |
| 1594 JSObject::cast(array_constructor->instance_prototype())); | 1594 JSObject::cast(array_constructor->instance_prototype())); |
| 1595 | 1595 |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2175 return from + sizeof(NestingCounterType); | 2175 return from + sizeof(NestingCounterType); |
| 2176 } | 2176 } |
| 2177 | 2177 |
| 2178 | 2178 |
| 2179 // Called when the top-level V8 mutex is destroyed. | 2179 // Called when the top-level V8 mutex is destroyed. |
| 2180 void Bootstrapper::FreeThreadResources() { | 2180 void Bootstrapper::FreeThreadResources() { |
| 2181 ASSERT(!IsActive()); | 2181 ASSERT(!IsActive()); |
| 2182 } | 2182 } |
| 2183 | 2183 |
| 2184 } } // namespace v8::internal | 2184 } } // namespace v8::internal |
| OLD | NEW |