| 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 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 Vector<const char> name = Natives::GetScriptName(i); | 1227 Vector<const char> name = Natives::GetScriptName(i); |
| 1228 if (!CompileBuiltin(i)) return false; | 1228 if (!CompileBuiltin(i)) return false; |
| 1229 // TODO(ager): We really only need to install the JS builtin | 1229 // TODO(ager): We really only need to install the JS builtin |
| 1230 // functions on the builtins object after compiling and running | 1230 // functions on the builtins object after compiling and running |
| 1231 // runtime.js. | 1231 // runtime.js. |
| 1232 if (!InstallJSBuiltins(builtins)) return false; | 1232 if (!InstallJSBuiltins(builtins)) return false; |
| 1233 } | 1233 } |
| 1234 | 1234 |
| 1235 InstallNativeFunctions(); | 1235 InstallNativeFunctions(); |
| 1236 | 1236 |
| 1237 // Store the map for the string prototype after the natives has been compiled |
| 1238 // and the String function has been setup. |
| 1239 Handle<JSFunction> string_function(global_context()->string_function()); |
| 1240 ASSERT(JSObject::cast( |
| 1241 string_function->initial_map()->prototype())->HasFastProperties()); |
| 1242 global_context()->set_string_function_prototype_map( |
| 1243 HeapObject::cast(string_function->initial_map()->prototype())->map()); |
| 1244 |
| 1237 InstallCustomCallGenerators(); | 1245 InstallCustomCallGenerators(); |
| 1238 | 1246 |
| 1239 // Install Function.prototype.call and apply. | 1247 // Install Function.prototype.call and apply. |
| 1240 { Handle<String> key = Factory::function_class_symbol(); | 1248 { Handle<String> key = Factory::function_class_symbol(); |
| 1241 Handle<JSFunction> function = | 1249 Handle<JSFunction> function = |
| 1242 Handle<JSFunction>::cast(GetProperty(Top::global(), key)); | 1250 Handle<JSFunction>::cast(GetProperty(Top::global(), key)); |
| 1243 Handle<JSObject> proto = | 1251 Handle<JSObject> proto = |
| 1244 Handle<JSObject>(JSObject::cast(function->instance_prototype())); | 1252 Handle<JSObject>(JSObject::cast(function->instance_prototype())); |
| 1245 | 1253 |
| 1246 // Install the call and the apply functions. | 1254 // Install the call and the apply functions. |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1810 } | 1818 } |
| 1811 | 1819 |
| 1812 | 1820 |
| 1813 // Restore statics that are thread local. | 1821 // Restore statics that are thread local. |
| 1814 char* BootstrapperActive::RestoreState(char* from) { | 1822 char* BootstrapperActive::RestoreState(char* from) { |
| 1815 nesting_ = *reinterpret_cast<int*>(from); | 1823 nesting_ = *reinterpret_cast<int*>(from); |
| 1816 return from + sizeof(nesting_); | 1824 return from + sizeof(nesting_); |
| 1817 } | 1825 } |
| 1818 | 1826 |
| 1819 } } // namespace v8::internal | 1827 } } // namespace v8::internal |
| OLD | NEW |