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

Side by Side Diff: src/stub-cache.cc

Issue 12207016: Split CompileCallConstant into logical parts for Frontend and Backend. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/stub-cache.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 // Compute check type based on receiver/holder. 571 // Compute check type based on receiver/holder.
572 CheckType check = RECEIVER_MAP_CHECK; 572 CheckType check = RECEIVER_MAP_CHECK;
573 if (object->IsString()) { 573 if (object->IsString()) {
574 check = STRING_CHECK; 574 check = STRING_CHECK;
575 } else if (object->IsNumber()) { 575 } else if (object->IsNumber()) {
576 check = NUMBER_CHECK; 576 check = NUMBER_CHECK;
577 } else if (object->IsBoolean()) { 577 } else if (object->IsBoolean()) {
578 check = BOOLEAN_CHECK; 578 check = BOOLEAN_CHECK;
579 } 579 }
580 580
581 if (check != RECEIVER_MAP_CHECK &&
582 !function->IsBuiltin() &&
583 function->shared()->is_classic_mode()) {
584 // Calling non-strict non-builtins with a value as the receiver
585 // requires boxing.
586 return Handle<Code>::null();
587 }
588
581 Code::Flags flags = 589 Code::Flags flags =
582 Code::ComputeMonomorphicFlags(kind, Code::CONSTANT_FUNCTION, extra_state, 590 Code::ComputeMonomorphicFlags(kind, Code::CONSTANT_FUNCTION, extra_state,
583 cache_holder, argc); 591 cache_holder, argc);
584 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags), 592 Handle<Object> probe(map_holder->map()->FindInCodeCache(*name, flags),
585 isolate_); 593 isolate_);
586 if (probe->IsCode()) return Handle<Code>::cast(probe); 594 if (probe->IsCode()) return Handle<Code>::cast(probe);
587 595
588 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder); 596 CallStubCompiler compiler(isolate_, argc, kind, extra_state, cache_holder);
589 Handle<Code> code = 597 Handle<Code> code =
590 compiler.CompileCallConstant(object, holder, function, name, check); 598 compiler.CompileCallConstant(object, holder, name, check, function);
591 code->set_check_type(check); 599 code->set_check_type(check);
592 ASSERT_EQ(flags, code->flags()); 600 ASSERT_EQ(flags, code->flags());
593 PROFILE(isolate_, 601 PROFILE(isolate_,
594 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name)); 602 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
595 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code)); 603 GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
596 JSObject::UpdateMapCodeCache(map_holder, name, code); 604 JSObject::UpdateMapCodeCache(map_holder, name, code);
597 return code; 605 return code;
598 } 606 }
599 607
600 608
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1754 Handle<FunctionTemplateInfo>( 1762 Handle<FunctionTemplateInfo>(
1755 FunctionTemplateInfo::cast(signature->receiver())); 1763 FunctionTemplateInfo::cast(signature->receiver()));
1756 } 1764 }
1757 } 1765 }
1758 1766
1759 is_simple_api_call_ = true; 1767 is_simple_api_call_ = true;
1760 } 1768 }
1761 1769
1762 1770
1763 } } // namespace v8::internal 1771 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698