| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 InstallNativeFunctions(); | 1519 InstallNativeFunctions(); |
| 1520 | 1520 |
| 1521 // Store the map for the string prototype after the natives has been compiled | 1521 // Store the map for the string prototype after the natives has been compiled |
| 1522 // and the String function has been setup. | 1522 // and the String function has been setup. |
| 1523 Handle<JSFunction> string_function(global_context()->string_function()); | 1523 Handle<JSFunction> string_function(global_context()->string_function()); |
| 1524 ASSERT(JSObject::cast( | 1524 ASSERT(JSObject::cast( |
| 1525 string_function->initial_map()->prototype())->HasFastProperties()); | 1525 string_function->initial_map()->prototype())->HasFastProperties()); |
| 1526 global_context()->set_string_function_prototype_map( | 1526 global_context()->set_string_function_prototype_map( |
| 1527 HeapObject::cast(string_function->initial_map()->prototype())->map()); | 1527 HeapObject::cast(string_function->initial_map()->prototype())->map()); |
| 1528 | 1528 |
| 1529 InstallBuiltinFunctionIds(); | |
| 1530 | |
| 1531 // Install Function.prototype.call and apply. | 1529 // Install Function.prototype.call and apply. |
| 1532 { Handle<String> key = factory->function_class_symbol(); | 1530 { Handle<String> key = factory->function_class_symbol(); |
| 1533 Handle<JSFunction> function = | 1531 Handle<JSFunction> function = |
| 1534 Handle<JSFunction>::cast(GetProperty(isolate->global(), key)); | 1532 Handle<JSFunction>::cast(GetProperty(isolate->global(), key)); |
| 1535 Handle<JSObject> proto = | 1533 Handle<JSObject> proto = |
| 1536 Handle<JSObject>(JSObject::cast(function->instance_prototype())); | 1534 Handle<JSObject>(JSObject::cast(function->instance_prototype())); |
| 1537 | 1535 |
| 1538 // Install the call and the apply functions. | 1536 // Install the call and the apply functions. |
| 1539 Handle<JSFunction> call = | 1537 Handle<JSFunction> call = |
| 1540 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1538 InstallFunction(proto, "call", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1554 ASSERT(call->is_compiled()); | 1552 ASSERT(call->is_compiled()); |
| 1555 | 1553 |
| 1556 // Set the expected parameters for apply to 2; required by builtin. | 1554 // Set the expected parameters for apply to 2; required by builtin. |
| 1557 apply->shared()->set_formal_parameter_count(2); | 1555 apply->shared()->set_formal_parameter_count(2); |
| 1558 | 1556 |
| 1559 // Set the lengths for the functions to satisfy ECMA-262. | 1557 // Set the lengths for the functions to satisfy ECMA-262. |
| 1560 call->shared()->set_length(1); | 1558 call->shared()->set_length(1); |
| 1561 apply->shared()->set_length(2); | 1559 apply->shared()->set_length(2); |
| 1562 } | 1560 } |
| 1563 | 1561 |
| 1562 InstallBuiltinFunctionIds(); |
| 1563 |
| 1564 // Create a constructor for RegExp results (a variant of Array that | 1564 // Create a constructor for RegExp results (a variant of Array that |
| 1565 // predefines the two properties index and match). | 1565 // predefines the two properties index and match). |
| 1566 { | 1566 { |
| 1567 // RegExpResult initial map. | 1567 // RegExpResult initial map. |
| 1568 | 1568 |
| 1569 // Find global.Array.prototype to inherit from. | 1569 // Find global.Array.prototype to inherit from. |
| 1570 Handle<JSFunction> array_constructor(global_context()->array_function()); | 1570 Handle<JSFunction> array_constructor(global_context()->array_function()); |
| 1571 Handle<JSObject> array_prototype( | 1571 Handle<JSObject> array_prototype( |
| 1572 JSObject::cast(array_constructor->instance_prototype())); | 1572 JSObject::cast(array_constructor->instance_prototype())); |
| 1573 | 1573 |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 return from + sizeof(NestingCounterType); | 2129 return from + sizeof(NestingCounterType); |
| 2130 } | 2130 } |
| 2131 | 2131 |
| 2132 | 2132 |
| 2133 // Called when the top-level V8 mutex is destroyed. | 2133 // Called when the top-level V8 mutex is destroyed. |
| 2134 void Bootstrapper::FreeThreadResources() { | 2134 void Bootstrapper::FreeThreadResources() { |
| 2135 ASSERT(!IsActive()); | 2135 ASSERT(!IsActive()); |
| 2136 } | 2136 } |
| 2137 | 2137 |
| 2138 } } // namespace v8::internal | 2138 } } // namespace v8::internal |
| OLD | NEW |