Chromium Code Reviews| 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 557 Builtins::Name builtin) { | 557 Builtins::Name builtin) { |
| 558 // Create the ThrowTypeError function. | 558 // Create the ThrowTypeError function. |
| 559 Handle<String> name = Factory::LookupAsciiSymbol("ThrowTypeError"); | 559 Handle<String> name = Factory::LookupAsciiSymbol("ThrowTypeError"); |
| 560 Handle<JSFunction> pill = Factory::NewFunctionWithoutPrototypeStrict(name); | 560 Handle<JSFunction> pill = Factory::NewFunctionWithoutPrototypeStrict(name); |
| 561 Handle<Code> code = Handle<Code>(Builtins::builtin(builtin)); | 561 Handle<Code> code = Handle<Code>(Builtins::builtin(builtin)); |
| 562 pill->set_map(global_context()->function_map_strict()); | 562 pill->set_map(global_context()->function_map_strict()); |
| 563 pill->set_code(*code); | 563 pill->set_code(*code); |
| 564 pill->shared()->set_code(*code); | 564 pill->shared()->set_code(*code); |
| 565 pill->shared()->DontAdaptArguments(); | 565 pill->shared()->DontAdaptArguments(); |
| 566 | 566 |
| 567 PreventExtensions(pill); | |
| 568 | |
|
Martin Maly
2011/03/15 03:08:57
For some reason this felt cleaner, to freeze first
Mads Ager (chromium)
2011/03/15 08:49:54
I agree. :)
| |
| 567 // Install the poison pills into the calbacks array. | 569 // Install the poison pills into the calbacks array. |
| 568 callbacks->set(0, *pill); | 570 callbacks->set(0, *pill); |
| 569 callbacks->set(1, *pill); | 571 callbacks->set(1, *pill); |
| 570 | |
| 571 PreventExtensions(pill); | |
| 572 } | 572 } |
| 573 | 573 |
| 574 | 574 |
| 575 // ECMAScript 5th Edition, 13.2.3 | 575 // ECMAScript 5th Edition, 13.2.3 |
| 576 void Genesis::CreateThrowTypeError(Handle<JSFunction> empty) { | 576 void Genesis::CreateThrowTypeError(Handle<JSFunction> empty) { |
| 577 // Create the pill callbacks arrays. The get/set callacks are installed | 577 // Create the pill callbacks arrays. The get/set callacks are installed |
| 578 // after the maps get created below. | 578 // after the maps get created below. |
| 579 Handle<FixedArray> arguments = Factory::NewFixedArray(2, TENURED); | 579 Handle<FixedArray> arguments = Factory::NewFixedArray(2, TENURED); |
| 580 Handle<FixedArray> caller = Factory::NewFixedArray(2, TENURED); | 580 Handle<FixedArray> caller = Factory::NewFixedArray(2, TENURED); |
| 581 | 581 |
| (...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2033 } | 2033 } |
| 2034 | 2034 |
| 2035 | 2035 |
| 2036 // Restore statics that are thread local. | 2036 // Restore statics that are thread local. |
| 2037 char* BootstrapperActive::RestoreState(char* from) { | 2037 char* BootstrapperActive::RestoreState(char* from) { |
| 2038 nesting_ = *reinterpret_cast<int*>(from); | 2038 nesting_ = *reinterpret_cast<int*>(from); |
| 2039 return from + sizeof(nesting_); | 2039 return from + sizeof(nesting_); |
| 2040 } | 2040 } |
| 2041 | 2041 |
| 2042 } } // namespace v8::internal | 2042 } } // namespace v8::internal |
| OLD | NEW |