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 5931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5942 // ------------------------------------------- | 5942 // ------------------------------------------- |
5943 | 5943 |
5944 // Load the function to call from the property through a reference. | 5944 // Load the function to call from the property through a reference. |
5945 | 5945 |
5946 // Pass receiver to called function. | 5946 // Pass receiver to called function. |
5947 if (property->is_synthetic()) { | 5947 if (property->is_synthetic()) { |
5948 Reference ref(this, property); | 5948 Reference ref(this, property); |
5949 ref.GetValue(); | 5949 ref.GetValue(); |
5950 // Use global object as receiver. | 5950 // Use global object as receiver. |
5951 LoadGlobalReceiver(); | 5951 LoadGlobalReceiver(); |
| 5952 // Call the function. |
| 5953 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position()); |
5952 } else { | 5954 } else { |
| 5955 // Push the receiver onto the frame. |
5953 Load(property->obj()); | 5956 Load(property->obj()); |
5954 frame()->Dup(); | 5957 |
| 5958 // Load the arguments. |
| 5959 int arg_count = args->length(); |
| 5960 for (int i = 0; i < arg_count; i++) { |
| 5961 Load(args->at(i)); |
| 5962 frame_->SpillTop(); |
| 5963 } |
| 5964 |
| 5965 // Load the name of the function. |
5955 Load(property->key()); | 5966 Load(property->key()); |
5956 Result function = EmitKeyedLoad(); | 5967 |
5957 Result receiver = frame_->Pop(); | 5968 // Call the IC initialization code. |
5958 frame_->Push(&function); | 5969 CodeForSourcePosition(node->position()); |
5959 frame_->Push(&receiver); | 5970 Result result = |
| 5971 frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, |
| 5972 arg_count, |
| 5973 loop_nesting()); |
| 5974 frame_->RestoreContextRegister(); |
| 5975 frame_->Push(&result); |
5960 } | 5976 } |
5961 | |
5962 // Call the function. | |
5963 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position()); | |
5964 } | 5977 } |
5965 | 5978 |
5966 } else { | 5979 } else { |
5967 // ---------------------------------- | 5980 // ---------------------------------- |
5968 // JavaScript example: 'foo(1, 2, 3)' // foo is not global | 5981 // JavaScript example: 'foo(1, 2, 3)' // foo is not global |
5969 // ---------------------------------- | 5982 // ---------------------------------- |
5970 | 5983 |
5971 // Load the function. | 5984 // Load the function. |
5972 Load(function); | 5985 Load(function); |
5973 | 5986 |
(...skipping 7518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13492 // tagged as a small integer. | 13505 // tagged as a small integer. |
13493 __ bind(&runtime); | 13506 __ bind(&runtime); |
13494 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 13507 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
13495 } | 13508 } |
13496 | 13509 |
13497 #undef __ | 13510 #undef __ |
13498 | 13511 |
13499 } } // namespace v8::internal | 13512 } } // namespace v8::internal |
13500 | 13513 |
13501 #endif // V8_TARGET_ARCH_IA32 | 13514 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |