| OLD | NEW |
| 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 return ic; | 98 return ic; |
| 99 } | 99 } |
| 100 | 100 |
| 101 | 101 |
| 102 Handle<Code> PlatformCodeStub::GenerateCode() { | 102 Handle<Code> PlatformCodeStub::GenerateCode() { |
| 103 Factory* factory = isolate()->factory(); | 103 Factory* factory = isolate()->factory(); |
| 104 | 104 |
| 105 // Generate the new code. | 105 // Generate the new code. |
| 106 MacroAssembler masm(isolate(), NULL, 256); | 106 MacroAssembler masm(isolate(), NULL, 256); |
| 107 | 107 |
| 108 // TODO(yangguo) remove this once the code serializer handles code stubs. | |
| 109 if (FLAG_serialize_toplevel) masm.enable_serializer(); | |
| 110 | |
| 111 { | 108 { |
| 112 // Update the static counter each time a new code stub is generated. | 109 // Update the static counter each time a new code stub is generated. |
| 113 isolate()->counters()->code_stubs()->Increment(); | 110 isolate()->counters()->code_stubs()->Increment(); |
| 114 | 111 |
| 115 // Generate the code for the stub. | 112 // Generate the code for the stub. |
| 116 masm.set_generating_stub(true); | 113 masm.set_generating_stub(true); |
| 117 NoCurrentFrameScope scope(&masm); | 114 NoCurrentFrameScope scope(&masm); |
| 118 Generate(&masm); | 115 Generate(&masm); |
| 119 } | 116 } |
| 120 | 117 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 #define DEF_CASE(NAME) \ | 214 #define DEF_CASE(NAME) \ |
| 218 case NAME: { \ | 215 case NAME: { \ |
| 219 NAME##Stub stub(key, isolate); \ | 216 NAME##Stub stub(key, isolate); \ |
| 220 CodeStub* pstub = &stub; \ | 217 CodeStub* pstub = &stub; \ |
| 221 call(pstub, value_out); \ | 218 call(pstub, value_out); \ |
| 222 break; \ | 219 break; \ |
| 223 } | 220 } |
| 224 CODE_STUB_LIST(DEF_CASE) | 221 CODE_STUB_LIST(DEF_CASE) |
| 225 #undef DEF_CASE | 222 #undef DEF_CASE |
| 226 case NUMBER_OF_IDS: | 223 case NUMBER_OF_IDS: |
| 224 case NoCache: |
| 227 UNREACHABLE(); | 225 UNREACHABLE(); |
| 228 case NoCache: | |
| 229 *value_out = NULL; | |
| 230 break; | 226 break; |
| 231 } | 227 } |
| 232 } | 228 } |
| 233 | 229 |
| 234 | 230 |
| 235 static void InitializeDescriptorDispatchedCall(CodeStub* stub, | 231 static void InitializeDescriptorDispatchedCall(CodeStub* stub, |
| 236 void** value_out) { | 232 void** value_out) { |
| 237 CodeStubDescriptor* descriptor_out = | 233 CodeStubDescriptor* descriptor_out = |
| 238 reinterpret_cast<CodeStubDescriptor*>(value_out); | 234 reinterpret_cast<CodeStubDescriptor*>(value_out); |
| 239 stub->InitializeDescriptor(descriptor_out); | 235 stub->InitializeDescriptor(descriptor_out); |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 } | 958 } |
| 963 | 959 |
| 964 | 960 |
| 965 InternalArrayConstructorStub::InternalArrayConstructorStub( | 961 InternalArrayConstructorStub::InternalArrayConstructorStub( |
| 966 Isolate* isolate) : PlatformCodeStub(isolate) { | 962 Isolate* isolate) : PlatformCodeStub(isolate) { |
| 967 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 963 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 968 } | 964 } |
| 969 | 965 |
| 970 | 966 |
| 971 } } // namespace v8::internal | 967 } } // namespace v8::internal |
| OLD | NEW |