| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 static Handle<Code> initialize_stub_in_optimized_code( | 262 static Handle<Code> initialize_stub_in_optimized_code( |
| 263 Isolate* isolate, int argc, ConvertReceiverMode mode, | 263 Isolate* isolate, int argc, ConvertReceiverMode mode, |
| 264 TailCallMode tail_call_mode); | 264 TailCallMode tail_call_mode); |
| 265 | 265 |
| 266 static void Clear(Isolate* isolate, Code* host, CallICNexus* nexus); | 266 static void Clear(Isolate* isolate, Code* host, CallICNexus* nexus); |
| 267 }; | 267 }; |
| 268 | 268 |
| 269 | 269 |
| 270 class LoadIC : public IC { | 270 class LoadIC : public IC { |
| 271 public: | 271 public: |
| 272 TypeofMode typeof_mode() const { | |
| 273 return LoadICState::GetTypeofMode(extra_ic_state()); | |
| 274 } | |
| 275 | |
| 276 LoadIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) | 272 LoadIC(FrameDepth depth, Isolate* isolate, FeedbackNexus* nexus = NULL) |
| 277 : IC(depth, isolate, nexus) { | 273 : IC(depth, isolate, nexus) { |
| 278 DCHECK(nexus != NULL); | 274 DCHECK(nexus != NULL); |
| 279 DCHECK(IsLoadStub()); | 275 DCHECK(IsLoadStub()); |
| 280 } | 276 } |
| 281 | 277 |
| 282 bool ShouldThrowReferenceError() const { | 278 bool ShouldThrowReferenceError() const { |
| 283 return kind() == Code::LOAD_GLOBAL_IC && typeof_mode() == NOT_INSIDE_TYPEOF; | 279 return kind() == Code::LOAD_GLOBAL_IC && |
| 280 LoadGlobalICState::GetTypeofMode(extra_ic_state()) == |
| 281 NOT_INSIDE_TYPEOF; |
| 284 } | 282 } |
| 285 | 283 |
| 286 // Code generator routines. | 284 // Code generator routines. |
| 287 | 285 |
| 288 static void GenerateMiss(MacroAssembler* masm); | 286 static void GenerateMiss(MacroAssembler* masm); |
| 289 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 287 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
| 290 static void GenerateNormal(MacroAssembler* masm); | 288 static void GenerateNormal(MacroAssembler* masm); |
| 291 | 289 |
| 292 static Handle<Code> initialize_stub_in_optimized_code( | 290 static Handle<Code> initialize_stub_in_optimized_code(Isolate* isolate); |
| 293 Isolate* isolate, ExtraICState extra_state); | |
| 294 | 291 |
| 295 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, | 292 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, |
| 296 Handle<Name> name); | 293 Handle<Name> name); |
| 297 | 294 |
| 298 static void Clear(Isolate* isolate, Code* host, LoadICNexus* nexus); | 295 static void Clear(Isolate* isolate, Code* host, LoadICNexus* nexus); |
| 299 | 296 |
| 300 protected: | 297 protected: |
| 301 virtual Handle<Code> slow_stub() const { | 298 virtual Handle<Code> slow_stub() const { |
| 302 return isolate()->builtins()->LoadIC_Slow(); | 299 return isolate()->builtins()->LoadIC_Slow(); |
| 303 } | 300 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 509 |
| 513 // Helper for BinaryOpIC and CompareIC. | 510 // Helper for BinaryOpIC and CompareIC. |
| 514 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 511 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
| 515 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 512 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
| 516 InlinedSmiCheck check); | 513 InlinedSmiCheck check); |
| 517 | 514 |
| 518 } // namespace internal | 515 } // namespace internal |
| 519 } // namespace v8 | 516 } // namespace v8 |
| 520 | 517 |
| 521 #endif // V8_IC_H_ | 518 #endif // V8_IC_H_ |
| OLD | NEW |