OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 371 |
372 // Support functions for IC stubs for interceptors. | 372 // Support functions for IC stubs for interceptors. |
373 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorOnly); | 373 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorOnly); |
374 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForLoad); | 374 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForLoad); |
375 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForCall); | 375 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForCall); |
376 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreInterceptorProperty); | 376 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreInterceptorProperty); |
377 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CallInterceptorProperty); | 377 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CallInterceptorProperty); |
378 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadPropertyWithInterceptor); | 378 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadPropertyWithInterceptor); |
379 | 379 |
380 | 380 |
381 // The stub compiler compiles stubs for the stub cache. | 381 // The stub compilers compile stubs for the stub cache. |
382 class StubCompiler BASE_EMBEDDED { | 382 class StubCompiler BASE_EMBEDDED { |
383 public: | 383 public: |
384 explicit StubCompiler(Isolate* isolate) | 384 explicit StubCompiler(Isolate* isolate) |
385 : isolate_(isolate), masm_(isolate, NULL, 256), failure_(NULL) { } | 385 : isolate_(isolate), masm_(isolate, NULL, 256), failure_(NULL) { } |
386 | 386 |
| 387 // Functions to compile either CallIC or KeyedCallIC. The specific kind |
| 388 // is extracted from the code flags. |
387 Handle<Code> CompileCallInitialize(Code::Flags flags); | 389 Handle<Code> CompileCallInitialize(Code::Flags flags); |
388 MUST_USE_RESULT MaybeObject* TryCompileCallInitialize(Code::Flags flags); | 390 Handle<Code> CompileCallPreMonomorphic(Code::Flags flags); |
| 391 Handle<Code> CompileCallNormal(Code::Flags flags); |
| 392 Handle<Code> CompileCallMegamorphic(Code::Flags flags); |
| 393 Handle<Code> CompileCallArguments(Code::Flags flags); |
| 394 Handle<Code> CompileCallMiss(Code::Flags flags); |
389 | 395 |
390 Handle<Code> CompileCallPreMonomorphic(Code::Flags flags); | |
391 MUST_USE_RESULT MaybeObject* TryCompileCallPreMonomorphic(Code::Flags flags); | 396 MUST_USE_RESULT MaybeObject* TryCompileCallPreMonomorphic(Code::Flags flags); |
392 | |
393 Handle<Code> CompileCallNormal(Code::Flags flags); | |
394 MUST_USE_RESULT MaybeObject* TryCompileCallNormal(Code::Flags flags); | 397 MUST_USE_RESULT MaybeObject* TryCompileCallNormal(Code::Flags flags); |
395 | |
396 Handle<Code> CompileCallMegamorphic(Code::Flags flags); | |
397 MUST_USE_RESULT MaybeObject* TryCompileCallMegamorphic(Code::Flags flags); | 398 MUST_USE_RESULT MaybeObject* TryCompileCallMegamorphic(Code::Flags flags); |
398 | |
399 Handle<Code> CompileCallArguments(Code::Flags flags); | |
400 MUST_USE_RESULT MaybeObject* TryCompileCallArguments(Code::Flags flags); | 399 MUST_USE_RESULT MaybeObject* TryCompileCallArguments(Code::Flags flags); |
401 | |
402 Handle<Code> CompileCallMiss(Code::Flags flags); | |
403 MUST_USE_RESULT MaybeObject* TryCompileCallMiss(Code::Flags flags); | 400 MUST_USE_RESULT MaybeObject* TryCompileCallMiss(Code::Flags flags); |
404 | 401 |
405 #ifdef ENABLE_DEBUGGER_SUPPORT | 402 #ifdef ENABLE_DEBUGGER_SUPPORT |
406 Handle<Code> CompileCallDebugBreak(Code::Flags flags); | 403 Handle<Code> CompileCallDebugBreak(Code::Flags flags); |
| 404 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); |
| 405 |
407 MUST_USE_RESULT MaybeObject* TryCompileCallDebugBreak(Code::Flags flags); | 406 MUST_USE_RESULT MaybeObject* TryCompileCallDebugBreak(Code::Flags flags); |
408 | |
409 Handle<Code> CompileCallDebugPrepareStepIn(Code::Flags flags); | |
410 MUST_USE_RESULT MaybeObject* TryCompileCallDebugPrepareStepIn( | 407 MUST_USE_RESULT MaybeObject* TryCompileCallDebugPrepareStepIn( |
411 Code::Flags flags); | 408 Code::Flags flags); |
412 #endif | 409 #endif |
413 | 410 |
414 // Static functions for generating parts of stubs. | 411 // Static functions for generating parts of stubs. |
415 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, | 412 static void GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, |
416 int index, | 413 int index, |
417 Register prototype); | 414 Register prototype); |
418 | 415 |
419 // Generates prototype loading code that uses the objects from the | 416 // Generates prototype loading code that uses the objects from the |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 Register object_reg, | 492 Register object_reg, |
496 JSObject* holder, | 493 JSObject* holder, |
497 Register holder_reg, | 494 Register holder_reg, |
498 Register scratch1, | 495 Register scratch1, |
499 Register scratch2, | 496 Register scratch2, |
500 String* name, | 497 String* name, |
501 int save_at_depth, | 498 int save_at_depth, |
502 Label* miss); | 499 Label* miss); |
503 | 500 |
504 protected: | 501 protected: |
505 MaybeObject* GetCodeWithFlags(Code::Flags flags, const char* name); | 502 Handle<Code> GetCodeWithFlags(Code::Flags flags, const char* name); |
506 MaybeObject* GetCodeWithFlags(Code::Flags flags, String* name); | 503 |
| 504 MUST_USE_RESULT MaybeObject* TryGetCodeWithFlags(Code::Flags flags, |
| 505 const char* name); |
| 506 MUST_USE_RESULT MaybeObject* TryGetCodeWithFlags(Code::Flags flags, |
| 507 String* name); |
507 | 508 |
508 MacroAssembler* masm() { return &masm_; } | 509 MacroAssembler* masm() { return &masm_; } |
509 void set_failure(Failure* failure) { failure_ = failure; } | 510 void set_failure(Failure* failure) { failure_ = failure; } |
510 | 511 |
511 void GenerateLoadField(JSObject* object, | 512 void GenerateLoadField(JSObject* object, |
512 JSObject* holder, | 513 JSObject* holder, |
513 Register receiver, | 514 Register receiver, |
514 Register scratch1, | 515 Register scratch1, |
515 Register scratch2, | 516 Register scratch2, |
516 Register scratch3, | 517 Register scratch3, |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 JSFunction* constant_function_; | 978 JSFunction* constant_function_; |
978 bool is_simple_api_call_; | 979 bool is_simple_api_call_; |
979 FunctionTemplateInfo* expected_receiver_type_; | 980 FunctionTemplateInfo* expected_receiver_type_; |
980 CallHandlerInfo* api_call_info_; | 981 CallHandlerInfo* api_call_info_; |
981 }; | 982 }; |
982 | 983 |
983 | 984 |
984 } } // namespace v8::internal | 985 } } // namespace v8::internal |
985 | 986 |
986 #endif // V8_STUB_CACHE_H_ | 987 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |