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 6276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6287 Reference ref(this, property); | 6287 Reference ref(this, property); |
6288 ref.GetValue(); | 6288 ref.GetValue(); |
6289 // Use global object as receiver. | 6289 // Use global object as receiver. |
6290 LoadGlobalReceiver(); | 6290 LoadGlobalReceiver(); |
6291 // Call the function. | 6291 // Call the function. |
6292 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position()); | 6292 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position()); |
6293 } else { | 6293 } else { |
6294 // Push the receiver onto the frame. | 6294 // Push the receiver onto the frame. |
6295 Load(property->obj()); | 6295 Load(property->obj()); |
6296 | 6296 |
| 6297 // Load the name of the function. |
| 6298 Load(property->key()); |
| 6299 |
| 6300 // Swap the name of the function and the receiver on the stack to follow |
| 6301 // the calling convention for call ICs. |
| 6302 Result key = frame_->Pop(); |
| 6303 Result receiver = frame_->Pop(); |
| 6304 frame_->Push(&key); |
| 6305 frame_->Push(&receiver); |
| 6306 key.Unuse(); |
| 6307 receiver.Unuse(); |
| 6308 |
6297 // Load the arguments. | 6309 // Load the arguments. |
6298 int arg_count = args->length(); | 6310 int arg_count = args->length(); |
6299 for (int i = 0; i < arg_count; i++) { | 6311 for (int i = 0; i < arg_count; i++) { |
6300 Load(args->at(i)); | 6312 Load(args->at(i)); |
6301 frame_->SpillTop(); | 6313 frame_->SpillTop(); |
6302 } | 6314 } |
6303 | 6315 |
6304 // Load the name of the function. | 6316 // Place the key on top of stack and call the IC initialization code. |
6305 Load(property->key()); | 6317 frame_->PushElementAt(arg_count + 1); |
6306 | |
6307 // Call the IC initialization code. | |
6308 CodeForSourcePosition(node->position()); | 6318 CodeForSourcePosition(node->position()); |
6309 Result result = | 6319 Result result = |
6310 frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, | 6320 frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, |
6311 arg_count, | 6321 arg_count, |
6312 loop_nesting()); | 6322 loop_nesting()); |
| 6323 frame_->Drop(); // Drop the key still on the stack. |
6313 frame_->RestoreContextRegister(); | 6324 frame_->RestoreContextRegister(); |
6314 frame_->Push(&result); | 6325 frame_->Push(&result); |
6315 } | 6326 } |
6316 } | 6327 } |
6317 | 6328 |
6318 } else { | 6329 } else { |
6319 // ---------------------------------- | 6330 // ---------------------------------- |
6320 // JavaScript example: 'foo(1, 2, 3)' // foo is not global | 6331 // JavaScript example: 'foo(1, 2, 3)' // foo is not global |
6321 // ---------------------------------- | 6332 // ---------------------------------- |
6322 | 6333 |
(...skipping 3748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10071 masm.GetCode(&desc); | 10082 masm.GetCode(&desc); |
10072 // Call the function from C++. | 10083 // Call the function from C++. |
10073 return FUNCTION_CAST<MemCopyFunction>(buffer); | 10084 return FUNCTION_CAST<MemCopyFunction>(buffer); |
10074 } | 10085 } |
10075 | 10086 |
10076 #undef __ | 10087 #undef __ |
10077 | 10088 |
10078 } } // namespace v8::internal | 10089 } } // namespace v8::internal |
10079 | 10090 |
10080 #endif // V8_TARGET_ARCH_IA32 | 10091 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |