OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1931 return false; | 1931 return false; |
1932 } | 1932 } |
1933 ASSERT(current->state() == v8::UNVISITED); | 1933 ASSERT(current->state() == v8::UNVISITED); |
1934 current->set_state(v8::VISITED); | 1934 current->set_state(v8::VISITED); |
1935 v8::Extension* extension = current->extension(); | 1935 v8::Extension* extension = current->extension(); |
1936 // Install the extension's dependencies | 1936 // Install the extension's dependencies |
1937 for (int i = 0; i < extension->dependency_count(); i++) { | 1937 for (int i = 0; i < extension->dependency_count(); i++) { |
1938 if (!InstallExtension(extension->dependencies()[i])) return false; | 1938 if (!InstallExtension(extension->dependencies()[i])) return false; |
1939 } | 1939 } |
1940 Isolate* isolate = Isolate::Current(); | 1940 Isolate* isolate = Isolate::Current(); |
1941 Vector<const char> source = CStrVector(extension->source()); | 1941 bool result = CompileScriptCached( |
1942 Handle<String> source_code = isolate->factory()->NewStringFromAscii(source); | 1942 CStrVector(extension->name()), |
1943 bool result = CompileScriptCached(CStrVector(extension->name()), | 1943 isolate->factory()->NewExternalStringFromAscii(extension->source()), |
1944 source_code, | 1944 isolate->bootstrapper()->extensions_cache(), |
1945 isolate->bootstrapper()->extensions_cache(), | 1945 extension, |
1946 extension, | 1946 Handle<Context>(isolate->context()), |
1947 Handle<Context>(isolate->context()), | 1947 false); |
1948 false); | |
1949 ASSERT(isolate->has_pending_exception() != result); | 1948 ASSERT(isolate->has_pending_exception() != result); |
1950 if (!result) { | 1949 if (!result) { |
1951 isolate->clear_pending_exception(); | 1950 isolate->clear_pending_exception(); |
1952 } | 1951 } |
1953 current->set_state(v8::INSTALLED); | 1952 current->set_state(v8::INSTALLED); |
1954 return result; | 1953 return result; |
1955 } | 1954 } |
1956 | 1955 |
1957 | 1956 |
1958 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { | 1957 bool Genesis::InstallJSBuiltins(Handle<JSBuiltinsObject> builtins) { |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 return from + sizeof(NestingCounterType); | 2224 return from + sizeof(NestingCounterType); |
2226 } | 2225 } |
2227 | 2226 |
2228 | 2227 |
2229 // Called when the top-level V8 mutex is destroyed. | 2228 // Called when the top-level V8 mutex is destroyed. |
2230 void Bootstrapper::FreeThreadResources() { | 2229 void Bootstrapper::FreeThreadResources() { |
2231 ASSERT(!IsActive()); | 2230 ASSERT(!IsActive()); |
2232 } | 2231 } |
2233 | 2232 |
2234 } } // namespace v8::internal | 2233 } } // namespace v8::internal |
OLD | NEW |