Chromium Code Reviews| 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 have | |
| 6301 // a stack image common for calls using an IC (receiver followed by | |
| 6302 // arguments). | |
| 6303 Result tmp1 = frame_->Pop(); | |
|
Mads Ager (chromium)
2010/11/17 13:11:37
Use names like 'key' and 'receiver' instead of tmp
Søren Thygesen Gjesse
2010/11/18 08:48:57
Done.
| |
| 6304 Result tmp2 = frame_->Pop(); | |
| 6305 frame_->Push(&tmp1); | |
| 6306 frame_->Push(&tmp2); | |
| 6307 tmp1.Unuse(); | |
| 6308 tmp2.Unuse(); | |
| 6309 | |
| 6297 // Load the arguments. | 6310 // Load the arguments. |
| 6298 int arg_count = args->length(); | 6311 int arg_count = args->length(); |
| 6299 for (int i = 0; i < arg_count; i++) { | 6312 for (int i = 0; i < arg_count; i++) { |
| 6300 Load(args->at(i)); | 6313 Load(args->at(i)); |
| 6301 frame_->SpillTop(); | 6314 frame_->SpillTop(); |
| 6302 } | 6315 } |
| 6303 | 6316 |
| 6304 // Load the name of the function. | 6317 // Place the key on top of stack and call the IC initialization code. |
| 6305 Load(property->key()); | 6318 frame_->PushElementAt(arg_count + 1); |
| 6306 | |
| 6307 // Call the IC initialization code. | |
| 6308 CodeForSourcePosition(node->position()); | 6319 CodeForSourcePosition(node->position()); |
| 6309 Result result = | 6320 Result result = |
| 6310 frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, | 6321 frame_->CallKeyedCallIC(RelocInfo::CODE_TARGET, |
| 6311 arg_count, | 6322 arg_count, |
| 6312 loop_nesting()); | 6323 loop_nesting()); |
| 6324 frame_->Drop(); // Drop the key still on the stack. | |
| 6313 frame_->RestoreContextRegister(); | 6325 frame_->RestoreContextRegister(); |
| 6314 frame_->Push(&result); | 6326 frame_->Push(&result); |
| 6315 } | 6327 } |
| 6316 } | 6328 } |
| 6317 | 6329 |
| 6318 } else { | 6330 } else { |
| 6319 // ---------------------------------- | 6331 // ---------------------------------- |
| 6320 // JavaScript example: 'foo(1, 2, 3)' // foo is not global | 6332 // JavaScript example: 'foo(1, 2, 3)' // foo is not global |
| 6321 // ---------------------------------- | 6333 // ---------------------------------- |
| 6322 | 6334 |
| (...skipping 3748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10071 masm.GetCode(&desc); | 10083 masm.GetCode(&desc); |
| 10072 // Call the function from C++. | 10084 // Call the function from C++. |
| 10073 return FUNCTION_CAST<MemCopyFunction>(buffer); | 10085 return FUNCTION_CAST<MemCopyFunction>(buffer); |
| 10074 } | 10086 } |
| 10075 | 10087 |
| 10076 #undef __ | 10088 #undef __ |
| 10077 | 10089 |
| 10078 } } // namespace v8::internal | 10090 } } // namespace v8::internal |
| 10079 | 10091 |
| 10080 #endif // V8_TARGET_ARCH_IA32 | 10092 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |