| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 Handle<JSObject> stub_holder, | 97 Handle<JSObject> stub_holder, |
| 98 Code::Kind kind, | 98 Code::Kind kind, |
| 99 Code::StubType type); | 99 Code::StubType type); |
| 100 | 100 |
| 101 Handle<Code> FindStoreHandler(Handle<Name> name, | 101 Handle<Code> FindStoreHandler(Handle<Name> name, |
| 102 Handle<JSObject> receiver, | 102 Handle<JSObject> receiver, |
| 103 Code::Kind kind, | 103 Code::Kind kind, |
| 104 Code::StubType type, | 104 Code::StubType type, |
| 105 StrictModeFlag strict_mode); | 105 StrictModeFlag strict_mode); |
| 106 | 106 |
| 107 Handle<Code> ComputeMonomorphicLoadIC(Handle<JSObject> receiver, | 107 Handle<Code> ComputeMonomorphicLoadIC(Handle<HeapObject> receiver, |
| 108 Handle<Code> handler, | 108 Handle<Code> handler, |
| 109 Handle<Name> name); | 109 Handle<Name> name); |
| 110 | 110 |
| 111 Handle<Code> ComputeMonomorphicKeyedLoadIC(Handle<JSObject> receiver, | 111 Handle<Code> ComputeMonomorphicKeyedLoadIC(Handle<HeapObject> receiver, |
| 112 Handle<Code> handler, | 112 Handle<Code> handler, |
| 113 Handle<Name> name); | 113 Handle<Name> name); |
| 114 | 114 |
| 115 Handle<Code> ComputeMonomorphicStoreIC(Handle<JSObject> receiver, | 115 Handle<Code> ComputeMonomorphicStoreIC(Handle<HeapObject> receiver, |
| 116 Handle<Code> handler, | 116 Handle<Code> handler, |
| 117 Handle<Name> name, | 117 Handle<Name> name, |
| 118 StrictModeFlag strict_mode); | 118 StrictModeFlag strict_mode); |
| 119 | 119 |
| 120 Handle<Code> ComputeMonomorphicKeyedStoreIC(Handle<JSObject> receiver, | 120 Handle<Code> ComputeMonomorphicKeyedStoreIC(Handle<HeapObject> receiver, |
| 121 Handle<Code> handler, | 121 Handle<Code> handler, |
| 122 Handle<Name> name, | 122 Handle<Name> name, |
| 123 StrictModeFlag strict_mode); | 123 StrictModeFlag strict_mode); |
| 124 | 124 |
| 125 // Computes the right stub matching. Inserts the result in the | 125 // Computes the right stub matching. Inserts the result in the |
| 126 // cache before returning. This might compile a stub if needed. | 126 // cache before returning. This might compile a stub if needed. |
| 127 Handle<Code> ComputeLoadNonexistent(Handle<Name> name, | 127 Handle<Code> ComputeLoadNonexistent(Handle<Name> name, |
| 128 Handle<JSObject> object); | 128 Handle<JSObject> object); |
| 129 | 129 |
| 130 Handle<Code> ComputeLoadField(Handle<Name> name, | 130 Handle<Code> ComputeLoadField(Handle<Name> name, |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 case StubCache::kSecondary: return StubCache::secondary_; | 401 case StubCache::kSecondary: return StubCache::secondary_; |
| 402 } | 402 } |
| 403 UNREACHABLE(); | 403 UNREACHABLE(); |
| 404 return NULL; | 404 return NULL; |
| 405 } | 405 } |
| 406 | 406 |
| 407 Isolate* isolate() { return isolate_; } | 407 Isolate* isolate() { return isolate_; } |
| 408 Heap* heap() { return isolate()->heap(); } | 408 Heap* heap() { return isolate()->heap(); } |
| 409 Factory* factory() { return isolate()->factory(); } | 409 Factory* factory() { return isolate()->factory(); } |
| 410 | 410 |
| 411 // These constants describe the structure of the interceptor arguments on the |
| 412 // stack. The arguments are pushed by the (platform-specific) |
| 413 // PushInterceptorArguments and read by LoadPropertyWithInterceptorOnly and |
| 414 // LoadWithInterceptor. |
| 415 static const int kInterceptorArgsNameIndex = 0; |
| 416 static const int kInterceptorArgsInfoIndex = 1; |
| 417 static const int kInterceptorArgsThisIndex = 2; |
| 418 static const int kInterceptorArgsHolderIndex = 3; |
| 419 static const int kInterceptorArgsLength = 4; |
| 420 |
| 411 private: | 421 private: |
| 412 explicit StubCache(Isolate* isolate); | 422 explicit StubCache(Isolate* isolate); |
| 413 | 423 |
| 414 Handle<Code> ComputeCallInitialize(int argc, | 424 Handle<Code> ComputeCallInitialize(int argc, |
| 415 RelocInfo::Mode mode, | 425 RelocInfo::Mode mode, |
| 416 Code::Kind kind); | 426 Code::Kind kind); |
| 417 | 427 |
| 418 // The stub cache has a primary and secondary level. The two levels have | 428 // The stub cache has a primary and secondary level. The two levels have |
| 419 // different hashing algorithms in order to avoid simultaneous collisions | 429 // different hashing algorithms in order to avoid simultaneous collisions |
| 420 // in both caches. Unlike a probing strategy (quadratic or otherwise) the | 430 // in both caches. Unlike a probing strategy (quadratic or otherwise) the |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 565 |
| 556 static void GenerateLoadArrayLength(MacroAssembler* masm, | 566 static void GenerateLoadArrayLength(MacroAssembler* masm, |
| 557 Register receiver, | 567 Register receiver, |
| 558 Register scratch, | 568 Register scratch, |
| 559 Label* miss_label); | 569 Label* miss_label); |
| 560 | 570 |
| 561 static void GenerateLoadStringLength(MacroAssembler* masm, | 571 static void GenerateLoadStringLength(MacroAssembler* masm, |
| 562 Register receiver, | 572 Register receiver, |
| 563 Register scratch1, | 573 Register scratch1, |
| 564 Register scratch2, | 574 Register scratch2, |
| 565 Label* miss_label, | 575 Label* miss_label); |
| 566 bool support_wrappers); | |
| 567 | 576 |
| 568 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, | 577 static void GenerateLoadFunctionPrototype(MacroAssembler* masm, |
| 569 Register receiver, | 578 Register receiver, |
| 570 Register scratch1, | 579 Register scratch1, |
| 571 Register scratch2, | 580 Register scratch2, |
| 572 Label* miss_label); | 581 Label* miss_label); |
| 573 | 582 |
| 574 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); | 583 static void TailCallBuiltin(MacroAssembler* masm, Builtins::Name name); |
| 575 | 584 |
| 576 // Generates code that verifies that the property holder has not changed | 585 // Generates code that verifies that the property holder has not changed |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 Handle<JSFunction> constant_function_; | 1210 Handle<JSFunction> constant_function_; |
| 1202 bool is_simple_api_call_; | 1211 bool is_simple_api_call_; |
| 1203 Handle<FunctionTemplateInfo> expected_receiver_type_; | 1212 Handle<FunctionTemplateInfo> expected_receiver_type_; |
| 1204 Handle<CallHandlerInfo> api_call_info_; | 1213 Handle<CallHandlerInfo> api_call_info_; |
| 1205 }; | 1214 }; |
| 1206 | 1215 |
| 1207 | 1216 |
| 1208 } } // namespace v8::internal | 1217 } } // namespace v8::internal |
| 1209 | 1218 |
| 1210 #endif // V8_STUB_CACHE_H_ | 1219 #endif // V8_STUB_CACHE_H_ |
| OLD | NEW |