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 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 bool use_runtime_context) { | 809 bool use_runtime_context) { |
810 HandleScope scope; | 810 HandleScope scope; |
811 Handle<JSFunction> boilerplate; | 811 Handle<JSFunction> boilerplate; |
812 | 812 |
813 // If we can't find the function in the cache, we compile a new | 813 // If we can't find the function in the cache, we compile a new |
814 // function and insert it into the cache. | 814 // function and insert it into the cache. |
815 if (!cache->Lookup(name, &boilerplate)) { | 815 if (!cache->Lookup(name, &boilerplate)) { |
816 ASSERT(source->IsAsciiRepresentation()); | 816 ASSERT(source->IsAsciiRepresentation()); |
817 Handle<String> script_name = Factory::NewStringFromUtf8(name); | 817 Handle<String> script_name = Factory::NewStringFromUtf8(name); |
818 boilerplate = | 818 boilerplate = |
819 Compiler::Compile(source, script_name, 0, 0, extension, NULL, | 819 Compiler::Compile( |
820 Handle<String>::null()); | 820 source, |
| 821 script_name, |
| 822 0, |
| 823 0, |
| 824 extension, |
| 825 NULL, |
| 826 Handle<String>::null(), |
| 827 use_runtime_context ? NATIVES_CODE : NOT_NATIVES_CODE); |
821 if (boilerplate.is_null()) return false; | 828 if (boilerplate.is_null()) return false; |
822 cache->Add(name, boilerplate); | 829 cache->Add(name, boilerplate); |
823 } | 830 } |
824 | 831 |
825 // Setup the function context. Conceptually, we should clone the | 832 // Setup the function context. Conceptually, we should clone the |
826 // function before overwriting the context but since we're in a | 833 // function before overwriting the context but since we're in a |
827 // single-threaded environment it is not strictly necessary. | 834 // single-threaded environment it is not strictly necessary. |
828 ASSERT(Top::context()->IsGlobalContext()); | 835 ASSERT(Top::context()->IsGlobalContext()); |
829 Handle<Context> context = | 836 Handle<Context> context = |
830 Handle<Context>(use_runtime_context | 837 Handle<Context>(use_runtime_context |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 } | 1530 } |
1524 | 1531 |
1525 | 1532 |
1526 // Restore statics that are thread local. | 1533 // Restore statics that are thread local. |
1527 char* Genesis::RestoreState(char* from) { | 1534 char* Genesis::RestoreState(char* from) { |
1528 current_ = *reinterpret_cast<Genesis**>(from); | 1535 current_ = *reinterpret_cast<Genesis**>(from); |
1529 return from + sizeof(current_); | 1536 return from + sizeof(current_); |
1530 } | 1537 } |
1531 | 1538 |
1532 } } // namespace v8::internal | 1539 } } // namespace v8::internal |
OLD | NEW |