V8 Project
code-factory.cc
Go to the documentation of this file.
1 // Copyright 2014 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 #include "src/v8.h"
6 
7 #include "src/bootstrapper.h"
8 #include "src/code-factory.h"
9 #include "src/ic/ic.h"
10 
11 namespace v8 {
12 namespace internal {
13 
14 // static
15 Callable CodeFactory::LoadIC(Isolate* isolate, ContextualMode mode) {
16  return Callable(
17  LoadIC::initialize_stub(isolate, LoadICState(mode).GetExtraICState()),
18  LoadDescriptor(isolate));
19 }
20 
21 
22 // static
23 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) {
24  return Callable(isolate->builtins()->KeyedLoadIC_Initialize(),
25  LoadDescriptor(isolate));
26 }
27 
28 
29 // static
30 Callable CodeFactory::StoreIC(Isolate* isolate, StrictMode mode) {
31  return Callable(StoreIC::initialize_stub(isolate, mode),
32  StoreDescriptor(isolate));
33 }
34 
35 
36 // static
37 Callable CodeFactory::KeyedStoreIC(Isolate* isolate, StrictMode mode) {
38  Handle<Code> ic = mode == SLOPPY
39  ? isolate->builtins()->KeyedStoreIC_Initialize()
40  : isolate->builtins()->KeyedStoreIC_Initialize_Strict();
41  return Callable(ic, StoreDescriptor(isolate));
42 }
43 
44 
45 // static
46 Callable CodeFactory::CompareIC(Isolate* isolate, Token::Value op) {
47  Handle<Code> code = CompareIC::GetUninitialized(isolate, op);
48  return Callable(code, BinaryOpDescriptor(isolate));
49 }
50 
51 
52 // static
53 Callable CodeFactory::BinaryOpIC(Isolate* isolate, Token::Value op,
55  BinaryOpICStub stub(isolate, op, mode);
56  return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
57 }
58 
59 
60 // static
61 Callable CodeFactory::ToBoolean(Isolate* isolate,
63  ToBooleanStub::Types types) {
64  ToBooleanStub stub(isolate, mode, types);
65  return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
66 }
67 
68 
69 // static
70 Callable CodeFactory::ToNumber(Isolate* isolate) {
71  ToNumberStub stub(isolate);
72  return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
73 }
74 
75 
76 // static
77 Callable CodeFactory::StringAdd(Isolate* isolate, StringAddFlags flags,
78  PretenureFlag pretenure_flag) {
79  StringAddStub stub(isolate, flags, pretenure_flag);
80  return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
81 }
82 
83 
84 // static
85 Callable CodeFactory::CallFunction(Isolate* isolate, int argc,
87  CallFunctionStub stub(isolate, argc, flags);
88  return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
89 }
90 
91 } // namespace internal
92 } // namespace v8
static Handle< Code > GetUninitialized(Isolate *isolate, Token::Value op)
Definition: ic.cc:2327
static Handle< Code > initialize_stub(Isolate *isolate, ExtraICState extra_state)
Definition: ic.cc:815
static Handle< Code > initialize_stub(Isolate *isolate, StrictMode strict_mode)
Definition: ic.cc:1346
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
int ToNumber(Register reg)
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20