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 #ifndef V8_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 | 360 |
361 Address deoptimization_handler_; | 361 Address deoptimization_handler_; |
362 HandlerArgumentsMode handler_arguments_mode_; | 362 HandlerArgumentsMode handler_arguments_mode_; |
363 | 363 |
364 ExternalReference miss_handler_; | 364 ExternalReference miss_handler_; |
365 bool has_miss_handler_; | 365 bool has_miss_handler_; |
366 DISALLOW_COPY_AND_ASSIGN(CodeStubInterfaceDescriptor); | 366 DISALLOW_COPY_AND_ASSIGN(CodeStubInterfaceDescriptor); |
367 }; | 367 }; |
368 | 368 |
369 | 369 |
370 struct PlatformCallInterfaceDescriptor; | 370 class PlatformCallInterfaceDescriptor; |
371 | 371 |
372 | 372 |
373 struct CallInterfaceDescriptor { | 373 class CallInterfaceDescriptor { |
| 374 public: |
374 CallInterfaceDescriptor() | 375 CallInterfaceDescriptor() |
375 : register_param_count_(-1), | 376 : register_param_count_(-1), |
376 register_params_(NULL), | 377 register_params_(NULL), |
377 param_representations_(NULL), | 378 param_representations_(NULL), |
378 platform_specific_descriptor_(NULL) { } | 379 platform_specific_descriptor_(NULL) { } |
379 | 380 |
| 381 // A copy of the passed in registers and param_representations is made |
| 382 // and owned by the CallInterfaceDescriptor. |
| 383 |
| 384 // TODO(mvstanton): Instead of taking parallel arrays register and |
| 385 // param_representations, how about a struct that puts the representation |
| 386 // and register side by side (eg, RegRep(r1, Representation::Tagged()). |
| 387 // The same should go for the CodeStubInterfaceDescriptor class. |
| 388 void Initialize(int register_parameter_count, Register* registers, |
| 389 Representation* param_representations, |
| 390 PlatformCallInterfaceDescriptor* platform_descriptor = NULL); |
| 391 |
380 bool initialized() const { return register_param_count_ >= 0; } | 392 bool initialized() const { return register_param_count_ >= 0; } |
381 | 393 |
382 int environment_length() const { | 394 int environment_length() const { |
383 return register_param_count_; | 395 return register_param_count_; |
384 } | 396 } |
385 | 397 |
386 Representation GetParameterRepresentation(int index) const { | 398 Representation GetParameterRepresentation(int index) const { |
387 return param_representations_[index]; | 399 return param_representations_[index]; |
388 } | 400 } |
389 | 401 |
390 Register GetParameterRegister(int index) const { | 402 Register GetParameterRegister(int index) const { |
391 return register_params_[index]; | 403 return register_params_[index]; |
392 } | 404 } |
393 | 405 |
394 PlatformCallInterfaceDescriptor* platform_specific_descriptor() const { | 406 PlatformCallInterfaceDescriptor* platform_specific_descriptor() const { |
395 return platform_specific_descriptor_; | 407 return platform_specific_descriptor_; |
396 } | 408 } |
397 | 409 |
| 410 private: |
398 int register_param_count_; | 411 int register_param_count_; |
399 Register* register_params_; | 412 SmartArrayPointer<Register> register_params_; |
400 Representation* param_representations_; | 413 SmartArrayPointer<Representation> param_representations_; |
401 PlatformCallInterfaceDescriptor* platform_specific_descriptor_; | 414 PlatformCallInterfaceDescriptor* platform_specific_descriptor_; |
402 }; | 415 }; |
403 | 416 |
404 | 417 |
405 class HydrogenCodeStub : public CodeStub { | 418 class HydrogenCodeStub : public CodeStub { |
406 public: | 419 public: |
407 enum InitializationState { | 420 enum InitializationState { |
408 UNINITIALIZED, | 421 UNINITIALIZED, |
409 INITIALIZED | 422 INITIALIZED |
410 }; | 423 }; |
(...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2520 | 2533 |
2521 | 2534 |
2522 class CallDescriptors { | 2535 class CallDescriptors { |
2523 public: | 2536 public: |
2524 static void InitializeForIsolate(Isolate* isolate); | 2537 static void InitializeForIsolate(Isolate* isolate); |
2525 }; | 2538 }; |
2526 | 2539 |
2527 } } // namespace v8::internal | 2540 } } // namespace v8::internal |
2528 | 2541 |
2529 #endif // V8_CODE_STUBS_H_ | 2542 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |