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

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

Issue 6597029: [Isolates] Merge r 6300:6500 from bleeding_edge to isolates. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: Created 9 years, 10 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/builtins-arm.cc ('k') | src/arm/code-stubs-arm.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } else { 211 } else {
212 PrintF("GenericBinaryOpStub (%s by %d)\n", 212 PrintF("GenericBinaryOpStub (%s by %d)\n",
213 Token::String(op_), 213 Token::String(op_),
214 constant_rhs_); 214 constant_rhs_);
215 } 215 }
216 } 216 }
217 #endif 217 #endif
218 }; 218 };
219 219
220 220
221 class TypeRecordingBinaryOpStub: public CodeStub {
222 public:
223 TypeRecordingBinaryOpStub(Token::Value op, OverwriteMode mode)
224 : op_(op),
225 mode_(mode),
226 operands_type_(TRBinaryOpIC::UNINITIALIZED),
227 result_type_(TRBinaryOpIC::UNINITIALIZED),
228 name_(NULL) {
229 use_vfp3_ = Isolate::Current()->cpu_features()->IsSupported(VFP3);
230 ASSERT(OpBits::is_valid(Token::NUM_TOKENS));
231 }
232
233 TypeRecordingBinaryOpStub(
234 int key,
235 TRBinaryOpIC::TypeInfo operands_type,
236 TRBinaryOpIC::TypeInfo result_type = TRBinaryOpIC::UNINITIALIZED)
237 : op_(OpBits::decode(key)),
238 mode_(ModeBits::decode(key)),
239 use_vfp3_(VFP3Bits::decode(key)),
240 operands_type_(operands_type),
241 result_type_(result_type),
242 name_(NULL) { }
243
244 private:
245 enum SmiCodeGenerateHeapNumberResults {
246 ALLOW_HEAPNUMBER_RESULTS,
247 NO_HEAPNUMBER_RESULTS
248 };
249
250 Token::Value op_;
251 OverwriteMode mode_;
252 bool use_vfp3_;
253
254 // Operand type information determined at runtime.
255 TRBinaryOpIC::TypeInfo operands_type_;
256 TRBinaryOpIC::TypeInfo result_type_;
257
258 char* name_;
259
260 const char* GetName();
261
262 #ifdef DEBUG
263 void Print() {
264 PrintF("TypeRecordingBinaryOpStub %d (op %s), "
265 "(mode %d, runtime_type_info %s)\n",
266 MinorKey(),
267 Token::String(op_),
268 static_cast<int>(mode_),
269 TRBinaryOpIC::GetName(operands_type_));
270 }
271 #endif
272
273 // Minor key encoding in 16 bits RRRTTTVOOOOOOOMM.
274 class ModeBits: public BitField<OverwriteMode, 0, 2> {};
275 class OpBits: public BitField<Token::Value, 2, 7> {};
276 class VFP3Bits: public BitField<bool, 9, 1> {};
277 class OperandTypeInfoBits: public BitField<TRBinaryOpIC::TypeInfo, 10, 3> {};
278 class ResultTypeInfoBits: public BitField<TRBinaryOpIC::TypeInfo, 13, 3> {};
279
280 Major MajorKey() { return TypeRecordingBinaryOp; }
281 int MinorKey() {
282 return OpBits::encode(op_)
283 | ModeBits::encode(mode_)
284 | VFP3Bits::encode(use_vfp3_)
285 | OperandTypeInfoBits::encode(operands_type_)
286 | ResultTypeInfoBits::encode(result_type_);
287 }
288
289 void Generate(MacroAssembler* masm);
290 void GenerateGeneric(MacroAssembler* masm);
291 void GenerateOptimisticSmiOperation(MacroAssembler* masm);
292 void GenerateVFPOperation(MacroAssembler* masm);
293 void GenerateSmiCode(MacroAssembler* masm,
294 Label* gc_required,
295 SmiCodeGenerateHeapNumberResults heapnumber_results);
296 void GenerateLoadArguments(MacroAssembler* masm);
297 void GenerateReturn(MacroAssembler* masm);
298 void GenerateUninitializedStub(MacroAssembler* masm);
299 void GenerateSmiStub(MacroAssembler* masm);
300 void GenerateInt32Stub(MacroAssembler* masm);
301 void GenerateHeapNumberStub(MacroAssembler* masm);
302 void GenerateStringStub(MacroAssembler* masm);
303 void GenerateGenericStub(MacroAssembler* masm);
304 void GenerateAddStrings(MacroAssembler* masm);
305 void GenerateCallRuntime(MacroAssembler* masm);
306
307 void GenerateHeapResultAllocation(MacroAssembler* masm,
308 Register result,
309 Register heap_number_map,
310 Register scratch1,
311 Register scratch2,
312 Label* gc_required);
313 void GenerateRegisterArgsPush(MacroAssembler* masm);
314 void GenerateTypeTransition(MacroAssembler* masm);
315 void GenerateTypeTransitionWithSavedArgs(MacroAssembler* masm);
316
317 virtual int GetCodeKind() { return Code::TYPE_RECORDING_BINARY_OP_IC; }
318
319 virtual InlineCacheState GetICState() {
320 return TRBinaryOpIC::ToState(operands_type_);
321 }
322
323 virtual void FinishCode(Code* code) {
324 code->set_type_recording_binary_op_type(operands_type_);
325 code->set_type_recording_binary_op_result_type(result_type_);
326 }
327
328 friend class CodeGenerator;
329 };
330
331
221 // Flag that indicates how to generate code for the stub StringAddStub. 332 // Flag that indicates how to generate code for the stub StringAddStub.
222 enum StringAddFlags { 333 enum StringAddFlags {
223 NO_STRING_ADD_FLAGS = 0, 334 NO_STRING_ADD_FLAGS = 0,
224 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. 335 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub.
225 }; 336 };
226 337
227 338
228 class StringAddStub: public CodeStub { 339 class StringAddStub: public CodeStub {
229 public: 340 public:
230 explicit StringAddStub(StringAddFlags flags) { 341 explicit StringAddStub(StringAddFlags flags) {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 private: 564 private:
454 Major MajorKey() { return RegExpCEntry; } 565 Major MajorKey() { return RegExpCEntry; }
455 int MinorKey() { return 0; } 566 int MinorKey() { return 0; }
456 const char* GetName() { return "RegExpCEntryStub"; } 567 const char* GetName() { return "RegExpCEntryStub"; }
457 }; 568 };
458 569
459 570
460 } } // namespace v8::internal 571 } } // namespace v8::internal
461 572
462 #endif // V8_ARM_CODE_STUBS_ARM_H_ 573 #endif // V8_ARM_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « src/arm/builtins-arm.cc ('k') | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698