OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 push(holder_reg); // Temporarily save holder on the stack. | 1365 push(holder_reg); // Temporarily save holder on the stack. |
1366 // Read the first word and compare to the native_context_map. | 1366 // Read the first word and compare to the native_context_map. |
1367 ldr(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset)); | 1367 ldr(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset)); |
1368 LoadRoot(ip, Heap::kNativeContextMapRootIndex); | 1368 LoadRoot(ip, Heap::kNativeContextMapRootIndex); |
1369 cmp(holder_reg, ip); | 1369 cmp(holder_reg, ip); |
1370 Check(eq, "JSGlobalObject::native_context should be a native context."); | 1370 Check(eq, "JSGlobalObject::native_context should be a native context."); |
1371 pop(holder_reg); // Restore holder. | 1371 pop(holder_reg); // Restore holder. |
1372 } | 1372 } |
1373 | 1373 |
1374 // Check if both contexts are the same. | 1374 // Check if both contexts are the same. |
1375 ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset)); | 1375 ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kNativeContextOffset)); |
1376 cmp(scratch, Operand(ip)); | 1376 cmp(scratch, Operand(ip)); |
1377 b(eq, &same_contexts); | 1377 b(eq, &same_contexts); |
1378 | 1378 |
1379 // Check the context is a native context. | 1379 // Check the context is a native context. |
1380 if (emit_debug_code()) { | 1380 if (emit_debug_code()) { |
1381 // TODO(119): avoid push(holder_reg)/pop(holder_reg) | 1381 // TODO(119): avoid push(holder_reg)/pop(holder_reg) |
1382 // Cannot use ip as a temporary in this verification code. Due to the fact | 1382 // Cannot use ip as a temporary in this verification code. Due to the fact |
1383 // that ip is clobbered as part of cmp with an object Operand. | 1383 // that ip is clobbered as part of cmp with an object Operand. |
1384 push(holder_reg); // Temporarily save holder on the stack. | 1384 push(holder_reg); // Temporarily save holder on the stack. |
1385 mov(holder_reg, ip); // Move ip to its holding place. | 1385 mov(holder_reg, ip); // Move ip to its holding place. |
1386 LoadRoot(ip, Heap::kNullValueRootIndex); | 1386 LoadRoot(ip, Heap::kNullValueRootIndex); |
1387 cmp(holder_reg, ip); | 1387 cmp(holder_reg, ip); |
1388 Check(ne, "JSGlobalProxy::context() should not be null."); | 1388 Check(ne, "JSGlobalProxy::context() should not be null."); |
1389 | 1389 |
1390 ldr(holder_reg, FieldMemOperand(holder_reg, HeapObject::kMapOffset)); | 1390 ldr(holder_reg, FieldMemOperand(holder_reg, HeapObject::kMapOffset)); |
1391 LoadRoot(ip, Heap::kNativeContextMapRootIndex); | 1391 LoadRoot(ip, Heap::kNativeContextMapRootIndex); |
1392 cmp(holder_reg, ip); | 1392 cmp(holder_reg, ip); |
1393 Check(eq, "JSGlobalObject::native_context should be a native context."); | 1393 Check(eq, "JSGlobalObject::native_context should be a native context."); |
1394 // Restore ip is not needed. ip is reloaded below. | 1394 // Restore ip is not needed. ip is reloaded below. |
1395 pop(holder_reg); // Restore holder. | 1395 pop(holder_reg); // Restore holder. |
1396 // Restore ip to holder's context. | 1396 // Restore ip to holder's context. |
1397 ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kContextOffset)); | 1397 ldr(ip, FieldMemOperand(holder_reg, JSGlobalProxy::kNativeContextOffset)); |
1398 } | 1398 } |
1399 | 1399 |
1400 // Check that the security token in the calling global object is | 1400 // Check that the security token in the calling global object is |
1401 // compatible with the security token in the receiving global | 1401 // compatible with the security token in the receiving global |
1402 // object. | 1402 // object. |
1403 int token_offset = Context::kHeaderSize + | 1403 int token_offset = Context::kHeaderSize + |
1404 Context::SECURITY_TOKEN_INDEX * kPointerSize; | 1404 Context::SECURITY_TOKEN_INDEX * kPointerSize; |
1405 | 1405 |
1406 ldr(scratch, FieldMemOperand(scratch, token_offset)); | 1406 ldr(scratch, FieldMemOperand(scratch, token_offset)); |
1407 ldr(ip, FieldMemOperand(ip, token_offset)); | 1407 ldr(ip, FieldMemOperand(ip, token_offset)); |
(...skipping 2416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3824 void CodePatcher::EmitCondition(Condition cond) { | 3824 void CodePatcher::EmitCondition(Condition cond) { |
3825 Instr instr = Assembler::instr_at(masm_.pc_); | 3825 Instr instr = Assembler::instr_at(masm_.pc_); |
3826 instr = (instr & ~kCondMask) | cond; | 3826 instr = (instr & ~kCondMask) | cond; |
3827 masm_.emit(instr); | 3827 masm_.emit(instr); |
3828 } | 3828 } |
3829 | 3829 |
3830 | 3830 |
3831 } } // namespace v8::internal | 3831 } } // namespace v8::internal |
3832 | 3832 |
3833 #endif // V8_TARGET_ARCH_ARM | 3833 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |