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

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

Issue 1218783005: Support for global var shortcuts in script contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixing builds Created 5 years, 5 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/mips/full-codegen-mips.cc ('k') | src/objects.h » ('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_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 } else { 358 } else {
359 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); 359 PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);
360 { Comment cmnt(masm_, "[ Declarations"); 360 { Comment cmnt(masm_, "[ Declarations");
361 // For named function expressions, declare the function name as a 361 // For named function expressions, declare the function name as a
362 // constant. 362 // constant.
363 if (scope()->is_function_scope() && scope()->function() != NULL) { 363 if (scope()->is_function_scope() && scope()->function() != NULL) {
364 VariableDeclaration* function = scope()->function(); 364 VariableDeclaration* function = scope()->function();
365 DCHECK(function->proxy()->var()->mode() == CONST || 365 DCHECK(function->proxy()->var()->mode() == CONST ||
366 function->proxy()->var()->mode() == CONST_LEGACY); 366 function->proxy()->var()->mode() == CONST_LEGACY);
367 DCHECK(function->proxy()->var()->location() != Variable::UNALLOCATED); 367 DCHECK(!function->proxy()->var()->IsUnallocatedOrGlobalSlot());
368 VisitVariableDeclaration(function); 368 VisitVariableDeclaration(function);
369 } 369 }
370 VisitDeclarations(scope()->declarations()); 370 VisitDeclarations(scope()->declarations());
371 } 371 }
372 { Comment cmnt(masm_, "[ Stack check"); 372 { Comment cmnt(masm_, "[ Stack check");
373 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); 373 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS);
374 Label ok; 374 Label ok;
375 __ LoadRoot(at, Heap::kStackLimitRootIndex); 375 __ LoadRoot(at, Heap::kStackLimitRootIndex);
376 __ Branch(&ok, hs, sp, Operand(at)); 376 __ Branch(&ok, hs, sp, Operand(at));
377 Handle<Code> stack_check = isolate()->builtins()->StackCheck(); 377 Handle<Code> stack_check = isolate()->builtins()->StackCheck();
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 void FullCodeGenerator::VisitVariableDeclaration( 865 void FullCodeGenerator::VisitVariableDeclaration(
866 VariableDeclaration* declaration) { 866 VariableDeclaration* declaration) {
867 // If it was not possible to allocate the variable at compile time, we 867 // If it was not possible to allocate the variable at compile time, we
868 // need to "declare" it at runtime to make sure it actually exists in the 868 // need to "declare" it at runtime to make sure it actually exists in the
869 // local context. 869 // local context.
870 VariableProxy* proxy = declaration->proxy(); 870 VariableProxy* proxy = declaration->proxy();
871 VariableMode mode = declaration->mode(); 871 VariableMode mode = declaration->mode();
872 Variable* variable = proxy->var(); 872 Variable* variable = proxy->var();
873 bool hole_init = mode == LET || mode == CONST || mode == CONST_LEGACY; 873 bool hole_init = mode == LET || mode == CONST || mode == CONST_LEGACY;
874 switch (variable->location()) { 874 switch (variable->location()) {
875 case Variable::UNALLOCATED: 875 case VariableLocation::GLOBAL:
876 case VariableLocation::UNALLOCATED:
876 globals_->Add(variable->name(), zone()); 877 globals_->Add(variable->name(), zone());
877 globals_->Add(variable->binding_needs_init() 878 globals_->Add(variable->binding_needs_init()
878 ? isolate()->factory()->the_hole_value() 879 ? isolate()->factory()->the_hole_value()
879 : isolate()->factory()->undefined_value(), 880 : isolate()->factory()->undefined_value(),
880 zone()); 881 zone());
881 break; 882 break;
882 883
883 case Variable::PARAMETER: 884 case VariableLocation::PARAMETER:
884 case Variable::LOCAL: 885 case VariableLocation::LOCAL:
885 if (hole_init) { 886 if (hole_init) {
886 Comment cmnt(masm_, "[ VariableDeclaration"); 887 Comment cmnt(masm_, "[ VariableDeclaration");
887 __ LoadRoot(a4, Heap::kTheHoleValueRootIndex); 888 __ LoadRoot(a4, Heap::kTheHoleValueRootIndex);
888 __ sd(a4, StackOperand(variable)); 889 __ sd(a4, StackOperand(variable));
889 } 890 }
890 break; 891 break;
891 892
892 case Variable::CONTEXT: 893 case VariableLocation::CONTEXT:
893 if (hole_init) { 894 if (hole_init) {
894 Comment cmnt(masm_, "[ VariableDeclaration"); 895 Comment cmnt(masm_, "[ VariableDeclaration");
895 EmitDebugCheckDeclarationContext(variable); 896 EmitDebugCheckDeclarationContext(variable);
896 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 897 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
897 __ sd(at, ContextOperand(cp, variable->index())); 898 __ sd(at, ContextOperand(cp, variable->index()));
898 // No write barrier since the_hole_value is in old space. 899 // No write barrier since the_hole_value is in old space.
899 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); 900 PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
900 } 901 }
901 break; 902 break;
902 903
903 case Variable::LOOKUP: { 904 case VariableLocation::LOOKUP: {
904 Comment cmnt(masm_, "[ VariableDeclaration"); 905 Comment cmnt(masm_, "[ VariableDeclaration");
905 __ li(a2, Operand(variable->name())); 906 __ li(a2, Operand(variable->name()));
906 // Declaration nodes are always introduced in one of four modes. 907 // Declaration nodes are always introduced in one of four modes.
907 DCHECK(IsDeclaredVariableMode(mode)); 908 DCHECK(IsDeclaredVariableMode(mode));
908 PropertyAttributes attr = 909 PropertyAttributes attr =
909 IsImmutableVariableMode(mode) ? READ_ONLY : NONE; 910 IsImmutableVariableMode(mode) ? READ_ONLY : NONE;
910 __ li(a1, Operand(Smi::FromInt(attr))); 911 __ li(a1, Operand(Smi::FromInt(attr)));
911 // Push initial value, if any. 912 // Push initial value, if any.
912 // Note: For variables we must not push an initial value (such as 913 // Note: For variables we must not push an initial value (such as
913 // 'undefined') because we may have a (legal) redeclaration and we 914 // 'undefined') because we may have a (legal) redeclaration and we
(...skipping 11 matching lines...) Expand all
925 } 926 }
926 } 927 }
927 } 928 }
928 929
929 930
930 void FullCodeGenerator::VisitFunctionDeclaration( 931 void FullCodeGenerator::VisitFunctionDeclaration(
931 FunctionDeclaration* declaration) { 932 FunctionDeclaration* declaration) {
932 VariableProxy* proxy = declaration->proxy(); 933 VariableProxy* proxy = declaration->proxy();
933 Variable* variable = proxy->var(); 934 Variable* variable = proxy->var();
934 switch (variable->location()) { 935 switch (variable->location()) {
935 case Variable::UNALLOCATED: { 936 case VariableLocation::GLOBAL:
937 case VariableLocation::UNALLOCATED: {
936 globals_->Add(variable->name(), zone()); 938 globals_->Add(variable->name(), zone());
937 Handle<SharedFunctionInfo> function = 939 Handle<SharedFunctionInfo> function =
938 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_); 940 Compiler::GetSharedFunctionInfo(declaration->fun(), script(), info_);
939 // Check for stack-overflow exception. 941 // Check for stack-overflow exception.
940 if (function.is_null()) return SetStackOverflow(); 942 if (function.is_null()) return SetStackOverflow();
941 globals_->Add(function, zone()); 943 globals_->Add(function, zone());
942 break; 944 break;
943 } 945 }
944 946
945 case Variable::PARAMETER: 947 case VariableLocation::PARAMETER:
946 case Variable::LOCAL: { 948 case VariableLocation::LOCAL: {
947 Comment cmnt(masm_, "[ FunctionDeclaration"); 949 Comment cmnt(masm_, "[ FunctionDeclaration");
948 VisitForAccumulatorValue(declaration->fun()); 950 VisitForAccumulatorValue(declaration->fun());
949 __ sd(result_register(), StackOperand(variable)); 951 __ sd(result_register(), StackOperand(variable));
950 break; 952 break;
951 } 953 }
952 954
953 case Variable::CONTEXT: { 955 case VariableLocation::CONTEXT: {
954 Comment cmnt(masm_, "[ FunctionDeclaration"); 956 Comment cmnt(masm_, "[ FunctionDeclaration");
955 EmitDebugCheckDeclarationContext(variable); 957 EmitDebugCheckDeclarationContext(variable);
956 VisitForAccumulatorValue(declaration->fun()); 958 VisitForAccumulatorValue(declaration->fun());
957 __ sd(result_register(), ContextOperand(cp, variable->index())); 959 __ sd(result_register(), ContextOperand(cp, variable->index()));
958 int offset = Context::SlotOffset(variable->index()); 960 int offset = Context::SlotOffset(variable->index());
959 // We know that we have written a function, which is not a smi. 961 // We know that we have written a function, which is not a smi.
960 __ RecordWriteContextSlot(cp, 962 __ RecordWriteContextSlot(cp,
961 offset, 963 offset,
962 result_register(), 964 result_register(),
963 a2, 965 a2,
964 kRAHasBeenSaved, 966 kRAHasBeenSaved,
965 kDontSaveFPRegs, 967 kDontSaveFPRegs,
966 EMIT_REMEMBERED_SET, 968 EMIT_REMEMBERED_SET,
967 OMIT_SMI_CHECK); 969 OMIT_SMI_CHECK);
968 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); 970 PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
969 break; 971 break;
970 } 972 }
971 973
972 case Variable::LOOKUP: { 974 case VariableLocation::LOOKUP: {
973 Comment cmnt(masm_, "[ FunctionDeclaration"); 975 Comment cmnt(masm_, "[ FunctionDeclaration");
974 __ li(a2, Operand(variable->name())); 976 __ li(a2, Operand(variable->name()));
975 __ li(a1, Operand(Smi::FromInt(NONE))); 977 __ li(a1, Operand(Smi::FromInt(NONE)));
976 __ Push(cp, a2, a1); 978 __ Push(cp, a2, a1);
977 // Push initial value for function declaration. 979 // Push initial value for function declaration.
978 VisitForStackValue(declaration->fun()); 980 VisitForStackValue(declaration->fun());
979 __ CallRuntime(Runtime::kDeclareLookupSlot, 4); 981 __ CallRuntime(Runtime::kDeclareLookupSlot, 4);
980 break; 982 break;
981 } 983 }
982 } 984 }
983 } 985 }
984 986
985 987
986 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) { 988 void FullCodeGenerator::VisitImportDeclaration(ImportDeclaration* declaration) {
987 VariableProxy* proxy = declaration->proxy(); 989 VariableProxy* proxy = declaration->proxy();
988 Variable* variable = proxy->var(); 990 Variable* variable = proxy->var();
989 switch (variable->location()) { 991 switch (variable->location()) {
990 case Variable::UNALLOCATED: 992 case VariableLocation::GLOBAL:
993 case VariableLocation::UNALLOCATED:
991 // TODO(rossberg) 994 // TODO(rossberg)
992 break; 995 break;
993 996
994 case Variable::CONTEXT: { 997 case VariableLocation::CONTEXT: {
995 Comment cmnt(masm_, "[ ImportDeclaration"); 998 Comment cmnt(masm_, "[ ImportDeclaration");
996 EmitDebugCheckDeclarationContext(variable); 999 EmitDebugCheckDeclarationContext(variable);
997 // TODO(rossberg) 1000 // TODO(rossberg)
998 break; 1001 break;
999 } 1002 }
1000 1003
1001 case Variable::PARAMETER: 1004 case VariableLocation::PARAMETER:
1002 case Variable::LOCAL: 1005 case VariableLocation::LOCAL:
1003 case Variable::LOOKUP: 1006 case VariableLocation::LOOKUP:
1004 UNREACHABLE(); 1007 UNREACHABLE();
1005 } 1008 }
1006 } 1009 }
1007 1010
1008 1011
1009 void FullCodeGenerator::VisitExportDeclaration(ExportDeclaration* declaration) { 1012 void FullCodeGenerator::VisitExportDeclaration(ExportDeclaration* declaration) {
1010 // TODO(rossberg) 1013 // TODO(rossberg)
1011 } 1014 }
1012 1015
1013 1016
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 1484
1482 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) { 1485 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
1483 // Record position before possible IC call. 1486 // Record position before possible IC call.
1484 SetExpressionPosition(proxy); 1487 SetExpressionPosition(proxy);
1485 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); 1488 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS);
1486 Variable* var = proxy->var(); 1489 Variable* var = proxy->var();
1487 1490
1488 // Three cases: global variables, lookup variables, and all other types of 1491 // Three cases: global variables, lookup variables, and all other types of
1489 // variables. 1492 // variables.
1490 switch (var->location()) { 1493 switch (var->location()) {
1491 case Variable::UNALLOCATED: { 1494 case VariableLocation::GLOBAL:
1495 case VariableLocation::UNALLOCATED: {
1492 Comment cmnt(masm_, "[ Global variable"); 1496 Comment cmnt(masm_, "[ Global variable");
1493 // Use inline caching. Variable name is passed in a2 and the global 1497 // Use inline caching. Variable name is passed in a2 and the global
1494 // object (receiver) in a0. 1498 // object (receiver) in a0.
1495 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); 1499 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1496 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); 1500 __ li(LoadDescriptor::NameRegister(), Operand(var->name()));
1497 __ li(LoadDescriptor::SlotRegister(), 1501 __ li(LoadDescriptor::SlotRegister(),
1498 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); 1502 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
1499 CallGlobalLoadIC(var->name()); 1503 CallGlobalLoadIC(var->name());
1500 context()->Plug(v0); 1504 context()->Plug(v0);
1501 break; 1505 break;
1502 } 1506 }
1503 1507
1504 case Variable::PARAMETER: 1508 case VariableLocation::PARAMETER:
1505 case Variable::LOCAL: 1509 case VariableLocation::LOCAL:
1506 case Variable::CONTEXT: { 1510 case VariableLocation::CONTEXT: {
1507 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable" 1511 Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable"
1508 : "[ Stack variable"); 1512 : "[ Stack variable");
1509 if (var->binding_needs_init()) { 1513 if (var->binding_needs_init()) {
1510 // var->scope() may be NULL when the proxy is located in eval code and 1514 // var->scope() may be NULL when the proxy is located in eval code and
1511 // refers to a potential outside binding. Currently those bindings are 1515 // refers to a potential outside binding. Currently those bindings are
1512 // always looked up dynamically, i.e. in that case 1516 // always looked up dynamically, i.e. in that case
1513 // var->location() == LOOKUP. 1517 // var->location() == LOOKUP.
1514 // always holds. 1518 // always holds.
1515 DCHECK(var->scope() != NULL); 1519 DCHECK(var->scope() != NULL);
1516 1520
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 __ Movz(v0, a0, at); // Conditional move: Undefined if TheHole. 1571 __ Movz(v0, a0, at); // Conditional move: Undefined if TheHole.
1568 } 1572 }
1569 context()->Plug(v0); 1573 context()->Plug(v0);
1570 break; 1574 break;
1571 } 1575 }
1572 } 1576 }
1573 context()->Plug(var); 1577 context()->Plug(var);
1574 break; 1578 break;
1575 } 1579 }
1576 1580
1577 case Variable::LOOKUP: { 1581 case VariableLocation::LOOKUP: {
1578 Comment cmnt(masm_, "[ Lookup variable"); 1582 Comment cmnt(masm_, "[ Lookup variable");
1579 Label done, slow; 1583 Label done, slow;
1580 // Generate code for loading from variables potentially shadowed 1584 // Generate code for loading from variables potentially shadowed
1581 // by eval-introduced variables. 1585 // by eval-introduced variables.
1582 EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done); 1586 EmitDynamicLookupFastCase(proxy, NOT_INSIDE_TYPEOF, &slow, &done);
1583 __ bind(&slow); 1587 __ bind(&slow);
1584 __ li(a1, Operand(var->name())); 1588 __ li(a1, Operand(var->name()));
1585 __ Push(cp, a1); // Context and name. 1589 __ Push(cp, a1); // Context and name.
1586 __ CallRuntime(Runtime::kLoadLookupSlot, 2); 1590 __ CallRuntime(Runtime::kLoadLookupSlot, 2);
1587 __ bind(&done); 1591 __ bind(&done);
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2717 __ Move(a3, result_register()); 2721 __ Move(a3, result_register());
2718 int offset = Context::SlotOffset(var->index()); 2722 int offset = Context::SlotOffset(var->index());
2719 __ RecordWriteContextSlot( 2723 __ RecordWriteContextSlot(
2720 a1, offset, a3, a2, kRAHasBeenSaved, kDontSaveFPRegs); 2724 a1, offset, a3, a2, kRAHasBeenSaved, kDontSaveFPRegs);
2721 } 2725 }
2722 } 2726 }
2723 2727
2724 2728
2725 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, 2729 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
2726 FeedbackVectorICSlot slot) { 2730 FeedbackVectorICSlot slot) {
2727 if (var->IsUnallocated()) { 2731 if (var->IsUnallocatedOrGlobalSlot()) {
2728 // Global var, const, or let. 2732 // Global var, const, or let.
2729 __ mov(StoreDescriptor::ValueRegister(), result_register()); 2733 __ mov(StoreDescriptor::ValueRegister(), result_register());
2730 __ li(StoreDescriptor::NameRegister(), Operand(var->name())); 2734 __ li(StoreDescriptor::NameRegister(), Operand(var->name()));
2731 __ ld(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); 2735 __ ld(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand());
2732 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); 2736 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot);
2733 CallStoreIC(); 2737 CallStoreIC();
2734 2738
2735 } else if (var->mode() == LET && op != Token::INIT_LET) { 2739 } else if (var->mode() == LET && op != Token::INIT_LET) {
2736 // Non-initializing assignment to let variable needs a write barrier. 2740 // Non-initializing assignment to let variable needs a write barrier.
2737 DCHECK(!var->IsLookupSlot()); 2741 DCHECK(!var->IsLookupSlot());
(...skipping 2075 matching lines...) Expand 10 before | Expand all | Expand 10 after
4813 __ li(a1, Operand(Smi::FromInt(language_mode()))); 4817 __ li(a1, Operand(Smi::FromInt(language_mode())));
4814 __ push(a1); 4818 __ push(a1);
4815 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); 4819 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
4816 context()->Plug(v0); 4820 context()->Plug(v0);
4817 } else if (proxy != NULL) { 4821 } else if (proxy != NULL) {
4818 Variable* var = proxy->var(); 4822 Variable* var = proxy->var();
4819 // Delete of an unqualified identifier is disallowed in strict mode but 4823 // Delete of an unqualified identifier is disallowed in strict mode but
4820 // "delete this" is allowed. 4824 // "delete this" is allowed.
4821 bool is_this = var->HasThisName(isolate()); 4825 bool is_this = var->HasThisName(isolate());
4822 DCHECK(is_sloppy(language_mode()) || is_this); 4826 DCHECK(is_sloppy(language_mode()) || is_this);
4823 if (var->IsUnallocated()) { 4827 if (var->IsUnallocatedOrGlobalSlot()) {
4824 __ ld(a2, GlobalObjectOperand()); 4828 __ ld(a2, GlobalObjectOperand());
4825 __ li(a1, Operand(var->name())); 4829 __ li(a1, Operand(var->name()));
4826 __ li(a0, Operand(Smi::FromInt(SLOPPY))); 4830 __ li(a0, Operand(Smi::FromInt(SLOPPY)));
4827 __ Push(a2, a1, a0); 4831 __ Push(a2, a1, a0);
4828 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION); 4832 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION);
4829 context()->Plug(v0); 4833 context()->Plug(v0);
4830 } else if (var->IsStackAllocated() || var->IsContextSlot()) { 4834 } else if (var->IsStackAllocated() || var->IsContextSlot()) {
4831 // Result of deleting non-global, non-dynamic variables is false. 4835 // Result of deleting non-global, non-dynamic variables is false.
4832 // The subexpression does not have side effects. 4836 // The subexpression does not have side effects.
4833 context()->Plug(is_this); 4837 context()->Plug(is_this);
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
5174 break; 5178 break;
5175 } 5179 }
5176 } 5180 }
5177 } 5181 }
5178 5182
5179 5183
5180 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) { 5184 void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
5181 DCHECK(!context()->IsEffect()); 5185 DCHECK(!context()->IsEffect());
5182 DCHECK(!context()->IsTest()); 5186 DCHECK(!context()->IsTest());
5183 VariableProxy* proxy = expr->AsVariableProxy(); 5187 VariableProxy* proxy = expr->AsVariableProxy();
5184 if (proxy != NULL && proxy->var()->IsUnallocated()) { 5188 if (proxy != NULL && proxy->var()->IsUnallocatedOrGlobalSlot()) {
5185 Comment cmnt(masm_, "[ Global variable"); 5189 Comment cmnt(masm_, "[ Global variable");
5186 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); 5190 __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
5187 __ li(LoadDescriptor::NameRegister(), Operand(proxy->name())); 5191 __ li(LoadDescriptor::NameRegister(), Operand(proxy->name()));
5188 __ li(LoadDescriptor::SlotRegister(), 5192 __ li(LoadDescriptor::SlotRegister(),
5189 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); 5193 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
5190 // Use a regular load, not a contextual load, to avoid a reference 5194 // Use a regular load, not a contextual load, to avoid a reference
5191 // error. 5195 // error.
5192 CallLoadIC(NOT_CONTEXTUAL); 5196 CallLoadIC(NOT_CONTEXTUAL);
5193 PrepareForBailout(expr, TOS_REG); 5197 PrepareForBailout(expr, TOS_REG);
5194 context()->Plug(v0); 5198 context()->Plug(v0);
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
5580 reinterpret_cast<uint64_t>( 5584 reinterpret_cast<uint64_t>(
5581 isolate->builtins()->OsrAfterStackCheck()->entry())); 5585 isolate->builtins()->OsrAfterStackCheck()->entry()));
5582 return OSR_AFTER_STACK_CHECK; 5586 return OSR_AFTER_STACK_CHECK;
5583 } 5587 }
5584 5588
5585 5589
5586 } // namespace internal 5590 } // namespace internal
5587 } // namespace v8 5591 } // namespace v8
5588 5592
5589 #endif // V8_TARGET_ARCH_MIPS64 5593 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698