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

Side by Side Diff: src/ia32/full-codegen-ia32.cc

Issue 1146063006: Fix arrow functions requiring context without slots. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup test case. Created 5 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
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/mips/full-codegen-mips.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // Emit the remaining pushes. 177 // Emit the remaining pushes.
178 for (int i = 0; i < remaining; i++) { 178 for (int i = 0; i < remaining; i++) {
179 __ push(eax); 179 __ push(eax);
180 } 180 }
181 } 181 }
182 } 182 }
183 183
184 bool function_in_register = true; 184 bool function_in_register = true;
185 185
186 // Possibly allocate a local context. 186 // Possibly allocate a local context.
187 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 187 if (info->scope()->num_heap_slots() > 0) {
188 if (heap_slots > 0) {
189 Comment cmnt(masm_, "[ Allocate context"); 188 Comment cmnt(masm_, "[ Allocate context");
190 bool need_write_barrier = true; 189 bool need_write_barrier = true;
190 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
191 // Argument to NewContext is the function, which is still in edi. 191 // Argument to NewContext is the function, which is still in edi.
192 if (info->scope()->is_script_scope()) { 192 if (info->scope()->is_script_scope()) {
193 __ push(edi); 193 __ push(edi);
194 __ Push(info->scope()->GetScopeInfo(info->isolate())); 194 __ Push(info->scope()->GetScopeInfo(info->isolate()));
195 __ CallRuntime(Runtime::kNewScriptContext, 2); 195 __ CallRuntime(Runtime::kNewScriptContext, 2);
196 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { 196 } else if (slots <= FastNewContextStub::kMaximumSlots) {
197 FastNewContextStub stub(isolate(), heap_slots); 197 FastNewContextStub stub(isolate(), slots);
198 __ CallStub(&stub); 198 __ CallStub(&stub);
199 // Result of FastNewContextStub is always in new space. 199 // Result of FastNewContextStub is always in new space.
200 need_write_barrier = false; 200 need_write_barrier = false;
201 } else { 201 } else {
202 __ push(edi); 202 __ push(edi);
203 __ CallRuntime(Runtime::kNewFunctionContext, 1); 203 __ CallRuntime(Runtime::kNewFunctionContext, 1);
204 } 204 }
205 function_in_register = false; 205 function_in_register = false;
206 // Context is returned in eax. It replaces the context passed to us. 206 // Context is returned in eax. It replaces the context passed to us.
207 // It's saved in the stack and kept live in esi. 207 // It's saved in the stack and kept live in esi.
(...skipping 5229 matching lines...) Expand 10 before | Expand all | Expand 10 after
5437 Assembler::target_address_at(call_target_address, 5437 Assembler::target_address_at(call_target_address,
5438 unoptimized_code)); 5438 unoptimized_code));
5439 return OSR_AFTER_STACK_CHECK; 5439 return OSR_AFTER_STACK_CHECK;
5440 } 5440 }
5441 5441
5442 5442
5443 } // namespace internal 5443 } // namespace internal
5444 } // namespace v8 5444 } // namespace v8
5445 5445
5446 #endif // V8_TARGET_ARCH_IA32 5446 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698