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

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

Issue 11441013: Fix isolate bug introduced by generated code stubs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years 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/lithium-arm.cc ('k') | src/code-stubs-hydrogen.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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 CodeStubInterfaceDescriptor()
246 Register* register_params; 246 : register_param_count_(-1),
247 Handle<Code> deoptimization_handler; 247 register_params_(NULL) { }
248 int register_param_count_;
249 Register* register_params_;
250 Handle<Code> deoptimization_handler_;
248 }; 251 };
249 252
250 253
251 class HGraph; 254 class HGraph;
252 struct Register; 255 struct Register;
253 class HydrogenCodeStub : public CodeStub { 256 class HydrogenCodeStub : public CodeStub {
254 public: 257 public:
255 // Retrieve the code for the stub. Generate the code if needed. 258 // Retrieve the code for the stub. Generate the code if needed.
256 virtual Handle<Code> GenerateCode() = 0; 259 virtual Handle<Code> GenerateCode() = 0;
257 260
258 virtual int GetCodeKind() { return Code::COMPILED_STUB; } 261 virtual int GetCodeKind() { return Code::COMPILED_STUB; }
259 262
260 virtual CodeStubInterfaceDescriptor* GetInterfaceDescriptor( 263 CodeStubInterfaceDescriptor* GetInterfaceDescriptor(Isolate* isolate) {
261 Isolate* isolate) = 0; 264 return isolate->code_stub_interface_descriptor(MajorKey());
265 }
266
267 virtual void InitializeInterfaceDescriptor(
268 Isolate* isolate,
269 CodeStubInterfaceDescriptor* descriptor) = 0;
262 270
263 protected: 271 protected:
264 Handle<Code> CodeFromGraph(HGraph* graph); 272 Handle<Code> CodeFromGraph(HGraph* graph);
265 }; 273 };
266 274
267 275
268 // Helper interface to prepare to/restore after making runtime calls. 276 // Helper interface to prepare to/restore after making runtime calls.
269 class RuntimeCallHelper { 277 class RuntimeCallHelper {
270 public: 278 public:
271 virtual ~RuntimeCallHelper() {} 279 virtual ~RuntimeCallHelper() {}
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 bool is_js_array() const { 1085 bool is_js_array() const {
1078 return IsJSArrayBits::decode(bit_field_); 1086 return IsJSArrayBits::decode(bit_field_);
1079 } 1087 }
1080 1088
1081 ElementsKind elements_kind() const { 1089 ElementsKind elements_kind() const {
1082 return ElementsKindBits::decode(bit_field_); 1090 return ElementsKindBits::decode(bit_field_);
1083 } 1091 }
1084 1092
1085 virtual Handle<Code> GenerateCode(); 1093 virtual Handle<Code> GenerateCode();
1086 1094
1087 virtual CodeStubInterfaceDescriptor* GetInterfaceDescriptor( 1095 virtual void InitializeInterfaceDescriptor(
1088 Isolate* isolate); 1096 Isolate* isolate,
1097 CodeStubInterfaceDescriptor* descriptor);
1089 1098
1090 private: 1099 private:
1091 class IsJSArrayBits: public BitField<bool, 8, 1> {}; 1100 class IsJSArrayBits: public BitField<bool, 8, 1> {};
1092 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {}; 1101 class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
1093 uint32_t bit_field_; 1102 uint32_t bit_field_;
1094 1103
1095 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub); 1104 DISALLOW_COPY_AND_ASSIGN(KeyedLoadFastElementStub);
1096 }; 1105 };
1097 1106
1098 1107
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 1298
1290 // The current function entry hook. 1299 // The current function entry hook.
1291 static FunctionEntryHook entry_hook_; 1300 static FunctionEntryHook entry_hook_;
1292 1301
1293 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub); 1302 DISALLOW_COPY_AND_ASSIGN(ProfileEntryHookStub);
1294 }; 1303 };
1295 1304
1296 } } // namespace v8::internal 1305 } } // namespace v8::internal
1297 1306
1298 #endif // V8_CODE_STUBS_H_ 1307 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698