| OLD | NEW |
| 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 Loading... |
| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 compare_type_ = SMI_ONLY; | 553 compare_type_ = SMI_ONLY; |
| 553 } else if (info.IsNonPrimitive()) { | 554 } else if (info.IsNonPrimitive()) { |
| 554 compare_type_ = OBJECT_ONLY; | 555 compare_type_ = OBJECT_ONLY; |
| 555 } else { | 556 } else { |
| 556 ASSERT(compare_type_ == NONE); | 557 ASSERT(compare_type_ == NONE); |
| 557 } | 558 } |
| 558 } | 559 } |
| 559 | 560 |
| 560 | 561 |
| 561 static bool CallWithoutIC(Handle<JSFunction> target, int arity) { | 562 static bool CallWithoutIC(Handle<JSFunction> target, int arity) { |
| 563 SharedFunctionInfo* info = target->shared(); |
| 562 if (target->NeedsArgumentsAdaption()) { | 564 if (target->NeedsArgumentsAdaption()) { |
| 563 // If the number of formal parameters of the target function | 565 // If the number of formal parameters of the target function |
| 564 // does not match the number of arguments we're passing, we | 566 // does not match the number of arguments we're passing, we |
| 565 // don't want to deal with it. | 567 // don't want to deal with it. |
| 566 return target->shared()->formal_parameter_count() == arity; | 568 return info->formal_parameter_count() == arity; |
| 567 } else { | 569 } else { |
| 568 // If the target doesn't need arguments adaption, we can call | 570 // If the target doesn't need arguments adaption, we can call |
| 569 // it directly, but we avoid to do so if it has a custom call | 571 // it directly, but we avoid to do so if it has a custom call |
| 570 // generator, because that is likely to generate better code. | 572 // generator, because that is likely to generate better code. |
| 571 return !target->shared()->HasCustomCallGenerator(); | 573 return !info->HasBuiltinFunctionId() || |
| 574 !CallStubCompiler::HasCustomCallGenerator(info->builtin_function_id()); |
| 572 } | 575 } |
| 573 } | 576 } |
| 574 | 577 |
| 575 | 578 |
| 576 bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) { | 579 bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) { |
| 577 holder_ = Handle<JSObject>::null(); | 580 holder_ = Handle<JSObject>::null(); |
| 578 while (true) { | 581 while (true) { |
| 579 LookupResult lookup; | 582 LookupResult lookup; |
| 580 type->LookupInDescriptors(NULL, *name, &lookup); | 583 type->LookupInDescriptors(NULL, *name, &lookup); |
| 581 // If the function wasn't found directly in the map, we start | 584 // If the function wasn't found directly in the map, we start |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 | 1038 |
| 1036 CaseClause::CaseClause(Expression* label, | 1039 CaseClause::CaseClause(Expression* label, |
| 1037 ZoneList<Statement*>* statements, | 1040 ZoneList<Statement*>* statements, |
| 1038 int pos) | 1041 int pos) |
| 1039 : label_(label), | 1042 : label_(label), |
| 1040 statements_(statements), | 1043 statements_(statements), |
| 1041 position_(pos), | 1044 position_(pos), |
| 1042 compare_type_(NONE) {} | 1045 compare_type_(NONE) {} |
| 1043 | 1046 |
| 1044 } } // namespace v8::internal | 1047 } } // namespace v8::internal |
| OLD | NEW |