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/fast-codegen-arm.cc

Issue 566008: Incorporate the arguments to the code generator constructors and their (Closed)
Patch Set: Incorporate the arguments to the code generator constructors and their... Created 10 years, 10 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
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | 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 19 matching lines...) Expand all
30 #include "codegen-inl.h" 30 #include "codegen-inl.h"
31 #include "fast-codegen.h" 31 #include "fast-codegen.h"
32 32
33 namespace v8 { 33 namespace v8 {
34 namespace internal { 34 namespace internal {
35 35
36 #define __ ACCESS_MASM(masm()) 36 #define __ ACCESS_MASM(masm())
37 37
38 void FastCodeGenerator::EmitLoadReceiver(Register reg) { 38 void FastCodeGenerator::EmitLoadReceiver(Register reg) {
39 // Offset 2 is due to return address and saved frame pointer. 39 // Offset 2 is due to return address and saved frame pointer.
40 int index = 2 + function()->scope()->num_parameters(); 40 int index = 2 + scope()->num_parameters();
41 __ ldr(reg, MemOperand(sp, index * kPointerSize)); 41 __ ldr(reg, MemOperand(sp, index * kPointerSize));
42 } 42 }
43 43
44 44
45 void FastCodeGenerator::EmitReceiverMapCheck() { 45 void FastCodeGenerator::EmitReceiverMapCheck() {
46 Comment cmnt(masm(), ";; MapCheck(this)"); 46 Comment cmnt(masm(), ";; MapCheck(this)");
47 if (FLAG_print_ir) { 47 if (FLAG_print_ir) {
48 PrintF("MapCheck(this)\n"); 48 PrintF("MapCheck(this)\n");
49 } 49 }
50 50
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 offset += FixedArray::kHeaderSize; 95 offset += FixedArray::kHeaderSize;
96 __ ldr(r2, FieldMemOperand(r1, JSObject::kPropertiesOffset)); 96 __ ldr(r2, FieldMemOperand(r1, JSObject::kPropertiesOffset));
97 } 97 }
98 // Perform the store. 98 // Perform the store.
99 __ str(r0, FieldMemOperand(r2, offset)); 99 __ str(r0, FieldMemOperand(r2, offset));
100 __ mov(r3, Operand(offset)); 100 __ mov(r3, Operand(offset));
101 __ RecordWrite(r2, r3, ip); 101 __ RecordWrite(r2, r3, ip);
102 } 102 }
103 103
104 104
105 void FastCodeGenerator::Generate(FunctionLiteral* fun, CompilationInfo* info) { 105 void FastCodeGenerator::Generate(CompilationInfo* info) {
106 ASSERT(function_ == NULL);
107 ASSERT(info_ == NULL); 106 ASSERT(info_ == NULL);
108 function_ = fun;
109 info_ = info; 107 info_ = info;
110 108
111 // Save the caller's frame pointer and set up our own. 109 // Save the caller's frame pointer and set up our own.
112 Comment prologue_cmnt(masm(), ";; Prologue"); 110 Comment prologue_cmnt(masm(), ";; Prologue");
113 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit()); 111 __ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
114 __ add(fp, sp, Operand(2 * kPointerSize)); 112 __ add(fp, sp, Operand(2 * kPointerSize));
115 // Note that we keep a live register reference to cp (context) at 113 // Note that we keep a live register reference to cp (context) at
116 // this point. 114 // this point.
117 115
118 // Receiver (this) is allocated to r1 if there are this properties. 116 // Receiver (this) is allocated to r1 if there are this properties.
119 if (has_this_properties()) EmitReceiverMapCheck(); 117 if (has_this_properties()) EmitReceiverMapCheck();
120 118
121 VisitStatements(fun->body()); 119 VisitStatements(function()->body());
122 120
123 Comment return_cmnt(masm(), ";; Return(<undefined>)"); 121 Comment return_cmnt(masm(), ";; Return(<undefined>)");
124 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 122 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
125 123
126 Comment epilogue_cmnt(masm(), ";; Epilogue"); 124 Comment epilogue_cmnt(masm(), ";; Epilogue");
127 __ mov(sp, fp); 125 __ mov(sp, fp);
128 __ ldm(ia_w, sp, fp.bit() | lr.bit()); 126 __ ldm(ia_w, sp, fp.bit() | lr.bit());
129 int32_t sp_delta = (fun->scope()->num_parameters() + 1) * kPointerSize; 127 int32_t sp_delta = (scope()->num_parameters() + 1) * kPointerSize;
130 __ add(sp, sp, Operand(sp_delta)); 128 __ add(sp, sp, Operand(sp_delta));
131 __ Jump(lr); 129 __ Jump(lr);
132 130
133 __ bind(&bailout_); 131 __ bind(&bailout_);
134 } 132 }
135 133
136 134
137 #undef __ 135 #undef __
138 136
139 137
140 } } // namespace v8::internal 138 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698