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

Side by Side Diff: src/ia32/virtual-frame-ia32.cc

Issue 6697023: Merge 6800:7180 from the bleeding edge branch to the experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/virtual-frame-ia32.h ('k') | src/ic.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize)); 1031 Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
1032 return RawCallCodeObject(ic, mode); 1032 return RawCallCodeObject(ic, mode);
1033 } 1033 }
1034 1034
1035 1035
1036 Result VirtualFrame::CallStoreIC(Handle<String> name, 1036 Result VirtualFrame::CallStoreIC(Handle<String> name,
1037 bool is_contextual, 1037 bool is_contextual,
1038 StrictModeFlag strict_mode) { 1038 StrictModeFlag strict_mode) {
1039 // Value and (if not contextual) receiver are on top of the frame. 1039 // Value and (if not contextual) receiver are on top of the frame.
1040 // The IC expects name in ecx, value in eax, and receiver in edx. 1040 // The IC expects name in ecx, value in eax, and receiver in edx.
1041 Handle<Code> ic(Builtins::builtin(strict_mode == kStrictMode 1041 Handle<Code> ic(Builtins::builtin(
1042 ? Builtins::StoreIC_Initialize_Strict 1042 (strict_mode == kStrictMode) ? Builtins::StoreIC_Initialize_Strict
1043 : Builtins::StoreIC_Initialize)); 1043 : Builtins::StoreIC_Initialize));
1044 1044
1045 Result value = Pop(); 1045 Result value = Pop();
1046 RelocInfo::Mode mode; 1046 RelocInfo::Mode mode;
1047 if (is_contextual) { 1047 if (is_contextual) {
1048 PrepareForCall(0, 0); 1048 PrepareForCall(0, 0);
1049 value.ToRegister(eax); 1049 value.ToRegister(eax);
1050 __ mov(edx, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); 1050 __ mov(edx, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)));
1051 value.Unuse(); 1051 value.Unuse();
1052 mode = RelocInfo::CODE_TARGET_CONTEXT; 1052 mode = RelocInfo::CODE_TARGET_CONTEXT;
1053 } else { 1053 } else {
1054 Result receiver = Pop(); 1054 Result receiver = Pop();
1055 PrepareForCall(0, 0); 1055 PrepareForCall(0, 0);
1056 MoveResultsToRegisters(&value, &receiver, eax, edx); 1056 MoveResultsToRegisters(&value, &receiver, eax, edx);
1057 mode = RelocInfo::CODE_TARGET; 1057 mode = RelocInfo::CODE_TARGET;
1058 } 1058 }
1059 __ mov(ecx, name); 1059 __ mov(ecx, name);
1060 return RawCallCodeObject(ic, mode); 1060 return RawCallCodeObject(ic, mode);
1061 } 1061 }
1062 1062
1063 1063
1064 Result VirtualFrame::CallKeyedStoreIC() { 1064 Result VirtualFrame::CallKeyedStoreIC(StrictModeFlag strict_mode) {
1065 // Value, key, and receiver are on the top of the frame. The IC 1065 // Value, key, and receiver are on the top of the frame. The IC
1066 // expects value in eax, key in ecx, and receiver in edx. 1066 // expects value in eax, key in ecx, and receiver in edx.
1067 Result value = Pop(); 1067 Result value = Pop();
1068 Result key = Pop(); 1068 Result key = Pop();
1069 Result receiver = Pop(); 1069 Result receiver = Pop();
1070 PrepareForCall(0, 0); 1070 PrepareForCall(0, 0);
1071 if (!cgen()->allocator()->is_used(eax) || 1071 if (!cgen()->allocator()->is_used(eax) ||
1072 (value.is_register() && value.reg().is(eax))) { 1072 (value.is_register() && value.reg().is(eax))) {
1073 if (!cgen()->allocator()->is_used(eax)) { 1073 if (!cgen()->allocator()->is_used(eax)) {
1074 value.ToRegister(eax); 1074 value.ToRegister(eax);
(...skipping 23 matching lines...) Expand all
1098 __ xchg(eax, ecx); 1098 __ xchg(eax, ecx);
1099 } else { 1099 } else {
1100 __ xchg(eax, ecx); 1100 __ xchg(eax, ecx);
1101 __ xchg(eax, edx); 1101 __ xchg(eax, edx);
1102 } 1102 }
1103 value.Unuse(); 1103 value.Unuse();
1104 key.Unuse(); 1104 key.Unuse();
1105 receiver.Unuse(); 1105 receiver.Unuse();
1106 } 1106 }
1107 1107
1108 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize)); 1108 Handle<Code> ic(Builtins::builtin(
1109 (strict_mode == kStrictMode) ? Builtins::KeyedStoreIC_Initialize_Strict
1110 : Builtins::KeyedStoreIC_Initialize));
1109 return RawCallCodeObject(ic, RelocInfo::CODE_TARGET); 1111 return RawCallCodeObject(ic, RelocInfo::CODE_TARGET);
1110 } 1112 }
1111 1113
1112 1114
1113 Result VirtualFrame::CallCallIC(RelocInfo::Mode mode, 1115 Result VirtualFrame::CallCallIC(RelocInfo::Mode mode,
1114 int arg_count, 1116 int arg_count,
1115 int loop_nesting) { 1117 int loop_nesting) {
1116 // Function name, arguments, and receiver are on top of the frame. 1118 // Function name, arguments, and receiver are on top of the frame.
1117 // The IC expects the name in ecx and the rest on the stack and 1119 // The IC expects the name in ecx and the rest on the stack and
1118 // drops them all. 1120 // drops them all.
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 1301
1300 void VirtualFrame::EmitPush(Immediate immediate, TypeInfo info) { 1302 void VirtualFrame::EmitPush(Immediate immediate, TypeInfo info) {
1301 ASSERT(stack_pointer_ == element_count() - 1); 1303 ASSERT(stack_pointer_ == element_count() - 1);
1302 elements_.Add(FrameElement::MemoryElement(info)); 1304 elements_.Add(FrameElement::MemoryElement(info));
1303 stack_pointer_++; 1305 stack_pointer_++;
1304 __ push(immediate); 1306 __ push(immediate);
1305 } 1307 }
1306 1308
1307 1309
1308 void VirtualFrame::PushUntaggedElement(Handle<Object> value) { 1310 void VirtualFrame::PushUntaggedElement(Handle<Object> value) {
1311 ASSERT(!ConstantPoolOverflowed());
1309 elements_.Add(FrameElement::ConstantElement(value, FrameElement::NOT_SYNCED)); 1312 elements_.Add(FrameElement::ConstantElement(value, FrameElement::NOT_SYNCED));
1310 elements_[element_count() - 1].set_untagged_int32(true); 1313 elements_[element_count() - 1].set_untagged_int32(true);
1311 } 1314 }
1312 1315
1313 1316
1314 void VirtualFrame::Push(Expression* expr) { 1317 void VirtualFrame::Push(Expression* expr) {
1315 ASSERT(expr->IsTrivial()); 1318 ASSERT(expr->IsTrivial());
1316 1319
1317 Literal* lit = expr->AsLiteral(); 1320 Literal* lit = expr->AsLiteral();
1318 if (lit != NULL) { 1321 if (lit != NULL) {
(...skipping 10 matching lines...) Expand all
1329 } 1332 }
1330 if (slot->type() == Slot::PARAMETER) { 1333 if (slot->type() == Slot::PARAMETER) {
1331 PushParameterAt(slot->index()); 1334 PushParameterAt(slot->index());
1332 return; 1335 return;
1333 } 1336 }
1334 } 1337 }
1335 UNREACHABLE(); 1338 UNREACHABLE();
1336 } 1339 }
1337 1340
1338 1341
1342 void VirtualFrame::Push(Handle<Object> value) {
1343 if (ConstantPoolOverflowed()) {
1344 Result temp = cgen()->allocator()->Allocate();
1345 ASSERT(temp.is_valid());
1346 __ Set(temp.reg(), Immediate(value));
1347 Push(&temp);
1348 } else {
1349 FrameElement element =
1350 FrameElement::ConstantElement(value, FrameElement::NOT_SYNCED);
1351 elements_.Add(element);
1352 }
1353 }
1354
1355
1339 #undef __ 1356 #undef __
1340 1357
1341 } } // namespace v8::internal 1358 } } // namespace v8::internal
1342 1359
1343 #endif // V8_TARGET_ARCH_IA32 1360 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/virtual-frame-ia32.h ('k') | src/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698