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

Side by Side Diff: src/top.cc

Issue 573003: ia32: Fuse map and type checks in call ICs for API functions. (Closed)
Patch Set: Rewrote a comment. Created 10 years, 10 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
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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
952 Object* Top::LookupSpecialFunction(JSObject* receiver, 957 Object* Top::LookupSpecialFunction(JSObject* receiver,
953 JSObject* prototype, 958 JSObject* prototype,
954 JSFunction* function) { 959 JSFunction* function) {
955 if (receiver->IsJSArray()) { 960 if (CanHaveSpecialFunctions(receiver)) {
956 FixedArray* table = context()->global_context()->special_function_table(); 961 FixedArray* table = context()->global_context()->special_function_table();
957 for (int index = 0; index < table->length(); index +=3) { 962 for (int index = 0; index < table->length(); index +=3) {
958 if ((prototype == table->get(index)) && 963 if ((prototype == table->get(index)) &&
959 (function == table->get(index+1))) { 964 (function == table->get(index+1))) {
960 return table->get(index+2); 965 return table->get(index+2);
961 } 966 }
962 } 967 }
963 } 968 }
964 return Heap::undefined_value(); 969 return Heap::undefined_value();
965 } 970 }
(...skipping 16 matching lines...) Expand all
982 Top::break_access_->Lock(); 987 Top::break_access_->Lock();
983 } 988 }
984 989
985 990
986 ExecutionAccess::~ExecutionAccess() { 991 ExecutionAccess::~ExecutionAccess() {
987 Top::break_access_->Unlock(); 992 Top::break_access_->Unlock();
988 } 993 }
989 994
990 995
991 } } // namespace v8::internal 996 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698