Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: src/code-factory.cc

Issue 1168093002: [strong] Implement strong mode restrictions on property access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-factory.h ('k') | src/code-stubs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 13
14 14
15 // static 15 // static
16 Callable CodeFactory::LoadIC(Isolate* isolate, ContextualMode mode) { 16 Callable CodeFactory::LoadIC(Isolate* isolate, ContextualMode mode,
17 LanguageMode language_mode) {
17 return Callable( 18 return Callable(
18 LoadIC::initialize_stub(isolate, LoadICState(mode).GetExtraICState()), 19 LoadIC::initialize_stub(
20 isolate, LoadICState(mode, language_mode).GetExtraICState()),
19 LoadDescriptor(isolate)); 21 LoadDescriptor(isolate));
20 } 22 }
21 23
22 24
23 // static 25 // static
24 Callable CodeFactory::LoadICInOptimizedCode( 26 Callable CodeFactory::LoadICInOptimizedCode(
25 Isolate* isolate, ContextualMode mode, 27 Isolate* isolate, ContextualMode mode, LanguageMode language_mode,
26 InlineCacheState initialization_state) { 28 InlineCacheState initialization_state) {
27 auto code = LoadIC::initialize_stub_in_optimized_code( 29 auto code = LoadIC::initialize_stub_in_optimized_code(
28 isolate, LoadICState(mode).GetExtraICState(), initialization_state); 30 isolate, LoadICState(mode, language_mode).GetExtraICState(),
31 initialization_state);
29 return Callable(code, LoadWithVectorDescriptor(isolate)); 32 return Callable(code, LoadWithVectorDescriptor(isolate));
30 } 33 }
31 34
32 35
33 // static 36 // static
34 Callable CodeFactory::KeyedLoadIC(Isolate* isolate) { 37 Callable CodeFactory::KeyedLoadIC(Isolate* isolate,
35 return Callable(KeyedLoadIC::initialize_stub(isolate), 38 LanguageMode language_mode) {
39 ExtraICState state =
40 is_strong(language_mode) ? LoadICState::kStrongModeState : 0;
41 return Callable(KeyedLoadIC::initialize_stub(isolate, state),
36 LoadDescriptor(isolate)); 42 LoadDescriptor(isolate));
37 } 43 }
38 44
39 45
40 // static 46 // static
41 Callable CodeFactory::KeyedLoadICInOptimizedCode( 47 Callable CodeFactory::KeyedLoadICInOptimizedCode(
42 Isolate* isolate, InlineCacheState initialization_state) { 48 Isolate* isolate, LanguageMode language_mode,
49 InlineCacheState initialization_state) {
50 ExtraICState state =
51 is_strong(language_mode) ? LoadICState::kStrongModeState : 0;
43 auto code = KeyedLoadIC::initialize_stub_in_optimized_code( 52 auto code = KeyedLoadIC::initialize_stub_in_optimized_code(
44 isolate, initialization_state); 53 isolate, initialization_state, state);
45 if (initialization_state != MEGAMORPHIC) { 54 if (initialization_state != MEGAMORPHIC) {
46 return Callable(code, LoadWithVectorDescriptor(isolate)); 55 return Callable(code, LoadWithVectorDescriptor(isolate));
47 } 56 }
48 return Callable(code, LoadDescriptor(isolate)); 57 return Callable(code, LoadDescriptor(isolate));
49 } 58 }
50 59
51 60
52 // static 61 // static
53 Callable CodeFactory::CallIC(Isolate* isolate, int argc, 62 Callable CodeFactory::CallIC(Isolate* isolate, int argc,
54 CallICState::CallType call_type) { 63 CallICState::CallType call_type) {
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 182
174 // static 183 // static
175 Callable CodeFactory::CallFunction(Isolate* isolate, int argc, 184 Callable CodeFactory::CallFunction(Isolate* isolate, int argc,
176 CallFunctionFlags flags) { 185 CallFunctionFlags flags) {
177 CallFunctionStub stub(isolate, argc, flags); 186 CallFunctionStub stub(isolate, argc, flags);
178 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor()); 187 return Callable(stub.GetCode(), stub.GetCallInterfaceDescriptor());
179 } 188 }
180 189
181 } // namespace internal 190 } // namespace internal
182 } // namespace v8 191 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-factory.h ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698