Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: src/top.cc

Issue 857002: Reland 4068 which wrapped Array methods into native builtins (reverted in 4075). (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/top.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 943 }
944 } 944 }
945 #endif // ENABLE_DEBUGGER_SUPPORT 945 #endif // ENABLE_DEBUGGER_SUPPORT
946 if (it.done()) return Handle<Context>::null(); 946 if (it.done()) return Handle<Context>::null();
947 JavaScriptFrame* frame = it.frame(); 947 JavaScriptFrame* frame = it.frame();
948 Context* context = Context::cast(frame->context()); 948 Context* context = Context::cast(frame->context());
949 return Handle<Context>(context->global_context()); 949 return Handle<Context>(context->global_context());
950 } 950 }
951 951
952 952
953 bool Top::CanHaveSpecialFunctions(JSObject* object) {
954 return object->IsJSArray();
955 }
956
957
958 Object* Top::LookupSpecialFunction(JSObject* receiver,
959 JSObject* prototype,
960 JSFunction* function) {
961 if (CanHaveSpecialFunctions(receiver)) {
962 FixedArray* table = context()->global_context()->special_function_table();
963 for (int index = 0; index < table->length(); index +=3) {
964 if ((prototype == table->get(index)) &&
965 (function == table->get(index+1))) {
966 return table->get(index+2);
967 }
968 }
969 }
970 return Heap::undefined_value();
971 }
972
973
974 char* Top::ArchiveThread(char* to) { 953 char* Top::ArchiveThread(char* to) {
975 memcpy(to, reinterpret_cast<char*>(&thread_local_), sizeof(thread_local_)); 954 memcpy(to, reinterpret_cast<char*>(&thread_local_), sizeof(thread_local_));
976 InitializeThreadLocal(); 955 InitializeThreadLocal();
977 return to + sizeof(thread_local_); 956 return to + sizeof(thread_local_);
978 } 957 }
979 958
980 959
981 char* Top::RestoreThread(char* from) { 960 char* Top::RestoreThread(char* from) {
982 memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(thread_local_)); 961 memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(thread_local_));
983 return from + sizeof(thread_local_); 962 return from + sizeof(thread_local_);
984 } 963 }
985 964
986 965
987 ExecutionAccess::ExecutionAccess() { 966 ExecutionAccess::ExecutionAccess() {
988 Top::break_access_->Lock(); 967 Top::break_access_->Lock();
989 } 968 }
990 969
991 970
992 ExecutionAccess::~ExecutionAccess() { 971 ExecutionAccess::~ExecutionAccess() {
993 Top::break_access_->Unlock(); 972 Top::break_access_->Unlock();
994 } 973 }
995 974
996 975
997 } } // namespace v8::internal 976 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/top.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698