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

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

Issue 71163006: Merge bleeding_edge r17376:17693. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Fix all.gyp Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 28 matching lines...) Expand all
39 namespace internal { 39 namespace internal {
40 40
41 41
42 CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor() 42 CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
43 : register_param_count_(-1), 43 : register_param_count_(-1),
44 stack_parameter_count_(no_reg), 44 stack_parameter_count_(no_reg),
45 hint_stack_parameter_count_(-1), 45 hint_stack_parameter_count_(-1),
46 function_mode_(NOT_JS_FUNCTION_STUB_MODE), 46 function_mode_(NOT_JS_FUNCTION_STUB_MODE),
47 register_params_(NULL), 47 register_params_(NULL),
48 deoptimization_handler_(NULL), 48 deoptimization_handler_(NULL),
49 handler_arguments_mode_(DONT_PASS_ARGUMENTS),
49 miss_handler_(), 50 miss_handler_(),
50 has_miss_handler_(false) { } 51 has_miss_handler_(false) { }
51 52
52 53
53 bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) { 54 bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) {
54 UnseededNumberDictionary* stubs = isolate->heap()->code_stubs(); 55 UnseededNumberDictionary* stubs = isolate->heap()->code_stubs();
55 int index = stubs->FindEntry(GetKey()); 56 int index = stubs->FindEntry(GetKey());
56 if (index != UnseededNumberDictionary::kNotFound) { 57 if (index != UnseededNumberDictionary::kNotFound) {
57 *code_out = Code::cast(stubs->ValueAt(index)); 58 *code_out = Code::cast(stubs->ValueAt(index));
58 return true; 59 return true;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 { 154 {
154 HandleScope scope(isolate); 155 HandleScope scope(isolate);
155 156
156 Handle<Code> new_object = GenerateCode(isolate); 157 Handle<Code> new_object = GenerateCode(isolate);
157 new_object->set_major_key(MajorKey()); 158 new_object->set_major_key(MajorKey());
158 FinishCode(new_object); 159 FinishCode(new_object);
159 RecordCodeGeneration(*new_object, isolate); 160 RecordCodeGeneration(*new_object, isolate);
160 161
161 #ifdef ENABLE_DISASSEMBLER 162 #ifdef ENABLE_DISASSEMBLER
162 if (FLAG_print_code_stubs) { 163 if (FLAG_print_code_stubs) {
163 new_object->Disassemble(*GetName()); 164 CodeTracer::Scope trace_scope(isolate->GetCodeTracer());
164 PrintF("\n"); 165 new_object->Disassemble(*GetName(), trace_scope.file());
166 PrintF(trace_scope.file(), "\n");
165 } 167 }
166 #endif 168 #endif
167 169
168 if (UseSpecialCache()) { 170 if (UseSpecialCache()) {
169 AddToSpecialCache(new_object); 171 AddToSpecialCache(new_object);
170 } else { 172 } else {
171 // Update the dictionary and the root in Heap. 173 // Update the dictionary and the root in Heap.
172 Handle<UnseededNumberDictionary> dict = 174 Handle<UnseededNumberDictionary> dict =
173 factory->DictionaryAtNumberPut( 175 factory->DictionaryAtNumberPut(
174 Handle<UnseededNumberDictionary>(heap->code_stubs()), 176 Handle<UnseededNumberDictionary>(heap->code_stubs()),
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 handle(Type::String(), isolate)), isolate); 676 handle(Type::String(), isolate)), isolate);
675 } 677 }
676 ASSERT(result_state_ != GENERIC); 678 ASSERT(result_state_ != GENERIC);
677 if (result_state_ == NUMBER && op_ == Token::SHR) { 679 if (result_state_ == NUMBER && op_ == Token::SHR) {
678 return handle(Type::Unsigned32(), isolate); 680 return handle(Type::Unsigned32(), isolate);
679 } 681 }
680 return StateToType(result_state_, isolate); 682 return StateToType(result_state_, isolate);
681 } 683 }
682 684
683 685
686 void NewStringAddStub::PrintBaseName(StringStream* stream) {
687 stream->Add("NewStringAddStub");
688 if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_BOTH) {
689 stream->Add("_CheckBoth");
690 } else if ((flags() & STRING_ADD_CHECK_LEFT) == STRING_ADD_CHECK_LEFT) {
691 stream->Add("_CheckLeft");
692 } else if ((flags() & STRING_ADD_CHECK_RIGHT) == STRING_ADD_CHECK_RIGHT) {
693 stream->Add("_CheckRight");
694 }
695 if (pretenure_flag() == TENURED) {
696 stream->Add("_Tenured");
697 }
698 }
699
700
684 InlineCacheState ICCompareStub::GetICState() { 701 InlineCacheState ICCompareStub::GetICState() {
685 CompareIC::State state = Max(left_, right_); 702 CompareIC::State state = Max(left_, right_);
686 switch (state) { 703 switch (state) {
687 case CompareIC::UNINITIALIZED: 704 case CompareIC::UNINITIALIZED:
688 return ::v8::internal::UNINITIALIZED; 705 return ::v8::internal::UNINITIALIZED;
689 case CompareIC::SMI: 706 case CompareIC::SMI:
690 case CompareIC::NUMBER: 707 case CompareIC::NUMBER:
691 case CompareIC::INTERNALIZED_STRING: 708 case CompareIC::INTERNALIZED_STRING:
692 case CompareIC::STRING: 709 case CompareIC::STRING:
693 case CompareIC::UNIQUE_NAME: 710 case CompareIC::UNIQUE_NAME:
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 InstallDescriptor(isolate, &stub); 1143 InstallDescriptor(isolate, &stub);
1127 } 1144 }
1128 1145
1129 1146
1130 void FastNewClosureStub::InstallDescriptors(Isolate* isolate) { 1147 void FastNewClosureStub::InstallDescriptors(Isolate* isolate) {
1131 FastNewClosureStub stub(STRICT_MODE, false); 1148 FastNewClosureStub stub(STRICT_MODE, false);
1132 InstallDescriptor(isolate, &stub); 1149 InstallDescriptor(isolate, &stub);
1133 } 1150 }
1134 1151
1135 1152
1153 // static
1154 void NewStringAddStub::InstallDescriptors(Isolate* isolate) {
1155 NewStringAddStub stub(STRING_ADD_CHECK_NONE, NOT_TENURED);
1156 InstallDescriptor(isolate, &stub);
1157 }
1158
1159
1136 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate) 1160 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate)
1137 : argument_count_(ANY) { 1161 : argument_count_(ANY) {
1138 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 1162 ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
1139 } 1163 }
1140 1164
1141 1165
1142 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate, 1166 ArrayConstructorStub::ArrayConstructorStub(Isolate* isolate,
1143 int argument_count) { 1167 int argument_count) {
1144 if (argument_count == 0) { 1168 if (argument_count == 0) {
1145 argument_count_ = NONE; 1169 argument_count_ = NONE;
(...skipping 17 matching lines...) Expand all
1163 InstallDescriptor(isolate, &stub3); 1187 InstallDescriptor(isolate, &stub3);
1164 } 1188 }
1165 1189
1166 InternalArrayConstructorStub::InternalArrayConstructorStub( 1190 InternalArrayConstructorStub::InternalArrayConstructorStub(
1167 Isolate* isolate) { 1191 Isolate* isolate) {
1168 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 1192 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
1169 } 1193 }
1170 1194
1171 1195
1172 } } // namespace v8::internal 1196 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698