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

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

Issue 716833002: Various clean-ups after top-level lexical declarations are done. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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
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_ARM 7 #if V8_TARGET_ARCH_ARM
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 189
190 bool function_in_register = true; 190 bool function_in_register = true;
191 191
192 // Possibly allocate a local context. 192 // Possibly allocate a local context.
193 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 193 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
194 if (heap_slots > 0) { 194 if (heap_slots > 0) {
195 // Argument to NewContext is the function, which is still in r1. 195 // Argument to NewContext is the function, which is still in r1.
196 Comment cmnt(masm_, "[ Allocate context"); 196 Comment cmnt(masm_, "[ Allocate context");
197 bool need_write_barrier = true; 197 bool need_write_barrier = true;
198 if (FLAG_harmony_scoping && info->scope()->is_global_scope()) { 198 if (FLAG_harmony_scoping && info->scope()->is_script_scope()) {
199 __ push(r1); 199 __ push(r1);
200 __ Push(info->scope()->GetScopeInfo()); 200 __ Push(info->scope()->GetScopeInfo());
201 __ CallRuntime(Runtime::kNewGlobalContext, 2); 201 __ CallRuntime(Runtime::kNewScriptContext, 2);
202 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { 202 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) {
203 FastNewContextStub stub(isolate(), heap_slots); 203 FastNewContextStub stub(isolate(), heap_slots);
204 __ CallStub(&stub); 204 __ CallStub(&stub);
205 // Result of FastNewContextStub is always in new space. 205 // Result of FastNewContextStub is always in new space.
206 need_write_barrier = false; 206 need_write_barrier = false;
207 } else { 207 } else {
208 __ push(r1); 208 __ push(r1);
209 __ CallRuntime(Runtime::kNewFunctionContext, 1); 209 __ CallRuntime(Runtime::kNewFunctionContext, 1);
210 } 210 }
211 function_in_register = false; 211 function_in_register = false;
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 930
931 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) { 931 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
932 Variable* variable = declaration->proxy()->var(); 932 Variable* variable = declaration->proxy()->var();
933 DCHECK(variable->location() == Variable::CONTEXT); 933 DCHECK(variable->location() == Variable::CONTEXT);
934 DCHECK(variable->interface()->IsFrozen()); 934 DCHECK(variable->interface()->IsFrozen());
935 935
936 Comment cmnt(masm_, "[ ModuleDeclaration"); 936 Comment cmnt(masm_, "[ ModuleDeclaration");
937 EmitDebugCheckDeclarationContext(variable); 937 EmitDebugCheckDeclarationContext(variable);
938 938
939 // Load instance object. 939 // Load instance object.
940 __ LoadContext(r1, scope_->ContextChainLength(scope_->GlobalScope())); 940 __ LoadContext(r1, scope_->ContextChainLength(scope_->ScriptScope()));
941 __ ldr(r1, ContextOperand(r1, variable->interface()->Index())); 941 __ ldr(r1, ContextOperand(r1, variable->interface()->Index()));
942 __ ldr(r1, ContextOperand(r1, Context::EXTENSION_INDEX)); 942 __ ldr(r1, ContextOperand(r1, Context::EXTENSION_INDEX));
943 943
944 // Assign it. 944 // Assign it.
945 __ str(r1, ContextOperand(cp, variable->index())); 945 __ str(r1, ContextOperand(cp, variable->index()));
946 // We know that we have written a module, which is not a smi. 946 // We know that we have written a module, which is not a smi.
947 __ RecordWriteContextSlot(cp, 947 __ RecordWriteContextSlot(cp,
948 Context::SlotOffset(variable->index()), 948 Context::SlotOffset(variable->index()),
949 r1, 949 r1,
950 r3, 950 r3,
(...skipping 4127 matching lines...) Expand 10 before | Expand all | Expand 10 after
5078 } 5078 }
5079 5079
5080 5080
5081 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { 5081 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
5082 __ ldr(dst, ContextOperand(cp, context_index)); 5082 __ ldr(dst, ContextOperand(cp, context_index));
5083 } 5083 }
5084 5084
5085 5085
5086 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { 5086 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
5087 Scope* declaration_scope = scope()->DeclarationScope(); 5087 Scope* declaration_scope = scope()->DeclarationScope();
5088 if (declaration_scope->is_global_scope() || 5088 if (declaration_scope->is_script_scope() ||
5089 declaration_scope->is_module_scope()) { 5089 declaration_scope->is_module_scope()) {
5090 // Contexts nested in the native context have a canonical empty function 5090 // Contexts nested in the native context have a canonical empty function
5091 // as their closure, not the anonymous closure containing the global 5091 // as their closure, not the anonymous closure containing the global
5092 // code. Pass a smi sentinel and let the runtime look up the empty 5092 // code. Pass a smi sentinel and let the runtime look up the empty
5093 // function. 5093 // function.
5094 __ mov(ip, Operand(Smi::FromInt(0))); 5094 __ mov(ip, Operand(Smi::FromInt(0)));
5095 } else if (declaration_scope->is_eval_scope()) { 5095 } else if (declaration_scope->is_eval_scope()) {
5096 // Contexts created by a call to eval have the same closure as the 5096 // Contexts created by a call to eval have the same closure as the
5097 // context calling eval, not the anonymous closure containing the eval 5097 // context calling eval, not the anonymous closure containing the eval
5098 // code. Fetch it from the context. 5098 // code. Fetch it from the context.
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
5341 5341
5342 DCHECK(interrupt_address == 5342 DCHECK(interrupt_address ==
5343 isolate->builtins()->OsrAfterStackCheck()->entry()); 5343 isolate->builtins()->OsrAfterStackCheck()->entry());
5344 return OSR_AFTER_STACK_CHECK; 5344 return OSR_AFTER_STACK_CHECK;
5345 } 5345 }
5346 5346
5347 5347
5348 } } // namespace v8::internal 5348 } } // namespace v8::internal
5349 5349
5350 #endif // V8_TARGET_ARCH_ARM 5350 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/arm64/full-codegen-arm64.cc » ('j') | src/full-codegen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698