OLD | NEW |
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 kAccumulator, | 236 kAccumulator, |
237 kStack | 237 kStack |
238 }; | 238 }; |
239 | 239 |
240 enum ConstantOperand { | 240 enum ConstantOperand { |
241 kNoConstants, | 241 kNoConstants, |
242 kLeftConstant, | 242 kLeftConstant, |
243 kRightConstant | 243 kRightConstant |
244 }; | 244 }; |
245 | 245 |
| 246 // Type of a member function that generates inline code for a native function. |
| 247 typedef void (FullCodeGenerator::*InlineFunctionGenerator) |
| 248 (ZoneList<Expression*>*); |
| 249 |
| 250 static const InlineFunctionGenerator kInlineFunctionGenerators[]; |
| 251 |
246 // Compute the frame pointer relative offset for a given local or | 252 // Compute the frame pointer relative offset for a given local or |
247 // parameter slot. | 253 // parameter slot. |
248 int SlotOffset(Slot* slot); | 254 int SlotOffset(Slot* slot); |
249 | 255 |
250 // Determine whether or not to inline the smi case for the given | 256 // Determine whether or not to inline the smi case for the given |
251 // operation. | 257 // operation. |
252 bool ShouldInlineSmiCase(Token::Value op); | 258 bool ShouldInlineSmiCase(Token::Value op); |
253 | 259 |
254 // Compute which (if any) of the operands is a compile-time constant. | 260 // Compute which (if any) of the operands is a compile-time constant. |
255 ConstantOperand GetConstantOperand(Token::Value op, | 261 ConstantOperand GetConstantOperand(Token::Value op, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 372 |
367 // Platform-specific return sequence | 373 // Platform-specific return sequence |
368 void EmitReturnSequence(); | 374 void EmitReturnSequence(); |
369 | 375 |
370 // Platform-specific code sequences for calls | 376 // Platform-specific code sequences for calls |
371 void EmitCallWithStub(Call* expr); | 377 void EmitCallWithStub(Call* expr); |
372 void EmitCallWithIC(Call* expr, Handle<Object> name, RelocInfo::Mode mode); | 378 void EmitCallWithIC(Call* expr, Handle<Object> name, RelocInfo::Mode mode); |
373 void EmitKeyedCallWithIC(Call* expr, Expression* key, RelocInfo::Mode mode); | 379 void EmitKeyedCallWithIC(Call* expr, Expression* key, RelocInfo::Mode mode); |
374 | 380 |
375 // Platform-specific code for inline runtime calls. | 381 // Platform-specific code for inline runtime calls. |
| 382 InlineFunctionGenerator FindInlineFunctionGenerator(Runtime::FunctionId id); |
| 383 |
376 void EmitInlineRuntimeCall(CallRuntime* expr); | 384 void EmitInlineRuntimeCall(CallRuntime* expr); |
377 | 385 |
378 #define EMIT_INLINE_RUNTIME_CALL(name, x, y) \ | 386 #define EMIT_INLINE_RUNTIME_CALL(name, x, y) \ |
379 void Emit##name(ZoneList<Expression*>* arguments); | 387 void Emit##name(ZoneList<Expression*>* arguments); |
| 388 INLINE_FUNCTION_LIST(EMIT_INLINE_RUNTIME_CALL) |
380 INLINE_RUNTIME_FUNCTION_LIST(EMIT_INLINE_RUNTIME_CALL) | 389 INLINE_RUNTIME_FUNCTION_LIST(EMIT_INLINE_RUNTIME_CALL) |
381 #undef EMIT_INLINE_RUNTIME_CALL | 390 #undef EMIT_INLINE_RUNTIME_CALL |
382 | 391 |
383 // Platform-specific code for loading variables. | 392 // Platform-specific code for loading variables. |
384 void EmitLoadGlobalSlotCheckExtensions(Slot* slot, | 393 void EmitLoadGlobalSlotCheckExtensions(Slot* slot, |
385 TypeofState typeof_state, | 394 TypeofState typeof_state, |
386 Label* slow); | 395 Label* slow); |
387 MemOperand ContextSlotOperandCheckExtensions(Slot* slot, Label* slow); | 396 MemOperand ContextSlotOperandCheckExtensions(Slot* slot, Label* slow); |
388 void EmitDynamicLoadFromSlotFastCase(Slot* slot, | 397 void EmitDynamicLoadFromSlotFastCase(Slot* slot, |
389 TypeofState typeof_state, | 398 TypeofState typeof_state, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 | 550 |
542 friend class NestedStatement; | 551 friend class NestedStatement; |
543 | 552 |
544 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); | 553 DISALLOW_COPY_AND_ASSIGN(FullCodeGenerator); |
545 }; | 554 }; |
546 | 555 |
547 | 556 |
548 } } // namespace v8::internal | 557 } } // namespace v8::internal |
549 | 558 |
550 #endif // V8_FULL_CODEGEN_H_ | 559 #endif // V8_FULL_CODEGEN_H_ |
OLD | NEW |