~james-page/ubuntu/precise/nodejs/0.6.x-merge

« back to all changes in this revision

Viewing changes to deps/v8/src/ia32/lithium-codegen-ia32.h

  • Committer: James Page
  • Date: 2012-03-30 12:09:16 UTC
  • mfrom: (7.1.23 sid)
  • Revision ID: james.page@canonical.com-20120330120916-40hfu9o00qr5t87b
* Merge from Debian unstable:
  - New upstream release (LP: #892034).
  - This package is x86/arm only. Update control to match
  - d/patches/2009_increase_test_timeout.patch: Increased default test
    timeout from 60 to 120 seconds to support reliable execution of all
    tests on armhf/armel architectures.
  - d/patches/2005_expected_failing_tests.patch: 
    - Allow racey tests to fail: test-cluster-kill-workers,
      test-child-process-fork2 
    - Allow test-fs-watch to fail as LP buildd's don't support
      inotify.
    - Revert all other Ubuntu changes as no longer required.
* Update Standards-Version to 3.9.3.
* Patch wscript to enable build on mipsel arch, libv8 being available.
  Upstream does not support that arch, failure expected.
* test-cluster-kill-workers is expected to fail on armhf,
  Bug#660802 will be closed when test pass.
* test-buffer is expected to fail on armel,
  Bug#660800 will be closed when test pass.
* Add epoch to dependency on libev >= 1:4.11. Closes: bug#658441.
* Remove tools/doc because node-doc-generator has no license for now.
* Add copyright for doc/sh* files (shjs).
* source.lintian-overrides : source-contains-waf-binary tools/node-waf
  it is simply not the case here.
* test-stream-pipe-multi expected to timeout sometimes on busy builds. 
* New upstream release.
* Remove upstream patches.
* test-dgram-pingpong expected to timeout, the test itself is buggy.
* test-buffer expected to fail on armel, allow building package to make
  it easier to find the cause of the failure.
  Closes: bug#639636.
* Expect tests dgram-multicast and broadcast to fail.
  debian/patches/2005_expected_failing_tests.patch
* Drop dpkg-source local-options: Defaults since dpkg-source 1.16.1.
* New upstream release.
* Depend on libev-dev 4.11, see bug#657080.
* Bump dependency on openssl to 1.0.0g.
* Remove useless uv_loop_refcount from libuv,
  refreshed 2009_fix_shared_ev.patch.
* Apply to upstream patches landed after 0.6.10 release,
  to fix debugger repl and http client.
* New upstream release. Closes:bug#650661
* Repackage to remove non-dfsg font files ./deps/npm/html/*/*.ttf
* Remove unneeded bundled dependencies: lighter tarball,
  debian/copyright is easier to maintain.
* Drop unneeded build-dependency on scons.
* Depend on zlib1g, libc-ares, libev.
  Patches done to support building with those shared libs.
* Fix DEB_UPSTREAM_URL in debian/rules, and debian/watch.
* nodejs.pc file for pkgconfig is no more available.
* Build-depend on procps package, a test is using /bin/ps.
* Refreshed debian/patches/2005_expected_failing_tests.patch,
  only for tests that need networking.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
        deoptimizations_(4),
57
57
        deoptimization_literals_(8),
58
58
        inlined_function_count_(0),
59
 
        scope_(chunk->graph()->info()->scope()),
 
59
        scope_(info->scope()),
60
60
        status_(UNUSED),
61
61
        deferred_(8),
62
62
        osr_pc_offset_(-1),
63
 
        deoptimization_reloc_size(),
 
63
        last_lazy_deopt_pc_(0),
64
64
        resolver_(this),
65
65
        expected_safepoint_kind_(Safepoint::kSimple) {
66
66
    PopulateDeoptimizationLiteralsWithInlinedFunctions();
68
68
 
69
69
  // Simple accessors.
70
70
  MacroAssembler* masm() const { return masm_; }
 
71
  CompilationInfo* info() const { return info_; }
 
72
  Isolate* isolate() const { return info_->isolate(); }
 
73
  Factory* factory() const { return isolate()->factory(); }
 
74
  Heap* heap() const { return isolate()->heap(); }
71
75
 
72
76
  // Support for converting LOperands to assembler types.
73
77
  Operand ToOperand(LOperand* op) const;
93
97
  void DoDeferredNumberTagI(LNumberTagI* instr);
94
98
  void DoDeferredTaggedToI(LTaggedToI* instr);
95
99
  void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr);
96
 
  void DoDeferredStackCheck(LGoto* instr);
 
100
  void DoDeferredStackCheck(LStackCheck* instr);
97
101
  void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
98
 
  void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
99
 
                                        Label* map_check);
 
102
  void DoDeferredStringCharFromCode(LStringCharFromCode* instr);
 
103
  void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
 
104
                                       Label* map_check);
100
105
 
101
106
  // Parallel move support.
102
107
  void DoParallelMove(LParallelMove* move);
 
108
  void DoGap(LGap* instr);
103
109
 
104
110
  // Emit frame translation commands for an environment.
105
111
  void WriteTranslation(LEnvironment* environment, Translation* translation);
125
131
  bool is_aborted() const { return status_ == ABORTED; }
126
132
 
127
133
  int strict_mode_flag() const {
128
 
    return info_->is_strict() ? kStrictMode : kNonStrictMode;
 
134
    return info()->is_strict_mode() ? kStrictMode : kNonStrictMode;
129
135
  }
130
136
 
131
137
  LChunk* chunk() const { return chunk_; }
133
139
  HGraph* graph() const { return chunk_->graph(); }
134
140
 
135
141
  int GetNextEmittedBlock(int block);
136
 
  LInstruction* GetNextInstruction();
137
142
 
138
143
  void EmitClassOfTest(Label* if_true,
139
144
                       Label* if_false,
142
147
                       Register temporary,
143
148
                       Register temporary2);
144
149
 
145
 
  int StackSlotCount() const { return chunk()->spill_slot_count(); }
146
 
  int ParameterCount() const { return scope()->num_parameters(); }
 
150
  int GetStackSlotCount() const { return chunk()->spill_slot_count(); }
 
151
  int GetParameterCount() const { return scope()->num_parameters(); }
147
152
 
148
153
  void Abort(const char* format, ...);
149
154
  void Comment(const char* format, ...);
160
165
  bool GenerateRelocPadding();
161
166
  bool GenerateSafepointTable();
162
167
 
163
 
  enum ContextMode {
164
 
    RESTORE_CONTEXT,
165
 
    CONTEXT_ADJUSTED
166
 
  };
167
 
 
168
168
  enum SafepointMode {
169
169
    RECORD_SIMPLE_SAFEPOINT,
170
170
    RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS
172
172
 
173
173
  void CallCode(Handle<Code> code,
174
174
                RelocInfo::Mode mode,
175
 
                LInstruction* instr,
176
 
                ContextMode context_mode);
 
175
                LInstruction* instr);
177
176
 
178
177
  void CallCodeGeneric(Handle<Code> code,
179
178
                       RelocInfo::Mode mode,
180
179
                       LInstruction* instr,
181
 
                       ContextMode context_mode,
182
180
                       SafepointMode safepoint_mode);
183
181
 
184
 
  void CallRuntime(Runtime::Function* fun,
 
182
  void CallRuntime(const Runtime::Function* fun,
185
183
                   int argc,
186
 
                   LInstruction* instr,
187
 
                   ContextMode context_mode);
 
184
                   LInstruction* instr);
188
185
 
189
186
  void CallRuntime(Runtime::FunctionId id,
190
187
                   int argc,
191
 
                   LInstruction* instr,
192
 
                   ContextMode context_mode) {
193
 
    Runtime::Function* function = Runtime::FunctionForId(id);
194
 
    CallRuntime(function, argc, instr, context_mode);
 
188
                   LInstruction* instr) {
 
189
    const Runtime::Function* function = Runtime::FunctionForId(id);
 
190
    CallRuntime(function, argc, instr);
195
191
  }
196
192
 
197
193
  void CallRuntimeFromDeferred(Runtime::FunctionId id,
198
194
                               int argc,
199
 
                               LInstruction* instr);
 
195
                               LInstruction* instr,
 
196
                               LOperand* context);
200
197
 
201
198
  // Generate a direct call to a known function.  Expects the function
202
199
  // to be in edi.
203
200
  void CallKnownFunction(Handle<JSFunction> function,
204
201
                         int arity,
205
 
                         LInstruction* instr);
 
202
                         LInstruction* instr,
 
203
                         CallKind call_kind);
206
204
 
207
205
  void LoadHeapObject(Register result, Handle<HeapObject> object);
208
206
 
209
 
  void RegisterLazyDeoptimization(LInstruction* instr,
210
 
                                  SafepointMode safepoint_mode);
 
207
  void RecordSafepointWithLazyDeopt(LInstruction* instr,
 
208
                                    SafepointMode safepoint_mode);
211
209
 
212
 
  void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
 
210
  void RegisterEnvironmentForDeoptimization(LEnvironment* environment,
 
211
                                            Safepoint::DeoptMode mode);
213
212
  void DeoptimizeIf(Condition cc, LEnvironment* environment);
214
213
 
215
214
  void AddToTranslation(Translation* translation,
223
222
  Register ToRegister(int index) const;
224
223
  XMMRegister ToDoubleRegister(int index) const;
225
224
  int ToInteger32(LConstantOperand* op) const;
 
225
  Operand BuildFastArrayOperand(LOperand* elements_pointer,
 
226
                                LOperand* key,
 
227
                                ElementsKind elements_kind,
 
228
                                uint32_t offset);
226
229
 
227
230
  // Specific math operations - used from DoUnaryMathOperation.
228
231
  void EmitIntegerMathAbs(LUnaryMathOperation* instr);
239
242
  void RecordSafepoint(LPointerMap* pointers,
240
243
                       Safepoint::Kind kind,
241
244
                       int arguments,
242
 
                       int deoptimization_index);
243
 
  void RecordSafepoint(LPointerMap* pointers, int deoptimization_index);
244
 
  void RecordSafepoint(int deoptimization_index);
 
245
                       Safepoint::DeoptMode mode);
 
246
  void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode);
 
247
  void RecordSafepoint(Safepoint::DeoptMode mode);
245
248
  void RecordSafepointWithRegisters(LPointerMap* pointers,
246
249
                                    int arguments,
247
 
                                    int deoptimization_index);
 
250
                                    Safepoint::DeoptMode mode);
248
251
  void RecordPosition(int position);
249
252
 
250
253
  static Condition TokenToCondition(Token::Value op, bool is_unsigned);
251
 
  void EmitGoto(int block, LDeferredCode* deferred_stack_check = NULL);
 
254
  void EmitGoto(int block);
252
255
  void EmitBranch(int left_block, int right_block, Condition cc);
253
256
  void EmitCmpI(LOperand* left, LOperand* right);
254
 
  void EmitNumberUntagD(Register input, XMMRegister result, LEnvironment* env);
 
257
  void EmitNumberUntagD(Register input,
 
258
                        XMMRegister result,
 
259
                        bool deoptimize_on_undefined,
 
260
                        LEnvironment* env);
255
261
 
256
262
  // Emits optimized code for typeof x == "y".  Modifies input register.
257
263
  // Returns the condition on which a final split to
264
270
  // true and false label should be made, to optimize fallthrough.
265
271
  Condition EmitIsObject(Register input,
266
272
                         Register temp1,
267
 
                         Register temp2,
268
273
                         Label* is_not_object,
269
274
                         Label* is_object);
270
275
 
272
277
  // Caller should branch on equal condition.
273
278
  void EmitIsConstructCall(Register temp);
274
279
 
 
280
  void EmitLoadFieldOrConstantFunction(Register result,
 
281
                                       Register object,
 
282
                                       Handle<Map> type,
 
283
                                       Handle<String> name);
 
284
  void EnsureSpaceForLazyDeopt();
275
285
 
276
286
  LChunk* const chunk_;
277
287
  MacroAssembler* const masm_;
288
298
  TranslationBuffer translations_;
289
299
  ZoneList<LDeferredCode*> deferred_;
290
300
  int osr_pc_offset_;
291
 
 
292
 
  struct DeoptimizationRelocSize {
293
 
    int min_size;
294
 
    int last_pc_offset;
295
 
  };
296
 
 
297
 
  DeoptimizationRelocSize deoptimization_reloc_size;
 
301
  int last_lazy_deopt_pc_;
298
302
 
299
303
  // Builder that keeps track of safepoints in the code. The table
300
304
  // itself is emitted at the end of the generated code.