| OLD | NEW | 
|---|
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 74     PrintF("]\n"); | 74     PrintF("]\n"); | 
| 75   } | 75   } | 
| 76 } | 76 } | 
| 77 #endif | 77 #endif | 
| 78 | 78 | 
| 79 | 79 | 
| 80 IC::IC(FrameDepth depth) { | 80 IC::IC(FrameDepth depth) { | 
| 81   // To improve the performance of the (much used) IC code, we unfold | 81   // To improve the performance of the (much used) IC code, we unfold | 
| 82   // a few levels of the stack frame iteration code. This yields a | 82   // a few levels of the stack frame iteration code. This yields a | 
| 83   // ~35% speedup when running DeltaBlue with the '--nouse-ic' flag. | 83   // ~35% speedup when running DeltaBlue with the '--nouse-ic' flag. | 
| 84   const Address entry = Top::c_entry_fp(Isolate::Current()->thread_local_top()); | 84   const Address entry = | 
|  | 85       Isolate::c_entry_fp(Isolate::Current()->thread_local_top()); | 
| 85   Address* pc_address = | 86   Address* pc_address = | 
| 86       reinterpret_cast<Address*>(entry + ExitFrameConstants::kCallerPCOffset); | 87       reinterpret_cast<Address*>(entry + ExitFrameConstants::kCallerPCOffset); | 
| 87   Address fp = Memory::Address_at(entry + ExitFrameConstants::kCallerFPOffset); | 88   Address fp = Memory::Address_at(entry + ExitFrameConstants::kCallerFPOffset); | 
| 88   // If there's another JavaScript frame on the stack, we need to look | 89   // If there's another JavaScript frame on the stack, we need to look | 
| 89   // one frame further down the stack to find the frame pointer and | 90   // one frame further down the stack to find the frame pointer and | 
| 90   // the return address stack slot. | 91   // the return address stack slot. | 
| 91   if (depth == EXTRA_CALL_FRAME) { | 92   if (depth == EXTRA_CALL_FRAME) { | 
| 92     const int kCallerPCOffset = StandardFrameConstants::kCallerPCOffset; | 93     const int kCallerPCOffset = StandardFrameConstants::kCallerPCOffset; | 
| 93     pc_address = reinterpret_cast<Address*>(fp + kCallerPCOffset); | 94     pc_address = reinterpret_cast<Address*>(fp + kCallerPCOffset); | 
| 94     fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); | 95     fp = Memory::Address_at(fp + StandardFrameConstants::kCallerFPOffset); | 
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 195   return RelocInfo::NONE; | 196   return RelocInfo::NONE; | 
| 196 } | 197 } | 
| 197 | 198 | 
| 198 | 199 | 
| 199 Failure* IC::TypeError(const char* type, | 200 Failure* IC::TypeError(const char* type, | 
| 200                        Handle<Object> object, | 201                        Handle<Object> object, | 
| 201                        Handle<Object> key) { | 202                        Handle<Object> key) { | 
| 202   HandleScope scope; | 203   HandleScope scope; | 
| 203   Handle<Object> args[2] = { key, object }; | 204   Handle<Object> args[2] = { key, object }; | 
| 204   Handle<Object> error = Factory::NewTypeError(type, HandleVector(args, 2)); | 205   Handle<Object> error = Factory::NewTypeError(type, HandleVector(args, 2)); | 
| 205   return Top::Throw(*error); | 206   return Isolate::Current()->Throw(*error); | 
| 206 } | 207 } | 
| 207 | 208 | 
| 208 | 209 | 
| 209 Failure* IC::ReferenceError(const char* type, Handle<String> name) { | 210 Failure* IC::ReferenceError(const char* type, Handle<String> name) { | 
| 210   HandleScope scope; | 211   HandleScope scope; | 
| 211   Handle<Object> error = | 212   Handle<Object> error = | 
| 212       Factory::NewReferenceError(type, HandleVector(&name, 1)); | 213       Factory::NewReferenceError(type, HandleVector(&name, 1)); | 
| 213   return Top::Throw(*error); | 214   return Isolate::Current()->Throw(*error); | 
| 214 } | 215 } | 
| 215 | 216 | 
| 216 | 217 | 
| 217 void IC::Clear(Address address) { | 218 void IC::Clear(Address address) { | 
| 218   Code* target = GetTargetAtAddress(address); | 219   Code* target = GetTargetAtAddress(address); | 
| 219 | 220 | 
| 220   // Don't clear debug break inline cache as it will remove the break point. | 221   // Don't clear debug break inline cache as it will remove the break point. | 
| 221   if (target->ic_state() == DEBUG_BREAK) return; | 222   if (target->ic_state() == DEBUG_BREAK) return; | 
| 222 | 223 | 
| 223   switch (target->kind()) { | 224   switch (target->kind()) { | 
| (...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1655 #undef ADDR | 1656 #undef ADDR | 
| 1656 }; | 1657 }; | 
| 1657 | 1658 | 
| 1658 | 1659 | 
| 1659 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1660 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 
| 1660   return IC_utilities[id]; | 1661   return IC_utilities[id]; | 
| 1661 } | 1662 } | 
| 1662 | 1663 | 
| 1663 | 1664 | 
| 1664 } }  // namespace v8::internal | 1665 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|