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

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 2673383002: [ic] Encode LoadGlobalIC's typeof mode in slot kind instead of code object's flags. (Closed)
Patch Set: Addressed comments and added check to FCG 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
« no previous file with comments | « src/ic/x87/handler-compiler-x87.cc ('k') | src/objects-printer.cc » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecode-array-builder.h" 5 #include "src/interpreter/bytecode-array-builder.h"
6 6
7 #include "src/globals.h" 7 #include "src/globals.h"
8 #include "src/interpreter/bytecode-array-writer.h" 8 #include "src/interpreter/bytecode-array-writer.h"
9 #include "src/interpreter/bytecode-dead-code-optimizer.h" 9 #include "src/interpreter/bytecode-dead-code-optimizer.h"
10 #include "src/interpreter/bytecode-label.h" 10 #include "src/interpreter/bytecode-label.h"
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 register_optimizer_->DoMov(from, to, CurrentSourcePosition(Bytecode::kMov)); 441 register_optimizer_->DoMov(from, to, CurrentSourcePosition(Bytecode::kMov));
442 } else { 442 } else {
443 OutputMov(from, to); 443 OutputMov(from, to);
444 } 444 }
445 return *this; 445 return *this;
446 } 446 }
447 447
448 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal( 448 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(
449 const Handle<String> name, int feedback_slot, TypeofMode typeof_mode) { 449 const Handle<String> name, int feedback_slot, TypeofMode typeof_mode) {
450 size_t name_index = GetConstantPoolEntry(name); 450 size_t name_index = GetConstantPoolEntry(name);
451 // Ensure that typeof mode is in sync with the IC slot kind if the function
452 // literal is available (not a unit test case).
453 // TODO(ishell): check only in debug mode.
454 if (literal_) {
455 FeedbackVectorSlot slot = TypeFeedbackVector::ToSlot(feedback_slot);
456 CHECK_EQ(GetTypeofModeFromICKind(feedback_vector_spec()->GetKind(slot)),
457 typeof_mode);
458 }
451 if (typeof_mode == INSIDE_TYPEOF) { 459 if (typeof_mode == INSIDE_TYPEOF) {
452 OutputLdaGlobalInsideTypeof(name_index, feedback_slot); 460 OutputLdaGlobalInsideTypeof(name_index, feedback_slot);
453 } else { 461 } else {
454 DCHECK_EQ(typeof_mode, NOT_INSIDE_TYPEOF); 462 DCHECK_EQ(typeof_mode, NOT_INSIDE_TYPEOF);
455 OutputLdaGlobal(name_index, feedback_slot); 463 OutputLdaGlobal(name_index, feedback_slot);
456 } 464 }
457 return *this; 465 return *this;
458 } 466 }
459 467
460 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreGlobal( 468 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreGlobal(
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 RegisterList reg_list) { 1083 RegisterList reg_list) {
1076 DCHECK(RegisterListIsValid(reg_list)); 1084 DCHECK(RegisterListIsValid(reg_list));
1077 if (register_optimizer_) 1085 if (register_optimizer_)
1078 register_optimizer_->PrepareOutputRegisterList(reg_list); 1086 register_optimizer_->PrepareOutputRegisterList(reg_list);
1079 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); 1087 return static_cast<uint32_t>(reg_list.first_register().ToOperand());
1080 } 1088 }
1081 1089
1082 } // namespace interpreter 1090 } // namespace interpreter
1083 } // namespace internal 1091 } // namespace internal
1084 } // namespace v8 1092 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/x87/handler-compiler-x87.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698