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

Unified Diff: src/ic/handler-compiler.cc

Issue 1276533003: [runtime] Store constructor function index on primitive maps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm failures Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ic/ic-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/handler-compiler.cc
diff --git a/src/ic/handler-compiler.cc b/src/ic/handler-compiler.cc
index 74844d869bbced3747c3e2b27aeb821383827083..594fe194f5d8320a9e3d08293c9aa1e8b8e2c591 100644
--- a/src/ic/handler-compiler.cc
+++ b/src/ic/handler-compiler.cc
@@ -99,28 +99,11 @@ Register NamedLoadHandlerCompiler::FrontendHeader(Register object_reg,
Handle<Name> name,
Label* miss,
ReturnHolder return_what) {
- PrototypeCheckType check_type = CHECK_ALL_MAPS;
- int function_index = -1;
- if (map()->instance_type() < FIRST_NONSTRING_TYPE) {
- function_index = Context::STRING_FUNCTION_INDEX;
- } else if (map()->instance_type() == SYMBOL_TYPE) {
- function_index = Context::SYMBOL_FUNCTION_INDEX;
- } else if (map()->instance_type() == HEAP_NUMBER_TYPE) {
- function_index = Context::NUMBER_FUNCTION_INDEX;
- } else if (*map() == isolate()->heap()->boolean_map()) {
- function_index = Context::BOOLEAN_FUNCTION_INDEX;
-// clang-format off
-#define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
- } else if (map().is_identical_to(isolate()->factory()->type##_map())) { \
- function_index = Context::TYPE##_FUNCTION_INDEX;
- SIMD128_TYPES(SIMD128_TYPE)
-#undef SIMD128_TYPE
- // clang-format on
- } else {
- check_type = SKIP_RECEIVER;
- }
-
- if (check_type == CHECK_ALL_MAPS) {
+ PrototypeCheckType check_type = SKIP_RECEIVER;
+ int function_index = map()->IsPrimitiveMap()
+ ? map()->GetConstructorFunctionIndex()
+ : Map::kNoConstructorFunctionIndex;
+ if (function_index != Map::kNoConstructorFunctionIndex) {
GenerateDirectLoadGlobalFunctionPrototype(masm(), function_index,
scratch1(), miss);
Object* function = isolate()->native_context()->get(function_index);
@@ -128,6 +111,7 @@ Register NamedLoadHandlerCompiler::FrontendHeader(Register object_reg,
Handle<Map> map(JSObject::cast(prototype)->map());
set_map(map);
object_reg = scratch1();
+ check_type = CHECK_ALL_MAPS;
}
// Check that the maps starting from the prototype haven't changed.
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ic/ic-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698