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

Side by Side Diff: src/arm/codegen-arm.cc

Issue 2853003: Port KeyedCallIC implementation to x64 and ARM.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4070 matching lines...) Expand 10 before | Expand all | Expand 10 after
4081 frame_->EmitPush(r0); 4081 frame_->EmitPush(r0);
4082 } 4082 }
4083 4083
4084 } else { 4084 } else {
4085 // ------------------------------------------- 4085 // -------------------------------------------
4086 // JavaScript example: 'array[index](1, 2, 3)' 4086 // JavaScript example: 'array[index](1, 2, 3)'
4087 // ------------------------------------------- 4087 // -------------------------------------------
4088 VirtualFrame::SpilledScope spilled_scope(frame_); 4088 VirtualFrame::SpilledScope spilled_scope(frame_);
4089 4089
4090 Load(property->obj()); 4090 Load(property->obj());
4091 if (!property->is_synthetic()) {
4092 // Duplicate receiver for later use.
4093 __ ldr(r0, MemOperand(sp, 0));
4094 frame_->EmitPush(r0);
4095 }
4096 Load(property->key());
4097 EmitKeyedLoad();
4098 // Put the function below the receiver.
4099 if (property->is_synthetic()) { 4091 if (property->is_synthetic()) {
4092 Load(property->key());
4093 EmitKeyedLoad();
4094 // Put the function below the receiver.
4100 // Use the global receiver. 4095 // Use the global receiver.
4101 frame_->EmitPush(r0); // Function. 4096 frame_->EmitPush(r0); // Function.
4102 LoadGlobalReceiver(r0); 4097 LoadGlobalReceiver(r0);
4098 // Call the function.
4099 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position());
4100 frame_->EmitPush(r0);
4103 } else { 4101 } else {
4104 // Switch receiver and function. 4102 // Load the arguments.
4105 frame_->EmitPop(r1); // Receiver. 4103 int arg_count = args->length();
4106 frame_->EmitPush(r0); // Function. 4104 for (int i = 0; i < arg_count; i++) {
4107 frame_->EmitPush(r1); // Receiver. 4105 Load(args->at(i));
4106 }
4107
4108 // Set the name register and call the IC initialization code.
4109 Load(property->key());
4110 frame_->EmitPop(r2); // Function name.
4111
4112 InLoopFlag in_loop = loop_nesting() > 0 ? IN_LOOP : NOT_IN_LOOP;
4113 Handle<Code> stub = ComputeKeyedCallInitialize(arg_count, in_loop);
4114 CodeForSourcePosition(node->position());
4115 frame_->CallCodeObject(stub, RelocInfo::CODE_TARGET, arg_count + 1);
4116 __ ldr(cp, frame_->Context());
4117 frame_->EmitPush(r0);
4108 } 4118 }
4109
4110 // Call the function.
4111 CallWithArguments(args, RECEIVER_MIGHT_BE_VALUE, node->position());
4112 frame_->EmitPush(r0);
4113 } 4119 }
4114 4120
4115 } else { 4121 } else {
4116 // ---------------------------------- 4122 // ----------------------------------
4117 // JavaScript example: 'foo(1, 2, 3)' // foo is not global 4123 // JavaScript example: 'foo(1, 2, 3)' // foo is not global
4118 // ---------------------------------- 4124 // ----------------------------------
4119 4125
4120 // Load the function. 4126 // Load the function.
4121 Load(function); 4127 Load(function);
4122 4128
(...skipping 6545 matching lines...) Expand 10 before | Expand all | Expand 10 after
10668 __ bind(&string_add_runtime); 10674 __ bind(&string_add_runtime);
10669 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); 10675 __ TailCallRuntime(Runtime::kStringAdd, 2, 1);
10670 } 10676 }
10671 10677
10672 10678
10673 #undef __ 10679 #undef __
10674 10680
10675 } } // namespace v8::internal 10681 } } // namespace v8::internal
10676 10682
10677 #endif // V8_TARGET_ARCH_ARM 10683 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698