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 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 // function before overwriting the context but since we're in a | 953 // function before overwriting the context but since we're in a |
954 // single-threaded environment it is not strictly necessary. | 954 // single-threaded environment it is not strictly necessary. |
955 ASSERT(Top::context()->IsGlobalContext()); | 955 ASSERT(Top::context()->IsGlobalContext()); |
956 Handle<Context> context = | 956 Handle<Context> context = |
957 Handle<Context>(use_runtime_context | 957 Handle<Context>(use_runtime_context |
958 ? Top::context()->runtime_context() | 958 ? Top::context()->runtime_context() |
959 : Top::context()); | 959 : Top::context()); |
960 Handle<JSFunction> fun = | 960 Handle<JSFunction> fun = |
961 Factory::NewFunctionFromBoilerplate(boilerplate, context); | 961 Factory::NewFunctionFromBoilerplate(boilerplate, context); |
962 | 962 |
963 // Call function using the either the runtime object or the global | 963 // Call function using either the runtime object or the global |
964 // object as the receiver. Provide no parameters. | 964 // object as the receiver. Provide no parameters. |
965 Handle<Object> receiver = | 965 Handle<Object> receiver = |
966 Handle<Object>(use_runtime_context | 966 Handle<Object>(use_runtime_context |
967 ? Top::context()->builtins() | 967 ? Top::context()->builtins() |
968 : Top::context()->global()); | 968 : Top::context()->global()); |
969 bool has_pending_exception; | 969 bool has_pending_exception; |
970 Handle<Object> result = | 970 Handle<Object> result = |
971 Execution::Call(fun, receiver, 0, NULL, &has_pending_exception); | 971 Execution::Call(fun, receiver, 0, NULL, &has_pending_exception); |
972 if (has_pending_exception) return false; | 972 if (has_pending_exception) return false; |
973 return PendingFixups::Process( | 973 return PendingFixups::Process( |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1671 } | 1671 } |
1672 | 1672 |
1673 | 1673 |
1674 // Restore statics that are thread local. | 1674 // Restore statics that are thread local. |
1675 char* Genesis::RestoreState(char* from) { | 1675 char* Genesis::RestoreState(char* from) { |
1676 current_ = *reinterpret_cast<Genesis**>(from); | 1676 current_ = *reinterpret_cast<Genesis**>(from); |
1677 return from + sizeof(current_); | 1677 return from + sizeof(current_); |
1678 } | 1678 } |
1679 | 1679 |
1680 } } // namespace v8::internal | 1680 } } // namespace v8::internal |
OLD | NEW |