Chromium Code Reviews| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 | 235 |
| 236 virtual int GetCodeKind() { return Code::STUB; } | 236 virtual int GetCodeKind() { return Code::STUB; } |
| 237 | 237 |
| 238 protected: | 238 protected: |
| 239 // Generates the assembler code for the stub. | 239 // Generates the assembler code for the stub. |
| 240 virtual void Generate(MacroAssembler* masm) = 0; | 240 virtual void Generate(MacroAssembler* masm) = 0; |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 | 243 |
| 244 struct CodeStubInterfaceDescriptor { | 244 struct CodeStubInterfaceDescriptor { |
| 245 int number_of_register_params; | 245 public: |
|
Jakob Kummerow
2012/12/05 16:14:33
no need for "public:"?
danno
2012/12/05 16:16:51
Done.
| |
| 246 Register* register_params; | 246 CodeStubInterfaceDescriptor() |
| 247 Handle<Code> deoptimization_handler; | 247 : register_param_count_(-1), |
| 248 register_params_(NULL) { } | |
| 249 int register_param_count_; | |
| 250 Register* register_params_; | |
| 251 Handle<Code> deoptimization_handler_; | |
| 248 }; | 252 }; |
| 249 | 253 |
| 250 | 254 |
| 251 class HGraph; | 255 class HGraph; |
| 252 struct Register; | 256 struct Register; |
| 253 class HydrogenCodeStub : public CodeStub { | 257 class HydrogenCodeStub : public CodeStub { |
| 254 public: | 258 public: |
| 255 // Retrieve the code for the stub. Generate the code if needed. | 259 // Retrieve the code for the stub. Generate the code if needed. |
| 256 virtual Handle<Code> GenerateCode() = 0; | 260 virtual Handle<Code> GenerateCode() = 0; |
| 257 | 261 |
| 258 virtual int GetCodeKind() { return Code::COMPILED_STUB; } | 262 virtual int GetCodeKind() { return Code::COMPILED_STUB; } |
| 259 | 263 |
| 260 virtual CodeStubInterfaceDescriptor* GetInterfaceDescriptor( | 264 CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate) { |
| 261 Isolate* isolate) = 0; | 265 return isolate->code_stub_interface_descriptor(MajorKey()); |
| 266 } | |
| 267 | |
| 268 virtual void InitializeInterfaceDescriptor( | |
| 269 Isolate* isolate, | |
| 270 CodeStubInterfaceDescriptor* descriptor) = 0; | |
| 262 | 271 |
| 263 protected: | 272 protected: |
| 264 Handle<Code> CodeFromGraph(HGraph* graph); | 273 Handle<Code> CodeFromGraph(HGraph* graph); |
| 265 }; | 274 }; |
| 266 | 275 |
| 267 | 276 |
| 268 // Helper interface to prepare to/restore after making runtime calls. | 277 // Helper interface to prepare to/restore after making runtime calls. |
| 269 class RuntimeCallHelper { | 278 class RuntimeCallHelper { |
| 270 public: | 279 public: |
| 271 virtual ~RuntimeCallHelper() {} | 280 virtual ~RuntimeCallHelper() {} |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1077 bool is_js_array() const { | 1086 bool is_js_array() const { |
| 1078 return IsJSArrayBits::decode(bit_field_); | 1087 return IsJSArrayBits::decode(bit_field_); |
| 1079 } | 1088 } |
| 1080 | 1089 |
| 1081 ElementsKind elements_kind() const { | 1090 ElementsKind elements_kind() const { |
| 1082 return ElementsKindBits::decode(bit_field_); | 1091 return ElementsKindBits::decode(bit_field_); |
| 1083 } | 1092 } |
| 1084 | 1093 |
| 1085 virtual Handle<Code> GenerateCode(); | 1094 virtual Handle<Code> GenerateCode(); |
| 1086 | 1095 |
| 1087 virtual CodeStubInterfaceDescriptor* GetInterfaceDescriptor( | 1096 virtual void InitializeInterfaceDescriptor( |
| 1088 Isolate* isolate); | 1097 Isolate* isolate, |
| 1098 CodeStubInterfaceDescriptor* descriptor); | |
| 1089 | 1099 |
| 1090 private: | 1100 private: |
| 1091 class IsJSArrayBits: public BitField<bool, 8, 1> {}; | 1101 class IsJSArrayBits: public BitField<bool, 8, 1> {}; |
| 1092 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; | 1102 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; |
| 1093 uint32_t bit_field_; | 1103 uint32_t bit_field_; |
| 1094 | 1104 |
| 1095 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); | 1105 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); |
| 1096 }; | 1106 }; |
| 1097 | 1107 |
| 1098 | 1108 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1289 | 1299 |
| 1290 // The current function entry hook. | 1300 // The current function entry hook. |
| 1291 static FunctionEntryHook entry_hook_; | 1301 static FunctionEntryHook entry_hook_; |
| 1292 | 1302 |
| 1293 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); | 1303 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); |
| 1294 }; | 1304 }; |
| 1295 | 1305 |
| 1296 } } // namespace v8::internal | 1306 } } // namespace v8::internal |
| 1297 | 1307 |
| 1298 #endif // V8_CODE_STUBS_H_ | 1308 #endif // V8_CODE_STUBS_H_ |
| OLD | NEW |