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

Side by Side Diff: src/full-codegen/full-codegen.cc

Issue 2676583002: [ic] Encode [Keyed]StoreIC's language mode in slot kind instead of code object's flags. (Closed)
Patch Set: Rebasing Created 3 years, 10 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
OLDNEW
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 #include "src/full-codegen/full-codegen.h" 5 #include "src/full-codegen/full-codegen.h"
6 6
7 #include "src/ast/ast-numbering.h" 7 #include "src/ast/ast-numbering.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack || 224 STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack ||
225 StoreDescriptor::kStackArgumentsCount == 2); 225 StoreDescriptor::kStackArgumentsCount == 2);
226 if (StoreDescriptor::kPassLastArgsOnStack) { 226 if (StoreDescriptor::kPassLastArgsOnStack) {
227 __ Push(StoreDescriptor::ValueRegister()); 227 __ Push(StoreDescriptor::ValueRegister());
228 EmitPushSlot(slot); 228 EmitPushSlot(slot);
229 } else { 229 } else {
230 EmitLoadSlot(StoreDescriptor::SlotRegister(), slot); 230 EmitLoadSlot(StoreDescriptor::SlotRegister(), slot);
231 } 231 }
232 232
233 // Ensure that language mode is in sync with the IC slot kind.
234 DCHECK_EQ(GetLanguageModeFromICKind(feedback_vector_spec()->GetKind(slot)),
235 language_mode());
233 Handle<Code> code = CodeFactory::StoreIC(isolate(), language_mode()).code(); 236 Handle<Code> code = CodeFactory::StoreIC(isolate(), language_mode()).code();
234 __ Call(code, RelocInfo::CODE_TARGET); 237 __ Call(code, RelocInfo::CODE_TARGET);
235 RestoreContext(); 238 RestoreContext();
236 } 239 }
237 240
238 void FullCodeGenerator::CallKeyedStoreIC(FeedbackVectorSlot slot) { 241 void FullCodeGenerator::CallKeyedStoreIC(FeedbackVectorSlot slot) {
239 STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack || 242 STATIC_ASSERT(!StoreDescriptor::kPassLastArgsOnStack ||
240 StoreDescriptor::kStackArgumentsCount == 2); 243 StoreDescriptor::kStackArgumentsCount == 2);
241 if (StoreDescriptor::kPassLastArgsOnStack) { 244 if (StoreDescriptor::kPassLastArgsOnStack) {
242 __ Push(StoreDescriptor::ValueRegister()); 245 __ Push(StoreDescriptor::ValueRegister());
243 EmitPushSlot(slot); 246 EmitPushSlot(slot);
244 } else { 247 } else {
245 EmitLoadSlot(StoreDescriptor::SlotRegister(), slot); 248 EmitLoadSlot(StoreDescriptor::SlotRegister(), slot);
246 } 249 }
247 250
251 // Ensure that language mode is in sync with the IC slot kind.
252 DCHECK_EQ(GetLanguageModeFromICKind(feedback_vector_spec()->GetKind(slot)),
253 language_mode());
248 Handle<Code> code = 254 Handle<Code> code =
249 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); 255 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
250 __ Call(code, RelocInfo::CODE_TARGET); 256 __ Call(code, RelocInfo::CODE_TARGET);
251 RestoreContext(); 257 RestoreContext();
252 } 258 }
253 259
254 void FullCodeGenerator::RecordJSReturnSite(Call* call) { 260 void FullCodeGenerator::RecordJSReturnSite(Call* call) {
255 // We record the offset of the function return so we can rebuild the frame 261 // We record the offset of the function return so we can rebuild the frame
256 // if the function was inlined, i.e., this is the return address in the 262 // if the function was inlined, i.e., this is the return address in the
257 // inlined function's frame. 263 // inlined function's frame.
(...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 LanguageMode FullCodeGenerator::language_mode() { 1599 LanguageMode FullCodeGenerator::language_mode() {
1594 return scope()->language_mode(); 1600 return scope()->language_mode();
1595 } 1601 }
1596 1602
1597 bool FullCodeGenerator::has_simple_parameters() { 1603 bool FullCodeGenerator::has_simple_parameters() {
1598 return info_->has_simple_parameters(); 1604 return info_->has_simple_parameters();
1599 } 1605 }
1600 1606
1601 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); } 1607 FunctionLiteral* FullCodeGenerator::literal() const { return info_->literal(); }
1602 1608
1609 const FeedbackVectorSpec* FullCodeGenerator::feedback_vector_spec() const {
1610 return literal()->feedback_vector_spec();
1611 }
1612
1603 #undef __ 1613 #undef __
1604 1614
1605 1615
1606 } // namespace internal 1616 } // namespace internal
1607 } // namespace v8 1617 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698