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 #ifndef V8_IC_H_ | 5 #ifndef V8_IC_H_ |
6 #define V8_IC_H_ | 6 #define V8_IC_H_ |
7 | 7 |
8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 return receiver->IsJSGlobalObject() && typeof_mode() == NOT_INSIDE_TYPEOF; | 285 return receiver->IsJSGlobalObject() && typeof_mode() == NOT_INSIDE_TYPEOF; |
286 } | 286 } |
287 | 287 |
288 // Code generator routines. | 288 // Code generator routines. |
289 | 289 |
290 static void GenerateMiss(MacroAssembler* masm); | 290 static void GenerateMiss(MacroAssembler* masm); |
291 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 291 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
292 static void GenerateNormal(MacroAssembler* masm); | 292 static void GenerateNormal(MacroAssembler* masm); |
293 | 293 |
294 static Handle<Code> initialize_stub_in_optimized_code( | 294 static Handle<Code> initialize_stub_in_optimized_code( |
295 Isolate* isolate, ExtraICState extra_state, State initialization_state); | 295 Isolate* isolate, ExtraICState extra_state); |
296 | 296 |
297 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, | 297 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, |
298 Handle<Name> name); | 298 Handle<Name> name); |
299 | 299 |
300 static void Clear(Isolate* isolate, Code* host, LoadICNexus* nexus); | 300 static void Clear(Isolate* isolate, Code* host, LoadICNexus* nexus); |
301 | 301 |
302 protected: | 302 protected: |
303 Handle<Code> slow_stub() const { | 303 Handle<Code> slow_stub() const { |
304 return isolate()->builtins()->LoadIC_Slow(); | 304 return isolate()->builtins()->LoadIC_Slow(); |
305 } | 305 } |
(...skipping 24 matching lines...) Expand all Loading... |
330 | 330 |
331 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, | 331 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, |
332 Handle<Object> key); | 332 Handle<Object> key); |
333 | 333 |
334 // Code generator routines. | 334 // Code generator routines. |
335 static void GenerateMiss(MacroAssembler* masm); | 335 static void GenerateMiss(MacroAssembler* masm); |
336 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 336 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
337 static void GenerateMegamorphic(MacroAssembler* masm); | 337 static void GenerateMegamorphic(MacroAssembler* masm); |
338 | 338 |
339 static Handle<Code> initialize_stub_in_optimized_code( | 339 static Handle<Code> initialize_stub_in_optimized_code( |
340 Isolate* isolate, State initialization_state, ExtraICState extra_state); | 340 Isolate* isolate, ExtraICState extra_state); |
341 static Handle<Code> ChooseMegamorphicStub(Isolate* isolate, | 341 static Handle<Code> ChooseMegamorphicStub(Isolate* isolate, |
342 ExtraICState extra_state); | 342 ExtraICState extra_state); |
343 | 343 |
344 static void Clear(Isolate* isolate, Code* host, KeyedLoadICNexus* nexus); | 344 static void Clear(Isolate* isolate, Code* host, KeyedLoadICNexus* nexus); |
345 | 345 |
346 protected: | 346 protected: |
347 // receiver is HeapObject because it could be a String or a JSObject | 347 // receiver is HeapObject because it could be a String or a JSObject |
348 void UpdateLoadElement(Handle<HeapObject> receiver); | 348 void UpdateLoadElement(Handle<HeapObject> receiver); |
349 | 349 |
350 private: | 350 private: |
(...skipping 14 matching lines...) Expand all Loading... |
365 | 365 |
366 // Code generators for stub routines. Only called once at startup. | 366 // Code generators for stub routines. Only called once at startup. |
367 static void GenerateSlow(MacroAssembler* masm); | 367 static void GenerateSlow(MacroAssembler* masm); |
368 static void GenerateMiss(MacroAssembler* masm); | 368 static void GenerateMiss(MacroAssembler* masm); |
369 static void GenerateMegamorphic(MacroAssembler* masm); | 369 static void GenerateMegamorphic(MacroAssembler* masm); |
370 static void GenerateNormal(MacroAssembler* masm); | 370 static void GenerateNormal(MacroAssembler* masm); |
371 static void GenerateRuntimeSetProperty(MacroAssembler* masm, | 371 static void GenerateRuntimeSetProperty(MacroAssembler* masm, |
372 LanguageMode language_mode); | 372 LanguageMode language_mode); |
373 | 373 |
374 static Handle<Code> initialize_stub_in_optimized_code( | 374 static Handle<Code> initialize_stub_in_optimized_code( |
375 Isolate* isolate, LanguageMode language_mode, State initialization_state); | 375 Isolate* isolate, LanguageMode language_mode); |
376 | 376 |
377 MUST_USE_RESULT MaybeHandle<Object> Store( | 377 MUST_USE_RESULT MaybeHandle<Object> Store( |
378 Handle<Object> object, Handle<Name> name, Handle<Object> value, | 378 Handle<Object> object, Handle<Name> name, Handle<Object> value, |
379 JSReceiver::StoreFromKeyed store_mode = | 379 JSReceiver::StoreFromKeyed store_mode = |
380 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED); | 380 JSReceiver::CERTAINLY_NOT_STORE_FROM_KEYED); |
381 | 381 |
382 bool LookupForWrite(LookupIterator* it, Handle<Object> value, | 382 bool LookupForWrite(LookupIterator* it, Handle<Object> value, |
383 JSReceiver::StoreFromKeyed store_mode); | 383 JSReceiver::StoreFromKeyed store_mode); |
384 | 384 |
385 static void Clear(Isolate* isolate, Code* host, StoreICNexus* nexus); | 385 static void Clear(Isolate* isolate, Code* host, StoreICNexus* nexus); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 Handle<Object> name, | 421 Handle<Object> name, |
422 Handle<Object> value); | 422 Handle<Object> value); |
423 | 423 |
424 // Code generators for stub routines. Only called once at startup. | 424 // Code generators for stub routines. Only called once at startup. |
425 static void GenerateMiss(MacroAssembler* masm); | 425 static void GenerateMiss(MacroAssembler* masm); |
426 static void GenerateSlow(MacroAssembler* masm); | 426 static void GenerateSlow(MacroAssembler* masm); |
427 static void GenerateMegamorphic(MacroAssembler* masm, | 427 static void GenerateMegamorphic(MacroAssembler* masm, |
428 LanguageMode language_mode); | 428 LanguageMode language_mode); |
429 | 429 |
430 static Handle<Code> initialize_stub_in_optimized_code( | 430 static Handle<Code> initialize_stub_in_optimized_code( |
431 Isolate* isolate, LanguageMode language_mode, State initialization_state); | 431 Isolate* isolate, LanguageMode language_mode); |
432 static Handle<Code> ChooseMegamorphicStub(Isolate* isolate, | 432 static Handle<Code> ChooseMegamorphicStub(Isolate* isolate, |
433 ExtraICState extra_state); | 433 ExtraICState extra_state); |
434 | 434 |
435 static void Clear(Isolate* isolate, Code* host, KeyedStoreICNexus* nexus); | 435 static void Clear(Isolate* isolate, Code* host, KeyedStoreICNexus* nexus); |
436 | 436 |
437 protected: | 437 protected: |
438 void UpdateStoreElement(Handle<Map> receiver_map, | 438 void UpdateStoreElement(Handle<Map> receiver_map, |
439 KeyedAccessStoreMode store_mode); | 439 KeyedAccessStoreMode store_mode); |
440 | 440 |
441 private: | 441 private: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 | 498 |
499 // Helper for BinaryOpIC and CompareIC. | 499 // Helper for BinaryOpIC and CompareIC. |
500 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 500 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
501 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 501 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
502 InlinedSmiCheck check); | 502 InlinedSmiCheck check); |
503 | 503 |
504 } // namespace internal | 504 } // namespace internal |
505 } // namespace v8 | 505 } // namespace v8 |
506 | 506 |
507 #endif // V8_IC_H_ | 507 #endif // V8_IC_H_ |
OLD | NEW |