| OLD | NEW |
| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 handler_arguments_mode_(DONT_PASS_ARGUMENTS), |
| 50 miss_handler_(), | 50 miss_handler_(), |
| 51 has_miss_handler_(false) { } | 51 has_miss_handler_(false) { } |
| 52 | 52 |
| 53 | 53 |
| 54 bool CodeStub::FindCodeInCache(Code** code_out, Isolate* isolate) { | 54 bool CodeStub::FindCodeInCache(Code** code_out) { |
| 55 UnseededNumberDictionary* stubs = isolate->heap()->code_stubs(); | 55 UnseededNumberDictionary* stubs = isolate()->heap()->code_stubs(); |
| 56 int index = stubs->FindEntry(GetKey()); | 56 int index = stubs->FindEntry(GetKey()); |
| 57 if (index != UnseededNumberDictionary::kNotFound) { | 57 if (index != UnseededNumberDictionary::kNotFound) { |
| 58 *code_out = Code::cast(stubs->ValueAt(index)); | 58 *code_out = Code::cast(stubs->ValueAt(index)); |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 return false; | 61 return false; |
| 62 } | 62 } |
| 63 | 63 |
| 64 | 64 |
| 65 SmartArrayPointer<const char> CodeStub::GetName() { | 65 SmartArrayPointer<const char> CodeStub::GetName() { |
| 66 char buffer[100]; | 66 char buffer[100]; |
| 67 NoAllocationStringAllocator allocator(buffer, | 67 NoAllocationStringAllocator allocator(buffer, |
| 68 static_cast<unsigned>(sizeof(buffer))); | 68 static_cast<unsigned>(sizeof(buffer))); |
| 69 StringStream stream(&allocator); | 69 StringStream stream(&allocator); |
| 70 PrintName(&stream); | 70 PrintName(&stream); |
| 71 return stream.ToCString(); | 71 return stream.ToCString(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 | 74 |
| 75 void CodeStub::RecordCodeGeneration(Handle<Code> code, Isolate* isolate) { | 75 void CodeStub::RecordCodeGeneration(Handle<Code> code) { |
| 76 IC::RegisterWeakMapDependency(code); | 76 IC::RegisterWeakMapDependency(code); |
| 77 SmartArrayPointer<const char> name = GetName(); | 77 SmartArrayPointer<const char> name = GetName(); |
| 78 PROFILE(isolate, CodeCreateEvent(Logger::STUB_TAG, *code, name.get())); | 78 PROFILE(isolate(), CodeCreateEvent(Logger::STUB_TAG, *code, name.get())); |
| 79 GDBJIT(AddCode(GDBJITInterface::STUB, name.get(), *code)); | 79 GDBJIT(AddCode(GDBJITInterface::STUB, name.get(), *code)); |
| 80 Counters* counters = isolate->counters(); | 80 Counters* counters = isolate()->counters(); |
| 81 counters->total_stubs_code_size()->Increment(code->instruction_size()); | 81 counters->total_stubs_code_size()->Increment(code->instruction_size()); |
| 82 } | 82 } |
| 83 | 83 |
| 84 | 84 |
| 85 Code::Kind CodeStub::GetCodeKind() const { | 85 Code::Kind CodeStub::GetCodeKind() const { |
| 86 return Code::STUB; | 86 return Code::STUB; |
| 87 } | 87 } |
| 88 | 88 |
| 89 | 89 |
| 90 Handle<Code> CodeStub::GetCodeCopy(Isolate* isolate, | 90 Handle<Code> CodeStub::GetCodeCopy(const Code::FindAndReplacePattern& pattern) { |
| 91 const Code::FindAndReplacePattern& pattern) { | 91 Handle<Code> ic = GetCode(); |
| 92 Handle<Code> ic = GetCode(isolate); | 92 ic = isolate()->factory()->CopyCode(ic); |
| 93 ic = isolate->factory()->CopyCode(ic); | |
| 94 ic->FindAndReplace(pattern); | 93 ic->FindAndReplace(pattern); |
| 95 RecordCodeGeneration(ic, isolate); | 94 RecordCodeGeneration(ic); |
| 96 return ic; | 95 return ic; |
| 97 } | 96 } |
| 98 | 97 |
| 99 | 98 |
| 100 Handle<Code> PlatformCodeStub::GenerateCode(Isolate* isolate) { | 99 Handle<Code> PlatformCodeStub::GenerateCode() { |
| 101 Factory* factory = isolate->factory(); | 100 Factory* factory = isolate()->factory(); |
| 102 | 101 |
| 103 // Generate the new code. | 102 // Generate the new code. |
| 104 MacroAssembler masm(isolate, NULL, 256); | 103 MacroAssembler masm(isolate(), NULL, 256); |
| 105 | 104 |
| 106 { | 105 { |
| 107 // Update the static counter each time a new code stub is generated. | 106 // Update the static counter each time a new code stub is generated. |
| 108 isolate->counters()->code_stubs()->Increment(); | 107 isolate()->counters()->code_stubs()->Increment(); |
| 109 | 108 |
| 110 // Generate the code for the stub. | 109 // Generate the code for the stub. |
| 111 masm.set_generating_stub(true); | 110 masm.set_generating_stub(true); |
| 112 NoCurrentFrameScope scope(&masm); | 111 NoCurrentFrameScope scope(&masm); |
| 113 Generate(&masm); | 112 Generate(&masm); |
| 114 } | 113 } |
| 115 | 114 |
| 116 // Create the code object. | 115 // Create the code object. |
| 117 CodeDesc desc; | 116 CodeDesc desc; |
| 118 masm.GetCode(&desc); | 117 masm.GetCode(&desc); |
| 119 | 118 |
| 120 // Copy the generated code into a heap object. | 119 // Copy the generated code into a heap object. |
| 121 Code::Flags flags = Code::ComputeFlags( | 120 Code::Flags flags = Code::ComputeFlags( |
| 122 GetCodeKind(), | 121 GetCodeKind(), |
| 123 GetICState(), | 122 GetICState(), |
| 124 GetExtraICState(), | 123 GetExtraICState(), |
| 125 GetStubType()); | 124 GetStubType()); |
| 126 Handle<Code> new_object = factory->NewCode( | 125 Handle<Code> new_object = factory->NewCode( |
| 127 desc, flags, masm.CodeObject(), NeedsImmovableCode()); | 126 desc, flags, masm.CodeObject(), NeedsImmovableCode()); |
| 128 return new_object; | 127 return new_object; |
| 129 } | 128 } |
| 130 | 129 |
| 131 | 130 |
| 132 void CodeStub::VerifyPlatformFeatures(Isolate* isolate) { | 131 void CodeStub::VerifyPlatformFeatures() { |
| 133 ASSERT(CpuFeatures::VerifyCrossCompiling()); | 132 ASSERT(CpuFeatures::VerifyCrossCompiling()); |
| 134 } | 133 } |
| 135 | 134 |
| 136 | 135 |
| 137 Handle<Code> CodeStub::GetCode(Isolate* isolate) { | 136 Handle<Code> CodeStub::GetCode() { |
| 138 Heap* heap = isolate->heap(); | 137 Heap* heap = isolate()->heap(); |
| 139 Code* code; | 138 Code* code; |
| 140 if (UseSpecialCache() | 139 if (UseSpecialCache() |
| 141 ? FindCodeInSpecialCache(&code, isolate) | 140 ? FindCodeInSpecialCache(&code) |
| 142 : FindCodeInCache(&code, isolate)) { | 141 : FindCodeInCache(&code)) { |
| 143 ASSERT(GetCodeKind() == code->kind()); | 142 ASSERT(GetCodeKind() == code->kind()); |
| 144 return Handle<Code>(code); | 143 return Handle<Code>(code); |
| 145 } | 144 } |
| 146 | 145 |
| 147 #ifdef DEBUG | 146 #ifdef DEBUG |
| 148 VerifyPlatformFeatures(isolate); | 147 VerifyPlatformFeatures(); |
| 149 #endif | 148 #endif |
| 150 | 149 |
| 151 { | 150 { |
| 152 HandleScope scope(isolate); | 151 HandleScope scope(isolate()); |
| 153 | 152 |
| 154 Handle<Code> new_object = GenerateCode(isolate); | 153 Handle<Code> new_object = GenerateCode(); |
| 155 new_object->set_major_key(MajorKey()); | 154 new_object->set_major_key(MajorKey()); |
| 156 FinishCode(new_object); | 155 FinishCode(new_object); |
| 157 RecordCodeGeneration(new_object, isolate); | 156 RecordCodeGeneration(new_object); |
| 158 | 157 |
| 159 #ifdef ENABLE_DISASSEMBLER | 158 #ifdef ENABLE_DISASSEMBLER |
| 160 if (FLAG_print_code_stubs) { | 159 if (FLAG_print_code_stubs) { |
| 161 CodeTracer::Scope trace_scope(isolate->GetCodeTracer()); | 160 CodeTracer::Scope trace_scope(isolate()->GetCodeTracer()); |
| 162 new_object->Disassemble(GetName().get(), trace_scope.file()); | 161 new_object->Disassemble(GetName().get(), trace_scope.file()); |
| 163 PrintF(trace_scope.file(), "\n"); | 162 PrintF(trace_scope.file(), "\n"); |
| 164 } | 163 } |
| 165 #endif | 164 #endif |
| 166 | 165 |
| 167 if (UseSpecialCache()) { | 166 if (UseSpecialCache()) { |
| 168 AddToSpecialCache(new_object); | 167 AddToSpecialCache(new_object); |
| 169 } else { | 168 } else { |
| 170 // Update the dictionary and the root in Heap. | 169 // Update the dictionary and the root in Heap. |
| 171 Handle<UnseededNumberDictionary> dict = | 170 Handle<UnseededNumberDictionary> dict = |
| 172 UnseededNumberDictionary::AtNumberPut( | 171 UnseededNumberDictionary::AtNumberPut( |
| 173 Handle<UnseededNumberDictionary>(heap->code_stubs()), | 172 Handle<UnseededNumberDictionary>(heap->code_stubs()), |
| 174 GetKey(), | 173 GetKey(), |
| 175 new_object); | 174 new_object); |
| 176 heap->public_set_code_stubs(*dict); | 175 heap->public_set_code_stubs(*dict); |
| 177 } | 176 } |
| 178 code = *new_object; | 177 code = *new_object; |
| 179 } | 178 } |
| 180 | 179 |
| 181 Activate(code); | 180 Activate(code); |
| 182 ASSERT(!NeedsImmovableCode() || | 181 ASSERT(!NeedsImmovableCode() || |
| 183 heap->lo_space()->Contains(code) || | 182 heap->lo_space()->Contains(code) || |
| 184 heap->code_space()->FirstPage()->Contains(code->address())); | 183 heap->code_space()->FirstPage()->Contains(code->address())); |
| 185 return Handle<Code>(code, isolate); | 184 return Handle<Code>(code, isolate()); |
| 186 } | 185 } |
| 187 | 186 |
| 188 | 187 |
| 189 const char* CodeStub::MajorName(CodeStub::Major major_key, | 188 const char* CodeStub::MajorName(CodeStub::Major major_key, |
| 190 bool allow_unknown_keys) { | 189 bool allow_unknown_keys) { |
| 191 switch (major_key) { | 190 switch (major_key) { |
| 192 #define DEF_CASE(name) case name: return #name "Stub"; | 191 #define DEF_CASE(name) case name: return #name "Stub"; |
| 193 CODE_STUB_LIST(DEF_CASE) | 192 CODE_STUB_LIST(DEF_CASE) |
| 194 #undef DEF_CASE | 193 #undef DEF_CASE |
| 195 case UninitializedMajorKey: return "<UninitializedMajorKey>Stub"; | 194 case UninitializedMajorKey: return "<UninitializedMajorKey>Stub"; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 214 | 213 |
| 215 | 214 |
| 216 // static | 215 // static |
| 217 void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate) { | 216 void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate) { |
| 218 // Generate the uninitialized versions of the stub. | 217 // Generate the uninitialized versions of the stub. |
| 219 for (int op = Token::BIT_OR; op <= Token::MOD; ++op) { | 218 for (int op = Token::BIT_OR; op <= Token::MOD; ++op) { |
| 220 for (int mode = NO_OVERWRITE; mode <= OVERWRITE_RIGHT; ++mode) { | 219 for (int mode = NO_OVERWRITE; mode <= OVERWRITE_RIGHT; ++mode) { |
| 221 BinaryOpICStub stub(isolate, | 220 BinaryOpICStub stub(isolate, |
| 222 static_cast<Token::Value>(op), | 221 static_cast<Token::Value>(op), |
| 223 static_cast<OverwriteMode>(mode)); | 222 static_cast<OverwriteMode>(mode)); |
| 224 stub.GetCode(isolate); | 223 stub.GetCode(); |
| 225 } | 224 } |
| 226 } | 225 } |
| 227 | 226 |
| 228 // Generate special versions of the stub. | 227 // Generate special versions of the stub. |
| 229 BinaryOpIC::State::GenerateAheadOfTime(isolate, &GenerateAheadOfTime); | 228 BinaryOpIC::State::GenerateAheadOfTime(isolate, &GenerateAheadOfTime); |
| 230 } | 229 } |
| 231 | 230 |
| 232 | 231 |
| 233 void BinaryOpICStub::PrintState(StringStream* stream) { | 232 void BinaryOpICStub::PrintState(StringStream* stream) { |
| 234 state_.Print(stream); | 233 state_.Print(stream); |
| 235 } | 234 } |
| 236 | 235 |
| 237 | 236 |
| 238 // static | 237 // static |
| 239 void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate, | 238 void BinaryOpICStub::GenerateAheadOfTime(Isolate* isolate, |
| 240 const BinaryOpIC::State& state) { | 239 const BinaryOpIC::State& state) { |
| 241 BinaryOpICStub stub(isolate, state); | 240 BinaryOpICStub stub(isolate, state); |
| 242 stub.GetCode(isolate); | 241 stub.GetCode(); |
| 243 } | 242 } |
| 244 | 243 |
| 245 | 244 |
| 246 // static | 245 // static |
| 247 void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { | 246 void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { |
| 248 // Generate special versions of the stub. | 247 // Generate special versions of the stub. |
| 249 BinaryOpIC::State::GenerateAheadOfTime(isolate, &GenerateAheadOfTime); | 248 BinaryOpIC::State::GenerateAheadOfTime(isolate, &GenerateAheadOfTime); |
| 250 } | 249 } |
| 251 | 250 |
| 252 | 251 |
| 253 void BinaryOpICWithAllocationSiteStub::PrintState(StringStream* stream) { | 252 void BinaryOpICWithAllocationSiteStub::PrintState(StringStream* stream) { |
| 254 state_.Print(stream); | 253 state_.Print(stream); |
| 255 } | 254 } |
| 256 | 255 |
| 257 | 256 |
| 258 // static | 257 // static |
| 259 void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime( | 258 void BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime( |
| 260 Isolate* isolate, const BinaryOpIC::State& state) { | 259 Isolate* isolate, const BinaryOpIC::State& state) { |
| 261 if (state.CouldCreateAllocationMementos()) { | 260 if (state.CouldCreateAllocationMementos()) { |
| 262 BinaryOpICWithAllocationSiteStub stub(isolate, state); | 261 BinaryOpICWithAllocationSiteStub stub(isolate, state); |
| 263 stub.GetCode(isolate); | 262 stub.GetCode(); |
| 264 } | 263 } |
| 265 } | 264 } |
| 266 | 265 |
| 267 | 266 |
| 268 void StringAddStub::PrintBaseName(StringStream* stream) { | 267 void StringAddStub::PrintBaseName(StringStream* stream) { |
| 269 stream->Add("StringAddStub"); | 268 stream->Add("StringAddStub"); |
| 270 if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_BOTH) { | 269 if ((flags() & STRING_ADD_CHECK_BOTH) == STRING_ADD_CHECK_BOTH) { |
| 271 stream->Add("_CheckBoth"); | 270 stream->Add("_CheckBoth"); |
| 272 } else if ((flags() & STRING_ADD_CHECK_LEFT) == STRING_ADD_CHECK_LEFT) { | 271 } else if ((flags() & STRING_ADD_CHECK_LEFT) == STRING_ADD_CHECK_LEFT) { |
| 273 stream->Add("_CheckLeft"); | 272 stream->Add("_CheckLeft"); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 Isolate* isolate = new_object->GetIsolate(); | 305 Isolate* isolate = new_object->GetIsolate(); |
| 307 Factory* factory = isolate->factory(); | 306 Factory* factory = isolate->factory(); |
| 308 return Map::UpdateCodeCache(known_map_, | 307 return Map::UpdateCodeCache(known_map_, |
| 309 strict() ? | 308 strict() ? |
| 310 factory->strict_compare_ic_string() : | 309 factory->strict_compare_ic_string() : |
| 311 factory->compare_ic_string(), | 310 factory->compare_ic_string(), |
| 312 new_object); | 311 new_object); |
| 313 } | 312 } |
| 314 | 313 |
| 315 | 314 |
| 316 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out, Isolate* isolate) { | 315 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out) { |
| 317 Factory* factory = isolate->factory(); | 316 Factory* factory = isolate()->factory(); |
| 318 Code::Flags flags = Code::ComputeFlags( | 317 Code::Flags flags = Code::ComputeFlags( |
| 319 GetCodeKind(), | 318 GetCodeKind(), |
| 320 UNINITIALIZED); | 319 UNINITIALIZED); |
| 321 ASSERT(op_ == Token::EQ || op_ == Token::EQ_STRICT); | 320 ASSERT(op_ == Token::EQ || op_ == Token::EQ_STRICT); |
| 322 Handle<Object> probe( | 321 Handle<Object> probe( |
| 323 known_map_->FindInCodeCache( | 322 known_map_->FindInCodeCache( |
| 324 strict() ? | 323 strict() ? |
| 325 *factory->strict_compare_ic_string() : | 324 *factory->strict_compare_ic_string() : |
| 326 *factory->compare_ic_string(), | 325 *factory->compare_ic_string(), |
| 327 flags), | 326 flags), |
| 328 isolate); | 327 isolate()); |
| 329 if (probe->IsCode()) { | 328 if (probe->IsCode()) { |
| 330 *code_out = Code::cast(*probe); | 329 *code_out = Code::cast(*probe); |
| 331 #ifdef DEBUG | 330 #ifdef DEBUG |
| 332 Token::Value cached_op; | 331 Token::Value cached_op; |
| 333 ICCompareStub::DecodeMinorKey((*code_out)->stub_info(), NULL, NULL, NULL, | 332 ICCompareStub::DecodeMinorKey((*code_out)->stub_info(), NULL, NULL, NULL, |
| 334 &cached_op); | 333 &cached_op); |
| 335 ASSERT(op_ == cached_op); | 334 ASSERT(op_ == cached_op); |
| 336 #endif | 335 #endif |
| 337 return true; | 336 return true; |
| 338 } | 337 } |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 533 |
| 535 | 534 |
| 536 void KeyedLoadDictionaryElementPlatformStub::Generate( | 535 void KeyedLoadDictionaryElementPlatformStub::Generate( |
| 537 MacroAssembler* masm) { | 536 MacroAssembler* masm) { |
| 538 KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm); | 537 KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm); |
| 539 } | 538 } |
| 540 | 539 |
| 541 | 540 |
| 542 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { | 541 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { |
| 543 CreateAllocationSiteStub stub(isolate); | 542 CreateAllocationSiteStub stub(isolate); |
| 544 stub.GetCode(isolate); | 543 stub.GetCode(); |
| 545 } | 544 } |
| 546 | 545 |
| 547 | 546 |
| 548 void KeyedStoreElementStub::Generate(MacroAssembler* masm) { | 547 void KeyedStoreElementStub::Generate(MacroAssembler* masm) { |
| 549 switch (elements_kind_) { | 548 switch (elements_kind_) { |
| 550 case FAST_ELEMENTS: | 549 case FAST_ELEMENTS: |
| 551 case FAST_HOLEY_ELEMENTS: | 550 case FAST_HOLEY_ELEMENTS: |
| 552 case FAST_SMI_ELEMENTS: | 551 case FAST_SMI_ELEMENTS: |
| 553 case FAST_HOLEY_SMI_ELEMENTS: | 552 case FAST_HOLEY_SMI_ELEMENTS: |
| 554 case FAST_DOUBLE_ELEMENTS: | 553 case FAST_DOUBLE_ELEMENTS: |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 | 690 |
| 692 bool ToBooleanStub::Types::CanBeUndetectable() const { | 691 bool ToBooleanStub::Types::CanBeUndetectable() const { |
| 693 return Contains(ToBooleanStub::SPEC_OBJECT) | 692 return Contains(ToBooleanStub::SPEC_OBJECT) |
| 694 || Contains(ToBooleanStub::STRING); | 693 || Contains(ToBooleanStub::STRING); |
| 695 } | 694 } |
| 696 | 695 |
| 697 | 696 |
| 698 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { | 697 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { |
| 699 StubFailureTrampolineStub stub1(isolate, NOT_JS_FUNCTION_STUB_MODE); | 698 StubFailureTrampolineStub stub1(isolate, NOT_JS_FUNCTION_STUB_MODE); |
| 700 StubFailureTrampolineStub stub2(isolate, JS_FUNCTION_STUB_MODE); | 699 StubFailureTrampolineStub stub2(isolate, JS_FUNCTION_STUB_MODE); |
| 701 stub1.GetCode(isolate); | 700 stub1.GetCode(); |
| 702 stub2.GetCode(isolate); | 701 stub2.GetCode(); |
| 703 } | 702 } |
| 704 | 703 |
| 705 | 704 |
| 706 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, | 705 void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, |
| 707 intptr_t stack_pointer, | 706 intptr_t stack_pointer, |
| 708 Isolate* isolate) { | 707 Isolate* isolate) { |
| 709 FunctionEntryHook entry_hook = isolate->function_entry_hook(); | 708 FunctionEntryHook entry_hook = isolate->function_entry_hook(); |
| 710 ASSERT(entry_hook != NULL); | 709 ASSERT(entry_hook != NULL); |
| 711 entry_hook(function, stack_pointer); | 710 entry_hook(function, stack_pointer); |
| 712 } | 711 } |
| 713 | 712 |
| 714 | 713 |
| 715 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { | 714 static void InstallDescriptor(Isolate* isolate, HydrogenCodeStub* stub) { |
| 716 int major_key = stub->MajorKey(); | 715 int major_key = stub->MajorKey(); |
| 717 CodeStubInterfaceDescriptor* descriptor = | 716 CodeStubInterfaceDescriptor* descriptor = |
| 718 isolate->code_stub_interface_descriptor(major_key); | 717 isolate->code_stub_interface_descriptor(major_key); |
| 719 if (!descriptor->initialized()) { | 718 if (!descriptor->initialized()) { |
| 720 stub->InitializeInterfaceDescriptor(isolate, descriptor); | 719 stub->InitializeInterfaceDescriptor(descriptor); |
| 721 } | 720 } |
| 722 } | 721 } |
| 723 | 722 |
| 724 | 723 |
| 725 void ArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) { | 724 void ArrayConstructorStubBase::InstallDescriptors(Isolate* isolate) { |
| 726 ArrayNoArgumentConstructorStub stub1(isolate, GetInitialFastElementsKind()); | 725 ArrayNoArgumentConstructorStub stub1(isolate, GetInitialFastElementsKind()); |
| 727 InstallDescriptor(isolate, &stub1); | 726 InstallDescriptor(isolate, &stub1); |
| 728 ArraySingleArgumentConstructorStub stub2(isolate, | 727 ArraySingleArgumentConstructorStub stub2(isolate, |
| 729 GetInitialFastElementsKind()); | 728 GetInitialFastElementsKind()); |
| 730 InstallDescriptor(isolate, &stub2); | 729 InstallDescriptor(isolate, &stub2); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 InstallDescriptor(isolate, &stub3); | 818 InstallDescriptor(isolate, &stub3); |
| 820 } | 819 } |
| 821 | 820 |
| 822 InternalArrayConstructorStub::InternalArrayConstructorStub( | 821 InternalArrayConstructorStub::InternalArrayConstructorStub( |
| 823 Isolate* isolate) : PlatformCodeStub(isolate) { | 822 Isolate* isolate) : PlatformCodeStub(isolate) { |
| 824 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 823 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 825 } | 824 } |
| 826 | 825 |
| 827 | 826 |
| 828 } } // namespace v8::internal | 827 } } // namespace v8::internal |
| OLD | NEW |