OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 21 matching lines...) Expand all Loading... |
32 #include "debug.h" | 32 #include "debug.h" |
33 #include "macro-assembler.h" | 33 #include "macro-assembler.h" |
34 | 34 |
35 namespace v8 { namespace internal { | 35 namespace v8 { namespace internal { |
36 | 36 |
37 | 37 |
38 Address IC::address() { | 38 Address IC::address() { |
39 // Get the address of the call. | 39 // Get the address of the call. |
40 Address result = pc() - Assembler::kTargetAddrToReturnAddrDist; | 40 Address result = pc() - Assembler::kTargetAddrToReturnAddrDist; |
41 | 41 |
| 42 #ifdef ENABLE_DEBUGGER_SUPPORT |
42 // First check if any break points are active if not just return the address | 43 // First check if any break points are active if not just return the address |
43 // of the call. | 44 // of the call. |
44 if (!Debug::has_break_points()) return result; | 45 if (!Debug::has_break_points()) return result; |
45 | 46 |
46 // At least one break point is active perform additional test to ensure that | 47 // At least one break point is active perform additional test to ensure that |
47 // break point locations are updated correctly. | 48 // break point locations are updated correctly. |
48 if (Debug::IsDebugBreak(Assembler::target_address_at(result))) { | 49 if (Debug::IsDebugBreak(Assembler::target_address_at(result))) { |
49 // If the call site is a call to debug break then return the address in | 50 // If the call site is a call to debug break then return the address in |
50 // the original code instead of the address in the running code. This will | 51 // the original code instead of the address in the running code. This will |
51 // cause the original code to be updated and keeps the breakpoint active in | 52 // cause the original code to be updated and keeps the breakpoint active in |
52 // the running code. | 53 // the running code. |
53 return OriginalCodeAddress(); | 54 return OriginalCodeAddress(); |
54 } else { | 55 } else { |
55 // No break point here just return the address of the call. | 56 // No break point here just return the address of the call. |
56 return result; | 57 return result; |
57 } | 58 } |
| 59 #else |
| 60 return result; |
| 61 #endif |
58 } | 62 } |
59 | 63 |
60 | 64 |
61 Code* IC::GetTargetAtAddress(Address address) { | 65 Code* IC::GetTargetAtAddress(Address address) { |
62 // Get the target address of the IC. | 66 // Get the target address of the IC. |
63 Address target = Assembler::target_address_at(address); | 67 Address target = Assembler::target_address_at(address); |
64 // Convert target address to the code object. Code::GetCodeFromTargetAddress | 68 // Convert target address to the code object. Code::GetCodeFromTargetAddress |
65 // is safe for use during GC where the map might be marked. | 69 // is safe for use during GC where the map might be marked. |
66 Code* result = Code::GetCodeFromTargetAddress(target); | 70 Code* result = Code::GetCodeFromTargetAddress(target); |
67 ASSERT(result->is_inline_cache_stub()); | 71 ASSERT(result->is_inline_cache_stub()); |
(...skipping 11 matching lines...) Expand all Loading... |
79 if (object->IsJSObject()) return JSObject::cast(object)->map(); | 83 if (object->IsJSObject()) return JSObject::cast(object)->map(); |
80 // If the object is a value, we use the prototype map for the cache. | 84 // If the object is a value, we use the prototype map for the cache. |
81 ASSERT(object->IsString() || object->IsNumber() || object->IsBoolean()); | 85 ASSERT(object->IsString() || object->IsNumber() || object->IsBoolean()); |
82 return JSObject::cast(object->GetPrototype())->map(); | 86 return JSObject::cast(object->GetPrototype())->map(); |
83 } | 87 } |
84 | 88 |
85 | 89 |
86 } } // namespace v8::internal | 90 } } // namespace v8::internal |
87 | 91 |
88 #endif // V8_IC_INL_H_ | 92 #endif // V8_IC_INL_H_ |
OLD | NEW |