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

Side by Side Diff: src/mips/full-codegen-mips.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/ia32/full-codegen-ia32.cc ('k') | src/mips64/full-codegen-mips64.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_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 __ Subu(sp, sp, Operand(remaining * kPointerSize)); 193 __ Subu(sp, sp, Operand(remaining * kPointerSize));
194 for (int i = 0; i < remaining; i++) { 194 for (int i = 0; i < remaining; i++) {
195 __ sw(t5, MemOperand(sp, i * kPointerSize)); 195 __ sw(t5, MemOperand(sp, i * kPointerSize));
196 } 196 }
197 } 197 }
198 } 198 }
199 199
200 bool function_in_register = true; 200 bool function_in_register = true;
201 201
202 // Possibly allocate a local context. 202 // Possibly allocate a local context.
203 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 203 if (info->scope()->num_heap_slots() > 0) {
204 if (heap_slots > 0) {
205 Comment cmnt(masm_, "[ Allocate context"); 204 Comment cmnt(masm_, "[ Allocate context");
206 // Argument to NewContext is the function, which is still in a1. 205 // Argument to NewContext is the function, which is still in a1.
207 bool need_write_barrier = true; 206 bool need_write_barrier = true;
207 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
208 if (info->scope()->is_script_scope()) { 208 if (info->scope()->is_script_scope()) {
209 __ push(a1); 209 __ push(a1);
210 __ Push(info->scope()->GetScopeInfo(info->isolate())); 210 __ Push(info->scope()->GetScopeInfo(info->isolate()));
211 __ CallRuntime(Runtime::kNewScriptContext, 2); 211 __ CallRuntime(Runtime::kNewScriptContext, 2);
212 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { 212 } else if (slots <= FastNewContextStub::kMaximumSlots) {
213 FastNewContextStub stub(isolate(), heap_slots); 213 FastNewContextStub stub(isolate(), slots);
214 __ CallStub(&stub); 214 __ CallStub(&stub);
215 // Result of FastNewContextStub is always in new space. 215 // Result of FastNewContextStub is always in new space.
216 need_write_barrier = false; 216 need_write_barrier = false;
217 } else { 217 } else {
218 __ push(a1); 218 __ push(a1);
219 __ CallRuntime(Runtime::kNewFunctionContext, 1); 219 __ CallRuntime(Runtime::kNewFunctionContext, 1);
220 } 220 }
221 function_in_register = false; 221 function_in_register = false;
222 // Context is returned in v0. It replaces the context passed to us. 222 // Context is returned in v0. It replaces the context passed to us.
223 // It's saved in the stack and kept live in cp. 223 // It's saved in the stack and kept live in cp.
(...skipping 5295 matching lines...) Expand 10 before | Expand all | Expand 10 after
5519 reinterpret_cast<uint32_t>( 5519 reinterpret_cast<uint32_t>(
5520 isolate->builtins()->OsrAfterStackCheck()->entry())); 5520 isolate->builtins()->OsrAfterStackCheck()->entry()));
5521 return OSR_AFTER_STACK_CHECK; 5521 return OSR_AFTER_STACK_CHECK;
5522 } 5522 }
5523 5523
5524 5524
5525 } // namespace internal 5525 } // namespace internal
5526 } // namespace v8 5526 } // namespace v8
5527 5527
5528 #endif // V8_TARGET_ARCH_MIPS 5528 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698