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

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

Issue 2850: Generalize the Function.prototype.call hooks in the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 3 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 | « src/codegen.cc ('k') | src/codegen-ia32.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 virtual void Visit##type(type* node); 298 virtual void Visit##type(type* node);
299 NODE_LIST(DEF_VISIT) 299 NODE_LIST(DEF_VISIT)
300 #undef DEF_VISIT 300 #undef DEF_VISIT
301 301
302 void RecordStatementPosition(Node* node); 302 void RecordStatementPosition(Node* node);
303 303
304 // Activation frames 304 // Activation frames
305 void EnterJSFrame(); 305 void EnterJSFrame();
306 void ExitJSFrame(); 306 void ExitJSFrame();
307 307
308 virtual void GenerateShiftDownAndTailCall(ZoneList<Expression*>* args);
309 virtual void GenerateSetThisFunction(ZoneList<Expression*>* args);
310 virtual void GenerateGetThisFunction(ZoneList<Expression*>* args);
311 virtual void GenerateSetThis(ZoneList<Expression*>* args);
312 virtual void GenerateGetArgumentsLength(ZoneList<Expression*>* args);
313 virtual void GenerateSetArgumentsLength(ZoneList<Expression*>* args);
314 virtual void GenerateTailCallWithArguments(ZoneList<Expression*>* args);
315 virtual void GenerateSetArgument(ZoneList<Expression*>* args);
316 virtual void GenerateSquashFrame(ZoneList<Expression*>* args);
317 virtual void GenerateExpandFrame(ZoneList<Expression*>* args);
318 virtual void GenerateIsSmi(ZoneList<Expression*>* args); 308 virtual void GenerateIsSmi(ZoneList<Expression*>* args);
319 virtual void GenerateIsNonNegativeSmi(ZoneList<Expression*>* args); 309 virtual void GenerateIsNonNegativeSmi(ZoneList<Expression*>* args);
320 virtual void GenerateIsArray(ZoneList<Expression*>* args); 310 virtual void GenerateIsArray(ZoneList<Expression*>* args);
321 311
322 virtual void GenerateArgumentsLength(ZoneList<Expression*>* args); 312 virtual void GenerateArgumentsLength(ZoneList<Expression*>* args);
323 virtual void GenerateArgumentsAccess(ZoneList<Expression*>* args); 313 virtual void GenerateArgumentsAccess(ZoneList<Expression*>* args);
324 314
325 virtual void GenerateValueOf(ZoneList<Expression*>* args); 315 virtual void GenerateValueOf(ZoneList<Expression*>* args);
326 virtual void GenerateSetValueOf(ZoneList<Expression*>* args); 316 virtual void GenerateSetValueOf(ZoneList<Expression*>* args);
327 317
(...skipping 3499 matching lines...) Expand 10 before | Expand all | Expand 10 after
3827 // constructor invocation. 3817 // constructor invocation.
3828 __ RecordPosition(position); 3818 __ RecordPosition(position);
3829 __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)), 3819 __ Call(Handle<Code>(Builtins::builtin(Builtins::JSConstructCall)),
3830 js_construct_call); 3820 js_construct_call);
3831 3821
3832 // Discard old TOS value and push r0 on the stack (same as Pop(), push(r0)). 3822 // Discard old TOS value and push r0 on the stack (same as Pop(), push(r0)).
3833 __ str(r0, MemOperand(sp, 0 * kPointerSize)); 3823 __ str(r0, MemOperand(sp, 0 * kPointerSize));
3834 } 3824 }
3835 3825
3836 3826
3837 void ArmCodeGenerator::GenerateSetThisFunction(ZoneList<Expression*>* args) {
3838 __ stop("ArmCodeGenerator::GenerateSetThisFunction - unreachable");
3839 }
3840
3841
3842 void ArmCodeGenerator::GenerateGetThisFunction(ZoneList<Expression*>* args) {
3843 __ stop("ArmCodeGenerator::GenerateGetThisFunction - unreachable");
3844 }
3845
3846
3847 void ArmCodeGenerator::GenerateSetThis(ZoneList<Expression*>* args) {
3848 __ stop("ArmCodeGenerator::GenerateSetThis - unreachable");
3849 }
3850
3851
3852 void ArmCodeGenerator::GenerateSetArgumentsLength(ZoneList<Expression*>* args) {
3853 __ stop("ArmCodeGenerator::GenerateSetArgumentsLength - unreachable");
3854 }
3855
3856
3857 void ArmCodeGenerator::GenerateGetArgumentsLength(ZoneList<Expression*>* args) {
3858 __ stop("ArmCodeGenerator::GenerateGetArgumentsLength - unreachable");
3859 }
3860
3861
3862 void ArmCodeGenerator::GenerateValueOf(ZoneList<Expression*>* args) { 3827 void ArmCodeGenerator::GenerateValueOf(ZoneList<Expression*>* args) {
3863 ASSERT(args->length() == 1); 3828 ASSERT(args->length() == 1);
3864 Label leave; 3829 Label leave;
3865 Load(args->at(0)); 3830 Load(args->at(0));
3866 __ pop(r0); // r0 contains object. 3831 __ pop(r0); // r0 contains object.
3867 // if (object->IsSmi()) return the object. 3832 // if (object->IsSmi()) return the object.
3868 __ tst(r0, Operand(kSmiTagMask)); 3833 __ tst(r0, Operand(kSmiTagMask));
3869 __ b(eq, &leave); 3834 __ b(eq, &leave);
3870 // It is a heap object - get map. 3835 // It is a heap object - get map.
3871 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset)); 3836 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
(...skipping 28 matching lines...) Expand all
3900 __ str(r0, FieldMemOperand(r1, JSValue::kValueOffset)); 3865 __ str(r0, FieldMemOperand(r1, JSValue::kValueOffset));
3901 // Update the write barrier. 3866 // Update the write barrier.
3902 __ mov(r2, Operand(JSValue::kValueOffset - kHeapObjectTag)); 3867 __ mov(r2, Operand(JSValue::kValueOffset - kHeapObjectTag));
3903 __ RecordWrite(r1, r2, r3); 3868 __ RecordWrite(r1, r2, r3);
3904 // Leave. 3869 // Leave.
3905 __ bind(&leave); 3870 __ bind(&leave);
3906 __ push(r0); 3871 __ push(r0);
3907 } 3872 }
3908 3873
3909 3874
3910 void ArmCodeGenerator::GenerateTailCallWithArguments(
3911 ZoneList<Expression*>* args) {
3912 __ stop("ArmCodeGenerator::GenerateTailCallWithArguments - unreachable");
3913 }
3914
3915
3916 void ArmCodeGenerator::GenerateSetArgument(ZoneList<Expression*>* args) {
3917 __ stop("ArmCodeGenerator::GenerateSetArgument - unreachable");
3918 }
3919
3920
3921 void ArmCodeGenerator::GenerateSquashFrame(ZoneList<Expression*>* args) {
3922 __ stop("ArmCodeGenerator::GenerateSquashFrame - unreachable");
3923 }
3924
3925
3926 void ArmCodeGenerator::GenerateExpandFrame(ZoneList<Expression*>* args) {
3927 __ stop("ArmCodeGenerator::GenerateExpandFrame - unreachable");
3928 }
3929
3930
3931 void ArmCodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) { 3875 void ArmCodeGenerator::GenerateIsSmi(ZoneList<Expression*>* args) {
3932 ASSERT(args->length() == 1); 3876 ASSERT(args->length() == 1);
3933 Load(args->at(0)); 3877 Load(args->at(0));
3934 __ pop(r0); 3878 __ pop(r0);
3935 __ tst(r0, Operand(kSmiTagMask)); 3879 __ tst(r0, Operand(kSmiTagMask));
3936 cc_reg_ = eq; 3880 cc_reg_ = eq;
3937 } 3881 }
3938 3882
3939 3883
3940 void ArmCodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) { 3884 void ArmCodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
4013 // Load the two objects into registers and perform the comparison. 3957 // Load the two objects into registers and perform the comparison.
4014 Load(args->at(0)); 3958 Load(args->at(0));
4015 Load(args->at(1)); 3959 Load(args->at(1));
4016 __ pop(r0); 3960 __ pop(r0);
4017 __ pop(r1); 3961 __ pop(r1);
4018 __ cmp(r0, Operand(r1)); 3962 __ cmp(r0, Operand(r1));
4019 cc_reg_ = eq; 3963 cc_reg_ = eq;
4020 } 3964 }
4021 3965
4022 3966
4023 void ArmCodeGenerator::GenerateShiftDownAndTailCall(
4024 ZoneList<Expression*>* args) {
4025 __ stop("ArmCodeGenerator::GenerateShiftDownAndTailCall - unreachable");
4026 }
4027
4028
4029 void ArmCodeGenerator::VisitCallRuntime(CallRuntime* node) { 3967 void ArmCodeGenerator::VisitCallRuntime(CallRuntime* node) {
4030 if (CheckForInlineRuntimeCall(node)) return; 3968 if (CheckForInlineRuntimeCall(node)) return;
4031 3969
4032 ZoneList<Expression*>* args = node->arguments(); 3970 ZoneList<Expression*>* args = node->arguments();
4033 Comment cmnt(masm_, "[ CallRuntime"); 3971 Comment cmnt(masm_, "[ CallRuntime");
4034 Runtime::Function* function = node->function(); 3972 Runtime::Function* function = node->function();
4035 3973
4036 if (function != NULL) { 3974 if (function != NULL) {
4037 // Push the arguments ("left-to-right"). 3975 // Push the arguments ("left-to-right").
4038 for (int i = 0; i < args->length(); i++) Load(args->at(i)); 3976 for (int i = 0; i < args->length(); i++) Load(args->at(i));
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
4640 bool is_eval) { 4578 bool is_eval) {
4641 Handle<Code> code = ArmCodeGenerator::MakeCode(fun, script, is_eval); 4579 Handle<Code> code = ArmCodeGenerator::MakeCode(fun, script, is_eval);
4642 if (!code.is_null()) { 4580 if (!code.is_null()) {
4643 Counters::total_compiled_code_size.Increment(code->instruction_size()); 4581 Counters::total_compiled_code_size.Increment(code->instruction_size());
4644 } 4582 }
4645 return code; 4583 return code;
4646 } 4584 }
4647 4585
4648 4586
4649 } } // namespace v8::internal 4587 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/codegen.cc ('k') | src/codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698