OLD | NEW |
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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic-inl.h" | 10 #include "src/ic-inl.h" |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 | 1249 |
1250 // Return the generated code. | 1250 // Return the generated code. |
1251 return GetCode(kind(), Code::FAST, name); | 1251 return GetCode(kind(), Code::FAST, name); |
1252 } | 1252 } |
1253 | 1253 |
1254 | 1254 |
1255 Register* LoadStubCompiler::registers() { | 1255 Register* LoadStubCompiler::registers() { |
1256 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 1256 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
1257 Register receiver = LoadIC::ReceiverRegister(); | 1257 Register receiver = LoadIC::ReceiverRegister(); |
1258 Register name = LoadIC::NameRegister(); | 1258 Register name = LoadIC::NameRegister(); |
1259 static Register registers[] = { receiver, name, a3, a1, t0, t1 }; | 1259 static Register registers[] = { receiver, name, a3, a0, t0, t1 }; |
1260 return registers; | 1260 return registers; |
1261 } | 1261 } |
1262 | 1262 |
1263 | 1263 |
1264 Register* KeyedLoadStubCompiler::registers() { | 1264 Register* KeyedLoadStubCompiler::registers() { |
1265 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 1265 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
1266 Register receiver = KeyedLoadIC::ReceiverRegister(); | 1266 Register receiver = LoadIC::ReceiverRegister(); |
1267 Register name = KeyedLoadIC::NameRegister(); | 1267 Register name = LoadIC::NameRegister(); |
1268 static Register registers[] = { receiver, name, a2, a3, t0, t1 }; | 1268 static Register registers[] = { receiver, name, a3, a0, t0, t1 }; |
1269 return registers; | 1269 return registers; |
1270 } | 1270 } |
1271 | 1271 |
1272 | 1272 |
1273 Register StoreStubCompiler::value() { | 1273 Register StoreStubCompiler::value() { |
1274 return a0; | 1274 return a0; |
1275 } | 1275 } |
1276 | 1276 |
1277 | 1277 |
1278 Register* StoreStubCompiler::registers() { | 1278 Register* StoreStubCompiler::registers() { |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); | 1459 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); |
1460 } | 1460 } |
1461 | 1461 |
1462 | 1462 |
1463 #undef __ | 1463 #undef __ |
1464 #define __ ACCESS_MASM(masm) | 1464 #define __ ACCESS_MASM(masm) |
1465 | 1465 |
1466 | 1466 |
1467 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( | 1467 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( |
1468 MacroAssembler* masm) { | 1468 MacroAssembler* masm) { |
1469 // ---------- S t a t e -------------- | 1469 // The return address is in ra. |
1470 // -- ra : return address | |
1471 // -- a0 : key | |
1472 // -- a1 : receiver | |
1473 // ----------------------------------- | |
1474 ASSERT(a1.is(KeyedLoadIC::ReceiverRegister())); | |
1475 ASSERT(a0.is(KeyedLoadIC::NameRegister())); | |
1476 Label slow, miss; | 1470 Label slow, miss; |
1477 | 1471 |
1478 Register key = a0; | 1472 Register key = LoadIC::NameRegister(); |
1479 Register receiver = a1; | 1473 Register receiver = LoadIC::ReceiverRegister(); |
| 1474 ASSERT(receiver.is(a1)); |
| 1475 ASSERT(key.is(a2)); |
1480 | 1476 |
1481 __ JumpIfNotSmi(key, &miss); | 1477 __ UntagAndJumpIfNotSmi(t2, key, &miss); |
1482 __ lw(t0, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1478 __ lw(t0, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1483 __ sra(a2, a0, kSmiTagSize); | 1479 __ LoadFromNumberDictionary(&slow, t0, key, v0, t2, a3, t1); |
1484 __ LoadFromNumberDictionary(&slow, t0, a0, v0, a2, a3, t1); | |
1485 __ Ret(); | 1480 __ Ret(); |
1486 | 1481 |
1487 // Slow case, key and receiver still in a0 and a1. | 1482 // Slow case, key and receiver still unmodified. |
1488 __ bind(&slow); | 1483 __ bind(&slow); |
1489 __ IncrementCounter( | 1484 __ IncrementCounter( |
1490 masm->isolate()->counters()->keyed_load_external_array_slow(), | 1485 masm->isolate()->counters()->keyed_load_external_array_slow(), |
1491 1, a2, a3); | 1486 1, a2, a3); |
1492 // Entry registers are intact. | 1487 |
1493 // ---------- S t a t e -------------- | |
1494 // -- ra : return address | |
1495 // -- a0 : key | |
1496 // -- a1 : receiver | |
1497 // ----------------------------------- | |
1498 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); | 1488 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); |
1499 | 1489 |
1500 // Miss case, call the runtime. | 1490 // Miss case, call the runtime. |
1501 __ bind(&miss); | 1491 __ bind(&miss); |
1502 | 1492 |
1503 // ---------- S t a t e -------------- | |
1504 // -- ra : return address | |
1505 // -- a0 : key | |
1506 // -- a1 : receiver | |
1507 // ----------------------------------- | |
1508 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1493 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1509 } | 1494 } |
1510 | 1495 |
1511 | 1496 |
1512 #undef __ | 1497 #undef __ |
1513 | 1498 |
1514 } } // namespace v8::internal | 1499 } } // namespace v8::internal |
1515 | 1500 |
1516 #endif // V8_TARGET_ARCH_MIPS | 1501 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |