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_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 | 1258 |
1259 // Return the generated code. | 1259 // Return the generated code. |
1260 return GetCode(kind(), Code::FAST, name); | 1260 return GetCode(kind(), Code::FAST, name); |
1261 } | 1261 } |
1262 | 1262 |
1263 | 1263 |
1264 Register* LoadStubCompiler::registers() { | 1264 Register* LoadStubCompiler::registers() { |
1265 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 1265 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
1266 Register receiver = LoadIC::ReceiverRegister(); | 1266 Register receiver = LoadIC::ReceiverRegister(); |
1267 Register name = LoadIC::NameRegister(); | 1267 Register name = LoadIC::NameRegister(); |
1268 static Register registers[] = { receiver, name, r3, r1, r4, r5 }; | 1268 static Register registers[] = { receiver, name, r3, r0, r4, r5 }; |
1269 return registers; | 1269 return registers; |
1270 } | 1270 } |
1271 | 1271 |
1272 | 1272 |
1273 Register* KeyedLoadStubCompiler::registers() { | 1273 Register* KeyedLoadStubCompiler::registers() { |
1274 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 1274 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
1275 Register receiver = KeyedLoadIC::ReceiverRegister(); | 1275 Register receiver = LoadIC::ReceiverRegister(); |
1276 Register name = KeyedLoadIC::NameRegister(); | 1276 Register name = LoadIC::NameRegister(); |
1277 static Register registers[] = { receiver, name, r2, r3, r4, r5 }; | 1277 static Register registers[] = { receiver, name, r3, r0, r4, r5 }; |
1278 return registers; | 1278 return registers; |
1279 } | 1279 } |
1280 | 1280 |
1281 | 1281 |
1282 Register StoreStubCompiler::value() { | 1282 Register StoreStubCompiler::value() { |
1283 return r0; | 1283 return r0; |
1284 } | 1284 } |
1285 | 1285 |
1286 | 1286 |
1287 Register* StoreStubCompiler::registers() { | 1287 Register* StoreStubCompiler::registers() { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); | 1467 kind(), Code::NORMAL, factory()->empty_string(), POLYMORPHIC); |
1468 } | 1468 } |
1469 | 1469 |
1470 | 1470 |
1471 #undef __ | 1471 #undef __ |
1472 #define __ ACCESS_MASM(masm) | 1472 #define __ ACCESS_MASM(masm) |
1473 | 1473 |
1474 | 1474 |
1475 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( | 1475 void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( |
1476 MacroAssembler* masm) { | 1476 MacroAssembler* masm) { |
1477 // ---------- S t a t e -------------- | 1477 // The return address is in lr. |
1478 // -- lr : return address | |
1479 // -- r0 : key | |
1480 // -- r1 : receiver | |
1481 // ----------------------------------- | |
1482 ASSERT(r1.is(KeyedLoadIC::ReceiverRegister())); | |
1483 ASSERT(r0.is(KeyedLoadIC::NameRegister())); | |
1484 Label slow, miss; | 1478 Label slow, miss; |
1485 | 1479 |
1486 Register key = r0; | 1480 Register key = LoadIC::NameRegister(); |
1487 Register receiver = r1; | 1481 Register receiver = LoadIC::ReceiverRegister(); |
| 1482 ASSERT(receiver.is(r1)); |
| 1483 ASSERT(key.is(r2)); |
1488 | 1484 |
1489 __ UntagAndJumpIfNotSmi(r2, key, &miss); | 1485 __ UntagAndJumpIfNotSmi(r6, key, &miss); |
1490 __ ldr(r4, FieldMemOperand(receiver, JSObject::kElementsOffset)); | 1486 __ ldr(r4, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
1491 __ LoadFromNumberDictionary(&slow, r4, key, r0, r2, r3, r5); | 1487 __ LoadFromNumberDictionary(&slow, r4, key, r0, r6, r3, r5); |
1492 __ Ret(); | 1488 __ Ret(); |
1493 | 1489 |
1494 __ bind(&slow); | 1490 __ bind(&slow); |
1495 __ IncrementCounter( | 1491 __ IncrementCounter( |
1496 masm->isolate()->counters()->keyed_load_external_array_slow(), | 1492 masm->isolate()->counters()->keyed_load_external_array_slow(), |
1497 1, r2, r3); | 1493 1, r2, r3); |
1498 | 1494 |
1499 // ---------- S t a t e -------------- | |
1500 // -- lr : return address | |
1501 // -- r0 : key | |
1502 // -- r1 : receiver | |
1503 // ----------------------------------- | |
1504 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); | 1495 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Slow); |
1505 | 1496 |
1506 // Miss case, call the runtime. | 1497 // Miss case, call the runtime. |
1507 __ bind(&miss); | 1498 __ bind(&miss); |
1508 | 1499 |
1509 // ---------- S t a t e -------------- | |
1510 // -- lr : return address | |
1511 // -- r0 : key | |
1512 // -- r1 : receiver | |
1513 // ----------------------------------- | |
1514 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1500 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1515 } | 1501 } |
1516 | 1502 |
1517 | 1503 |
1518 #undef __ | 1504 #undef __ |
1519 | 1505 |
1520 } } // namespace v8::internal | 1506 } } // namespace v8::internal |
1521 | 1507 |
1522 #endif // V8_TARGET_ARCH_ARM | 1508 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |