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

Side by Side Diff: src/mips64/full-codegen-mips64.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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 194 }
195 195
196 bool function_in_register = true; 196 bool function_in_register = true;
197 197
198 // Possibly allocate a local context. 198 // Possibly allocate a local context.
199 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; 199 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS;
200 if (heap_slots > 0) { 200 if (heap_slots > 0) {
201 Comment cmnt(masm_, "[ Allocate context"); 201 Comment cmnt(masm_, "[ Allocate context");
202 // Argument to NewContext is the function, which is still in a1. 202 // Argument to NewContext is the function, which is still in a1.
203 bool need_write_barrier = true; 203 bool need_write_barrier = true;
204 if (FLAG_harmony_scoping && info->scope()->is_global_scope()) { 204 if (FLAG_harmony_scoping && info->scope()->is_script_scope()) {
205 __ push(a1); 205 __ push(a1);
206 __ Push(info->scope()->GetScopeInfo()); 206 __ Push(info->scope()->GetScopeInfo());
207 __ CallRuntime(Runtime::kNewGlobalContext, 2); 207 __ CallRuntime(Runtime::kNewScriptContext, 2);
208 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { 208 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) {
209 FastNewContextStub stub(isolate(), heap_slots); 209 FastNewContextStub stub(isolate(), heap_slots);
210 __ CallStub(&stub); 210 __ CallStub(&stub);
211 // Result of FastNewContextStub is always in new space. 211 // Result of FastNewContextStub is always in new space.
212 need_write_barrier = false; 212 need_write_barrier = false;
213 } else { 213 } else {
214 __ push(a1); 214 __ push(a1);
215 __ CallRuntime(Runtime::kNewFunctionContext, 1); 215 __ CallRuntime(Runtime::kNewFunctionContext, 1);
216 } 216 }
217 function_in_register = false; 217 function_in_register = false;
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 917
918 918
919 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) { 919 void FullCodeGenerator::VisitModuleDeclaration(ModuleDeclaration* declaration) {
920 Variable* variable = declaration->proxy()->var(); 920 Variable* variable = declaration->proxy()->var();
921 DCHECK(variable->location() == Variable::CONTEXT); 921 DCHECK(variable->location() == Variable::CONTEXT);
922 DCHECK(variable->interface()->IsFrozen()); 922 DCHECK(variable->interface()->IsFrozen());
923 Comment cmnt(masm_, "[ ModuleDeclaration"); 923 Comment cmnt(masm_, "[ ModuleDeclaration");
924 EmitDebugCheckDeclarationContext(variable); 924 EmitDebugCheckDeclarationContext(variable);
925 925
926 // Load instance object. 926 // Load instance object.
927 __ LoadContext(a1, scope_->ContextChainLength(scope_->GlobalScope())); 927 __ LoadContext(a1, scope_->ContextChainLength(scope_->ScriptScope()));
928 __ ld(a1, ContextOperand(a1, variable->interface()->Index())); 928 __ ld(a1, ContextOperand(a1, variable->interface()->Index()));
929 __ ld(a1, ContextOperand(a1, Context::EXTENSION_INDEX)); 929 __ ld(a1, ContextOperand(a1, Context::EXTENSION_INDEX));
930 930
931 // Assign it. 931 // Assign it.
932 __ sd(a1, ContextOperand(cp, variable->index())); 932 __ sd(a1, ContextOperand(cp, variable->index()));
933 // We know that we have written a module, which is not a smi. 933 // We know that we have written a module, which is not a smi.
934 __ RecordWriteContextSlot(cp, 934 __ RecordWriteContextSlot(cp,
935 Context::SlotOffset(variable->index()), 935 Context::SlotOffset(variable->index()),
936 a1, 936 a1,
937 a3, 937 a3,
(...skipping 4141 matching lines...) Expand 10 before | Expand all | Expand 10 after
5079 } 5079 }
5080 5080
5081 5081
5082 void FullCodeGenerator::LoadContextField(Register dst, int context_index) { 5082 void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
5083 __ ld(dst, ContextOperand(cp, context_index)); 5083 __ ld(dst, ContextOperand(cp, context_index));
5084 } 5084 }
5085 5085
5086 5086
5087 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { 5087 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
5088 Scope* declaration_scope = scope()->DeclarationScope(); 5088 Scope* declaration_scope = scope()->DeclarationScope();
5089 if (declaration_scope->is_global_scope() || 5089 if (declaration_scope->is_script_scope() ||
5090 declaration_scope->is_module_scope()) { 5090 declaration_scope->is_module_scope()) {
5091 // Contexts nested in the native context have a canonical empty function 5091 // Contexts nested in the native context have a canonical empty function
5092 // as their closure, not the anonymous closure containing the global 5092 // as their closure, not the anonymous closure containing the global
5093 // code. Pass a smi sentinel and let the runtime look up the empty 5093 // code. Pass a smi sentinel and let the runtime look up the empty
5094 // function. 5094 // function.
5095 __ li(at, Operand(Smi::FromInt(0))); 5095 __ li(at, Operand(Smi::FromInt(0)));
5096 } else if (declaration_scope->is_eval_scope()) { 5096 } else if (declaration_scope->is_eval_scope()) {
5097 // Contexts created by a call to eval have the same closure as the 5097 // Contexts created by a call to eval have the same closure as the
5098 // context calling eval, not the anonymous closure containing the eval 5098 // context calling eval, not the anonymous closure containing the eval
5099 // code. Fetch it from the context. 5099 // code. Fetch it from the context.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
5283 Assembler::target_address_at(pc_immediate_load_address)) == 5283 Assembler::target_address_at(pc_immediate_load_address)) ==
5284 reinterpret_cast<uint64_t>( 5284 reinterpret_cast<uint64_t>(
5285 isolate->builtins()->OsrAfterStackCheck()->entry())); 5285 isolate->builtins()->OsrAfterStackCheck()->entry()));
5286 return OSR_AFTER_STACK_CHECK; 5286 return OSR_AFTER_STACK_CHECK;
5287 } 5287 }
5288 5288
5289 5289
5290 } } // namespace v8::internal 5290 } } // namespace v8::internal
5291 5291
5292 #endif // V8_TARGET_ARCH_MIPS64 5292 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698