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

Side by Side Diff: src/ast.cc

Issue 5767002: Merge math function ids and custom call generator ids. (Closed)
Patch Set: arm and x64 fixes. Created 10 years 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 14 matching lines...) Expand all
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #include "v8.h" 28 #include "v8.h"
29 29
30 #include "ast.h" 30 #include "ast.h"
31 #include "jump-target-inl.h" 31 #include "jump-target-inl.h"
32 #include "parser.h" 32 #include "parser.h"
33 #include "scopes.h" 33 #include "scopes.h"
34 #include "string-stream.h" 34 #include "string-stream.h"
35 #include "stub-cache.h"
35 36
36 namespace v8 { 37 namespace v8 {
37 namespace internal { 38 namespace internal {
38 39
39 unsigned AstNode::current_id_ = 0; 40 unsigned AstNode::current_id_ = 0;
40 unsigned AstNode::count_ = 0; 41 unsigned AstNode::count_ = 0;
41 VariableProxySentinel VariableProxySentinel::this_proxy_(true); 42 VariableProxySentinel VariableProxySentinel::this_proxy_(true);
42 VariableProxySentinel VariableProxySentinel::identifier_proxy_(false); 43 VariableProxySentinel VariableProxySentinel::identifier_proxy_(false);
43 ValidLeftHandSideSentinel ValidLeftHandSideSentinel::instance_; 44 ValidLeftHandSideSentinel ValidLeftHandSideSentinel::instance_;
44 Property Property::this_property_(VariableProxySentinel::this_proxy(), NULL, 0); 45 Property Property::this_property_(VariableProxySentinel::this_proxy(), NULL, 0);
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 compare_type_ = SMI_ONLY; 552 compare_type_ = SMI_ONLY;
552 } else if (info.IsNonPrimitive()) { 553 } else if (info.IsNonPrimitive()) {
553 compare_type_ = OBJECT_ONLY; 554 compare_type_ = OBJECT_ONLY;
554 } else { 555 } else {
555 ASSERT(compare_type_ == NONE); 556 ASSERT(compare_type_ == NONE);
556 } 557 }
557 } 558 }
558 559
559 560
560 static bool CallWithoutIC(Handle<JSFunction> target, int arity) { 561 static bool CallWithoutIC(Handle<JSFunction> target, int arity) {
562 SharedFunctionInfo* info = target->shared();
561 if (target->NeedsArgumentsAdaption()) { 563 if (target->NeedsArgumentsAdaption()) {
562 // If the number of formal parameters of the target function 564 // If the number of formal parameters of the target function
563 // does not match the number of arguments we're passing, we 565 // does not match the number of arguments we're passing, we
564 // don't want to deal with it. 566 // don't want to deal with it.
565 return target->shared()->formal_parameter_count() == arity; 567 return info->formal_parameter_count() == arity;
566 } else { 568 } else {
567 // If the target doesn't need arguments adaption, we can call 569 // If the target doesn't need arguments adaption, we can call
568 // it directly, but we avoid to do so if it has a custom call 570 // it directly, but we avoid to do so if it has a custom call
569 // generator, because that is likely to generate better code. 571 // generator, because that is likely to generate better code.
570 return !target->shared()->HasCustomCallGenerator(); 572 return !info->HasBuiltinFunctionId() ||
573 !CallStubCompiler::HasCustomCallGenerator(info->builtin_function_id());
571 } 574 }
572 } 575 }
573 576
574 577
575 bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) { 578 bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) {
576 holder_ = Handle<JSObject>::null(); 579 holder_ = Handle<JSObject>::null();
577 while (true) { 580 while (true) {
578 LookupResult lookup; 581 LookupResult lookup;
579 type->LookupInDescriptors(NULL, *name, &lookup); 582 type->LookupInDescriptors(NULL, *name, &lookup);
580 // If the function wasn't found directly in the map, we start 583 // If the function wasn't found directly in the map, we start
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 1037
1035 CaseClause::CaseClause(Expression* label, 1038 CaseClause::CaseClause(Expression* label,
1036 ZoneList<Statement*>* statements, 1039 ZoneList<Statement*>* statements,
1037 int pos) 1040 int pos)
1038 : label_(label), 1041 : label_(label),
1039 statements_(statements), 1042 statements_(statements),
1040 position_(pos), 1043 position_(pos),
1041 compare_type_(NONE) {} 1044 compare_type_(NONE) {}
1042 1045
1043 } } // namespace v8::internal 1046 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/bootstrapper.cc » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698