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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 2542403002: MIPS: Use JIC/JIALC offset when possible (Closed)
Patch Set: Fix deserialization problem, rebase to master Created 3 years, 7 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
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 #if V8_TARGET_ARCH_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 Label zero; 1095 Label zero;
1096 __ Branch(&zero, eq, cp, Operand(zero_reg)); 1096 __ Branch(&zero, eq, cp, Operand(zero_reg));
1097 __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 1097 __ sw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
1098 __ bind(&zero); 1098 __ bind(&zero);
1099 1099
1100 // Compute the handler entry address and jump to it. 1100 // Compute the handler entry address and jump to it.
1101 __ li(a1, Operand(pending_handler_code_address)); 1101 __ li(a1, Operand(pending_handler_code_address));
1102 __ lw(a1, MemOperand(a1)); 1102 __ lw(a1, MemOperand(a1));
1103 __ li(a2, Operand(pending_handler_offset_address)); 1103 __ li(a2, Operand(pending_handler_offset_address));
1104 __ lw(a2, MemOperand(a2)); 1104 __ lw(a2, MemOperand(a2));
1105 __ Addu(a1, a1, Operand(Code::kHeaderSize - kHeapObjectTag));
1106 __ Addu(t9, a1, a2); 1105 __ Addu(t9, a1, a2);
1107 __ Jump(t9); 1106 __ Jump(t9, Code::kHeaderSize - kHeapObjectTag);
1108 } 1107 }
1109 1108
1110 1109
1111 void JSEntryStub::Generate(MacroAssembler* masm) { 1110 void JSEntryStub::Generate(MacroAssembler* masm) {
1112 Label invoke, handler_entry, exit; 1111 Label invoke, handler_entry, exit;
1113 Isolate* isolate = masm->isolate(); 1112 Isolate* isolate = masm->isolate();
1114 1113
1115 // Registers: 1114 // Registers:
1116 // a0: entry address 1115 // a0: entry address
1117 // a1: function 1116 // a1: function
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, 1229 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline,
1231 isolate); 1230 isolate);
1232 __ li(t0, Operand(construct_entry)); 1231 __ li(t0, Operand(construct_entry));
1233 } else { 1232 } else {
1234 ExternalReference entry(Builtins::kJSEntryTrampoline, masm->isolate()); 1233 ExternalReference entry(Builtins::kJSEntryTrampoline, masm->isolate());
1235 __ li(t0, Operand(entry)); 1234 __ li(t0, Operand(entry));
1236 } 1235 }
1237 __ lw(t9, MemOperand(t0)); // Deref address. 1236 __ lw(t9, MemOperand(t0)); // Deref address.
1238 1237
1239 // Call JSEntryTrampoline. 1238 // Call JSEntryTrampoline.
1240 __ addiu(t9, t9, Code::kHeaderSize - kHeapObjectTag); 1239 __ Call(t9, Code::kHeaderSize - kHeapObjectTag);
1241 __ Call(t9);
1242 1240
1243 // Unlink this frame from the handler chain. 1241 // Unlink this frame from the handler chain.
1244 __ PopStackHandler(); 1242 __ PopStackHandler();
1245 1243
1246 __ bind(&exit); // v0 holds result 1244 __ bind(&exit); // v0 holds result
1247 // Check if the current stack frame is marked as the outermost JS frame. 1245 // Check if the current stack frame is marked as the outermost JS frame.
1248 Label non_outermost_js_2; 1246 Label non_outermost_js_2;
1249 __ pop(t1); 1247 __ pop(t1);
1250 __ Branch(&non_outermost_js_2, ne, t1, 1248 __ Branch(&non_outermost_js_2, ne, t1,
1251 Operand(StackFrame::OUTERMOST_JSENTRY_FRAME)); 1249 Operand(StackFrame::OUTERMOST_JSENTRY_FRAME));
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 1412
1415 __ AssertUndefinedOrAllocationSite(a2, t1); 1413 __ AssertUndefinedOrAllocationSite(a2, t1);
1416 1414
1417 // Pass function as new target. 1415 // Pass function as new target.
1418 __ mov(a3, a1); 1416 __ mov(a3, a1);
1419 1417
1420 // Tail call to the function-specific construct stub (still in the caller 1418 // Tail call to the function-specific construct stub (still in the caller
1421 // context at this point). 1419 // context at this point).
1422 __ lw(t0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 1420 __ lw(t0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
1423 __ lw(t0, FieldMemOperand(t0, SharedFunctionInfo::kConstructStubOffset)); 1421 __ lw(t0, FieldMemOperand(t0, SharedFunctionInfo::kConstructStubOffset));
1424 __ Addu(at, t0, Operand(Code::kHeaderSize - kHeapObjectTag)); 1422 __ Jump(at, t0, Code::kHeaderSize - kHeapObjectTag);
1425 __ Jump(at);
1426 1423
1427 __ bind(&non_function); 1424 __ bind(&non_function);
1428 __ mov(a3, a1); 1425 __ mov(a3, a1);
1429 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET); 1426 __ Jump(isolate()->builtins()->Construct(), RelocInfo::CODE_TARGET);
1430 } 1427 }
1431 1428
1432 // StringCharCodeAtGenerator. 1429 // StringCharCodeAtGenerator.
1433 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) { 1430 void StringCharCodeAtGenerator::GenerateFast(MacroAssembler* masm) {
1434 DCHECK(!t0.is(index_)); 1431 DCHECK(!t0.is(index_));
1435 DCHECK(!t0.is(result_)); 1432 DCHECK(!t0.is(result_));
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after
3103 kStackUnwindSpace, kInvalidStackOffset, 3100 kStackUnwindSpace, kInvalidStackOffset,
3104 return_value_operand, NULL); 3101 return_value_operand, NULL);
3105 } 3102 }
3106 3103
3107 #undef __ 3104 #undef __
3108 3105
3109 } // namespace internal 3106 } // namespace internal
3110 } // namespace v8 3107 } // namespace v8
3111 3108
3112 #endif // V8_TARGET_ARCH_MIPS 3109 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698