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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 } | 942 } |
943 } | 943 } |
944 #endif // ENABLE_DEBUGGER_SUPPORT | 944 #endif // ENABLE_DEBUGGER_SUPPORT |
945 if (it.done()) return Handle<Context>::null(); | 945 if (it.done()) return Handle<Context>::null(); |
946 JavaScriptFrame* frame = it.frame(); | 946 JavaScriptFrame* frame = it.frame(); |
947 Context* context = Context::cast(frame->context()); | 947 Context* context = Context::cast(frame->context()); |
948 return Handle<Context>(context->global_context()); | 948 return Handle<Context>(context->global_context()); |
949 } | 949 } |
950 | 950 |
951 | 951 |
952 bool Top::CanHaveSpecialFunctions(JSObject* object) { | |
953 return object->IsJSArray(); | |
954 } | |
955 | |
956 | |
957 Object* Top::LookupSpecialFunction(JSObject* receiver, | |
958 JSObject* prototype, | |
959 JSFunction* function) { | |
960 if (CanHaveSpecialFunctions(receiver)) { | |
961 FixedArray* table = context()->global_context()->special_function_table(); | |
962 for (int index = 0; index < table->length(); index +=3) { | |
963 if ((prototype == table->get(index)) && | |
964 (function == table->get(index+1))) { | |
965 return table->get(index+2); | |
966 } | |
967 } | |
968 } | |
969 return Heap::undefined_value(); | |
970 } | |
971 | |
972 | |
973 char* Top::ArchiveThread(char* to) { | 952 char* Top::ArchiveThread(char* to) { |
974 memcpy(to, reinterpret_cast<char*>(&thread_local_), sizeof(thread_local_)); | 953 memcpy(to, reinterpret_cast<char*>(&thread_local_), sizeof(thread_local_)); |
975 InitializeThreadLocal(); | 954 InitializeThreadLocal(); |
976 return to + sizeof(thread_local_); | 955 return to + sizeof(thread_local_); |
977 } | 956 } |
978 | 957 |
979 | 958 |
980 char* Top::RestoreThread(char* from) { | 959 char* Top::RestoreThread(char* from) { |
981 memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(thread_local_)); | 960 memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(thread_local_)); |
982 return from + sizeof(thread_local_); | 961 return from + sizeof(thread_local_); |
983 } | 962 } |
984 | 963 |
985 | 964 |
986 ExecutionAccess::ExecutionAccess() { | 965 ExecutionAccess::ExecutionAccess() { |
987 Top::break_access_->Lock(); | 966 Top::break_access_->Lock(); |
988 } | 967 } |
989 | 968 |
990 | 969 |
991 ExecutionAccess::~ExecutionAccess() { | 970 ExecutionAccess::~ExecutionAccess() { |
992 Top::break_access_->Unlock(); | 971 Top::break_access_->Unlock(); |
993 } | 972 } |
994 | 973 |
995 | 974 |
996 } } // namespace v8::internal | 975 } } // namespace v8::internal |
OLD | NEW |