OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca> | 3 * Copyright (C) 2008 Cameron Zwarich <cwzwarich@uwaterloo.ca> |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 RegisterID* emitGetById(RegisterID* dst, RegisterID* base, const Identif
ier& property); | 266 RegisterID* emitGetById(RegisterID* dst, RegisterID* base, const Identif
ier& property); |
267 RegisterID* emitPutById(RegisterID* base, const Identifier& property, Re
gisterID* value); | 267 RegisterID* emitPutById(RegisterID* base, const Identifier& property, Re
gisterID* value); |
268 RegisterID* emitDeleteById(RegisterID* dst, RegisterID* base, const Iden
tifier&); | 268 RegisterID* emitDeleteById(RegisterID* dst, RegisterID* base, const Iden
tifier&); |
269 RegisterID* emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID*
property); | 269 RegisterID* emitGetByVal(RegisterID* dst, RegisterID* base, RegisterID*
property); |
270 RegisterID* emitPutByVal(RegisterID* base, RegisterID* property, Registe
rID* value); | 270 RegisterID* emitPutByVal(RegisterID* base, RegisterID* property, Registe
rID* value); |
271 RegisterID* emitDeleteByVal(RegisterID* dst, RegisterID* base, RegisterI
D* property); | 271 RegisterID* emitDeleteByVal(RegisterID* dst, RegisterID* base, RegisterI
D* property); |
272 RegisterID* emitPutByIndex(RegisterID* base, unsigned index, RegisterID*
value); | 272 RegisterID* emitPutByIndex(RegisterID* base, unsigned index, RegisterID*
value); |
273 RegisterID* emitPutGetter(RegisterID* base, const Identifier& property,
RegisterID* value); | 273 RegisterID* emitPutGetter(RegisterID* base, const Identifier& property,
RegisterID* value); |
274 RegisterID* emitPutSetter(RegisterID* base, const Identifier& property,
RegisterID* value); | 274 RegisterID* emitPutSetter(RegisterID* base, const Identifier& property,
RegisterID* value); |
275 | 275 |
276 RegisterID* emitCall(RegisterID* dst, RegisterID* func, RegisterID* base
, ArgumentsNode*, unsigned divot, unsigned startOffset, unsigned endOffset); | 276 RegisterID* emitCall(RegisterID* dst, RegisterID* func, RegisterID* this
Register, ArgumentsNode*, unsigned divot, unsigned startOffset, unsigned endOffs
et); |
277 RegisterID* emitCallEval(RegisterID* dst, RegisterID* func, RegisterID*
base, ArgumentsNode*, unsigned divot, unsigned startOffset, unsigned endOffset); | 277 RegisterID* emitCallEval(RegisterID* dst, RegisterID* func, RegisterID*
thisRegister, ArgumentsNode*, unsigned divot, unsigned startOffset, unsigned end
Offset); |
278 | 278 |
279 RegisterID* emitReturn(RegisterID* src); | 279 RegisterID* emitReturn(RegisterID* src); |
280 RegisterID* emitEnd(RegisterID* src) { return emitUnaryNoDstOp(op_end, s
rc); } | 280 RegisterID* emitEnd(RegisterID* src) { return emitUnaryNoDstOp(op_end, s
rc); } |
281 | 281 |
282 RegisterID* emitConstruct(RegisterID* dst, RegisterID* func, ArgumentsNo
de*, unsigned divot, unsigned startOffset, unsigned endOffset); | 282 RegisterID* emitConstruct(RegisterID* dst, RegisterID* func, ArgumentsNo
de*, unsigned divot, unsigned startOffset, unsigned endOffset); |
283 | 283 |
284 PassRefPtr<LabelID> emitLabel(LabelID*); | 284 PassRefPtr<LabelID> emitLabel(LabelID*); |
285 PassRefPtr<LabelID> emitJump(LabelID* target); | 285 PassRefPtr<LabelID> emitJump(LabelID* target); |
286 PassRefPtr<LabelID> emitJumpIfTrue(RegisterID* cond, LabelID* target); | 286 PassRefPtr<LabelID> emitJumpIfTrue(RegisterID* cond, LabelID* target); |
287 PassRefPtr<LabelID> emitJumpIfFalse(RegisterID* cond, LabelID* target); | 287 PassRefPtr<LabelID> emitJumpIfFalse(RegisterID* cond, LabelID* target); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 static int emptyValue() { return std::numeric_limits<int>::max(); } | 338 static int emptyValue() { return std::numeric_limits<int>::max(); } |
339 static const bool emptyValueIsZero = false; | 339 static const bool emptyValueIsZero = false; |
340 static const bool needsDestruction = false; | 340 static const bool needsDestruction = false; |
341 static const bool needsRef = false; | 341 static const bool needsRef = false; |
342 }; | 342 }; |
343 | 343 |
344 typedef HashMap<RefPtr<UString::Rep>, int, IdentifierRepHash, HashTraits
<RefPtr<UString::Rep> >, IdentifierMapIndexHashTraits> IdentifierMap; | 344 typedef HashMap<RefPtr<UString::Rep>, int, IdentifierRepHash, HashTraits
<RefPtr<UString::Rep> >, IdentifierMapIndexHashTraits> IdentifierMap; |
345 typedef HashMap<double, JSValue*> NumberMap; | 345 typedef HashMap<double, JSValue*> NumberMap; |
346 typedef HashMap<UString::Rep*, JSString*, IdentifierRepHash> IdentifierS
tringMap; | 346 typedef HashMap<UString::Rep*, JSString*, IdentifierRepHash> IdentifierS
tringMap; |
347 | 347 |
348 RegisterID* emitCall(OpcodeID, RegisterID*, RegisterID*, RegisterID*, Ar
gumentsNode*, unsigned divot, unsigned startOffset, unsigned endOffset); | 348 RegisterID* emitCall(OpcodeID, RegisterID* dst, RegisterID* func, Regist
erID* thisRegister, ArgumentsNode*, unsigned divot, unsigned startOffset, unsign
ed endOffset); |
349 | 349 |
350 RegisterID* newRegister(); | 350 RegisterID* newRegister(); |
351 | 351 |
352 // Returns the RegisterID corresponding to ident. | 352 // Returns the RegisterID corresponding to ident. |
353 RegisterID* addVar(const Identifier& ident, bool isConstant) | 353 RegisterID* addVar(const Identifier& ident, bool isConstant) |
354 { | 354 { |
355 RegisterID* local; | 355 RegisterID* local; |
356 addVar(ident, isConstant, local); | 356 addVar(ident, isConstant, local); |
357 return local; | 357 return local; |
358 } | 358 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 #endif | 453 #endif |
454 | 454 |
455 unsigned m_emitNodeDepth; | 455 unsigned m_emitNodeDepth; |
456 | 456 |
457 static const unsigned s_maxEmitNodeDepth = 10000; | 457 static const unsigned s_maxEmitNodeDepth = 10000; |
458 }; | 458 }; |
459 | 459 |
460 } | 460 } |
461 | 461 |
462 #endif // CodeGenerator_h | 462 #endif // CodeGenerator_h |
OLD | NEW |