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 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 bool use_runtime_context) { | 935 bool use_runtime_context) { |
936 HandleScope scope; | 936 HandleScope scope; |
937 Handle<JSFunction> boilerplate; | 937 Handle<JSFunction> boilerplate; |
938 | 938 |
939 // If we can't find the function in the cache, we compile a new | 939 // If we can't find the function in the cache, we compile a new |
940 // function and insert it into the cache. | 940 // function and insert it into the cache. |
941 if (!cache->Lookup(name, &boilerplate)) { | 941 if (!cache->Lookup(name, &boilerplate)) { |
942 ASSERT(source->IsAsciiRepresentation()); | 942 ASSERT(source->IsAsciiRepresentation()); |
943 Handle<String> script_name = Factory::NewStringFromUtf8(name); | 943 Handle<String> script_name = Factory::NewStringFromUtf8(name); |
944 boilerplate = | 944 boilerplate = |
945 Compiler::Compile(source, script_name, 0, 0, extension, NULL); | 945 Compiler::Compile(source, script_name, 0, 0, extension, NULL, |
| 946 Handle<String>::null()); |
946 if (boilerplate.is_null()) return false; | 947 if (boilerplate.is_null()) return false; |
947 cache->Add(name, boilerplate); | 948 cache->Add(name, boilerplate); |
948 } | 949 } |
949 | 950 |
950 // Setup the function context. Conceptually, we should clone the | 951 // Setup the function context. Conceptually, we should clone the |
951 // function before overwriting the context but since we're in a | 952 // function before overwriting the context but since we're in a |
952 // single-threaded environment it is not strictly necessary. | 953 // single-threaded environment it is not strictly necessary. |
953 ASSERT(Top::context()->IsGlobalContext()); | 954 ASSERT(Top::context()->IsGlobalContext()); |
954 Handle<Context> context = | 955 Handle<Context> context = |
955 Handle<Context>(use_runtime_context | 956 Handle<Context>(use_runtime_context |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 } | 1670 } |
1670 | 1671 |
1671 | 1672 |
1672 // Restore statics that are thread local. | 1673 // Restore statics that are thread local. |
1673 char* Genesis::RestoreState(char* from) { | 1674 char* Genesis::RestoreState(char* from) { |
1674 current_ = *reinterpret_cast<Genesis**>(from); | 1675 current_ = *reinterpret_cast<Genesis**>(from); |
1675 return from + sizeof(current_); | 1676 return from + sizeof(current_); |
1676 } | 1677 } |
1677 | 1678 |
1678 } } // namespace v8::internal | 1679 } } // namespace v8::internal |
OLD | NEW |