V8 Project
code-factory.h
Go to the documentation of this file.
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
3 // found in the LICENSE file.
4 
5 #ifndef V8_CODE_FACTORY_H_
6 #define V8_CODE_FACTORY_H_
7 
8 #include "src/allocation.h"
9 #include "src/assembler.h"
10 #include "src/codegen.h"
11 #include "src/globals.h"
13 
14 namespace v8 {
15 namespace internal {
16 
17 // Associates a body of code with an interface descriptor.
18 class Callable FINAL BASE_EMBEDDED {
19  public:
21  : code_(code), descriptor_(descriptor) {}
22 
23  Handle<Code> code() const { return code_; }
24  CallInterfaceDescriptor descriptor() const { return descriptor_; }
25 
26  private:
29 };
30 
31 
32 class CodeFactory FINAL {
33  public:
34  // Initial states for ICs.
35  static Callable LoadIC(Isolate* isolate, ContextualMode mode);
36  static Callable KeyedLoadIC(Isolate* isolate);
37  static Callable StoreIC(Isolate* isolate, StrictMode mode);
38  static Callable KeyedStoreIC(Isolate* isolate, StrictMode mode);
39 
40  static Callable CompareIC(Isolate* isolate, Token::Value op);
41 
42  static Callable BinaryOpIC(Isolate* isolate, Token::Value op,
44 
45  // Code stubs. Add methods here as needed to reduce dependency on
46  // code-stubs.h.
47  static Callable ToBoolean(
50 
51  static Callable ToNumber(Isolate* isolate);
52 
53  static Callable StringAdd(Isolate* isolate, StringAddFlags flags,
54  PretenureFlag pretenure_flag);
55 
56  static Callable CallFunction(Isolate* isolate, int argc,
58 };
59 }
60 }
61 #endif // V8_CODE_FACTORY_H_
#define BASE_EMBEDDED
Definition: allocation.h:45
Handle< Code > code() const
Definition: code-factory.h:23
CallInterfaceDescriptor descriptor() const
Definition: code-factory.h:24
const CallInterfaceDescriptor descriptor_
Definition: code-factory.h:28
Callable(Handle< Code > code, CallInterfaceDescriptor descriptor)
Definition: code-factory.h:20
const Handle< Code > code_
Definition: code-factory.h:27
Source to read snapshot and builtins files from.
Definition: lithium-arm.h:372
static Callable ToBoolean(Isolate *isolate, ToBooleanStub::ResultMode mode, ToBooleanStub::Types types=ToBooleanStub::Types())
static Callable BinaryOpIC(Isolate *isolate, Token::Value op, OverwriteMode mode=NO_OVERWRITE)
static Callable KeyedLoadIC(Isolate *isolate)
static Callable StringAdd(Isolate *isolate, StringAddFlags flags, PretenureFlag pretenure_flag)
static Callable KeyedStoreIC(Isolate *isolate, StrictMode mode)
static Callable ToNumber(Isolate *isolate)
static Callable CallFunction(Isolate *isolate, int argc, CallFunctionFlags flags)
static Callable LoadIC(Isolate *isolate, ContextualMode mode)
static Callable CompareIC(Isolate *isolate, Token::Value op)
static Callable StoreIC(Isolate *isolate, StrictMode mode)
#define FINAL
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
@ NO_OVERWRITE
Definition: ic-state.h:58
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20