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

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

Issue 28993003: Make stack_parameter_count a plain register. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplify Deoptimizer::SetPlatformCompiledStubRegisters. Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/deoptimizer-arm.cc ('k') | src/code-stubs.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 12 matching lines...) Expand all
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_CODE_STUBS_H_ 28 #ifndef V8_CODE_STUBS_H_
29 #define V8_CODE_STUBS_H_ 29 #define V8_CODE_STUBS_H_
30 30
31 #include "allocation.h" 31 #include "allocation.h"
32 #include "assembler.h" 32 #include "assembler.h"
33 #include "codegen.h"
33 #include "globals.h" 34 #include "globals.h"
34 #include "codegen.h" 35 #include "macro-assembler.h"
35 36
36 namespace v8 { 37 namespace v8 {
37 namespace internal { 38 namespace internal {
38 39
39 // List of code stubs used on all platforms. 40 // List of code stubs used on all platforms.
40 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \ 41 #define CODE_STUB_LIST_ALL_PLATFORMS(V) \
41 V(CallFunction) \ 42 V(CallFunction) \
42 V(CallConstruct) \ 43 V(CallConstruct) \
43 V(BinaryOp) \ 44 V(BinaryOp) \
44 V(StringAdd) \ 45 V(StringAdd) \
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 virtual void Generate(MacroAssembler* masm) = 0; 274 virtual void Generate(MacroAssembler* masm) = 0;
274 }; 275 };
275 276
276 277
277 enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE }; 278 enum StubFunctionMode { NOT_JS_FUNCTION_STUB_MODE, JS_FUNCTION_STUB_MODE };
278 279
279 280
280 struct CodeStubInterfaceDescriptor { 281 struct CodeStubInterfaceDescriptor {
281 CodeStubInterfaceDescriptor(); 282 CodeStubInterfaceDescriptor();
282 int register_param_count_; 283 int register_param_count_;
283 const Register* stack_parameter_count_; 284 Register stack_parameter_count_;
284 // if hint_stack_parameter_count_ > 0, the code stub can optimize the 285 // if hint_stack_parameter_count_ > 0, the code stub can optimize the
285 // return sequence. Default value is -1, which means it is ignored. 286 // return sequence. Default value is -1, which means it is ignored.
286 int hint_stack_parameter_count_; 287 int hint_stack_parameter_count_;
287 StubFunctionMode function_mode_; 288 StubFunctionMode function_mode_;
288 Register* register_params_; 289 Register* register_params_;
289 Address deoptimization_handler_; 290 Address deoptimization_handler_;
290 291
291 int environment_length() const { 292 int environment_length() const {
292 if (stack_parameter_count_ != NULL) { 293 if (stack_parameter_count_.is_valid()) {
293 return register_param_count_ + 1; 294 return register_param_count_ + 1;
294 } 295 }
295 return register_param_count_; 296 return register_param_count_;
296 } 297 }
297 298
298 bool initialized() const { return register_param_count_ >= 0; } 299 bool initialized() const { return register_param_count_ >= 0; }
299 300
300 void SetMissHandler(ExternalReference handler) { 301 void SetMissHandler(ExternalReference handler) {
301 miss_handler_ = handler; 302 miss_handler_ = handler;
302 has_miss_handler_ = true; 303 has_miss_handler_ = true;
(...skipping 10 matching lines...) Expand all
313 314
314 private: 315 private:
315 ExternalReference miss_handler_; 316 ExternalReference miss_handler_;
316 bool has_miss_handler_; 317 bool has_miss_handler_;
317 }; 318 };
318 319
319 // A helper to make up for the fact that type Register is not fully 320 // A helper to make up for the fact that type Register is not fully
320 // defined outside of the platform directories 321 // defined outside of the platform directories
321 #define DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index) \ 322 #define DESCRIPTOR_GET_PARAMETER_REGISTER(descriptor, index) \
322 ((index) == (descriptor)->register_param_count_) \ 323 ((index) == (descriptor)->register_param_count_) \
323 ? *((descriptor)->stack_parameter_count_) \ 324 ? (descriptor)->stack_parameter_count_ \
324 : (descriptor)->register_params_[(index)] 325 : (descriptor)->register_params_[(index)]
325 326
326 327
327 class HydrogenCodeStub : public CodeStub { 328 class HydrogenCodeStub : public CodeStub {
328 public: 329 public:
329 enum InitializationState { 330 enum InitializationState {
330 UNINITIALIZED, 331 UNINITIALIZED,
331 INITIALIZED 332 INITIALIZED
332 }; 333 };
333 334
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 int MinorKey() { return 0; } 2357 int MinorKey() { return 0; }
2357 2358
2358 void Generate(MacroAssembler* masm); 2359 void Generate(MacroAssembler* masm);
2359 2360
2360 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 2361 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
2361 }; 2362 };
2362 2363
2363 } } // namespace v8::internal 2364 } } // namespace v8::internal
2364 2365
2365 #endif // V8_CODE_STUBS_H_ 2366 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/arm/deoptimizer-arm.cc ('k') | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698