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

Side by Side Diff: src/ia32/virtual-frame-ia32.h

Issue 660095: Merge revision 3813 to 3930 from bleeding_edge to partial snapshots branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: '' Created 10 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/ia32/stub-cache-ia32.cc ('k') | src/ia32/virtual-frame-ia32.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 10 matching lines...) Expand all
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_IA32_VIRTUAL_FRAME_IA32_H_ 28 #ifndef V8_IA32_VIRTUAL_FRAME_IA32_H_
29 #define V8_IA32_VIRTUAL_FRAME_IA32_H_ 29 #define V8_IA32_VIRTUAL_FRAME_IA32_H_
30 30
31 #include "number-info.h"
31 #include "register-allocator.h" 32 #include "register-allocator.h"
32 #include "scopes.h" 33 #include "scopes.h"
33 34
34 namespace v8 { 35 namespace v8 {
35 namespace internal { 36 namespace internal {
36 37
37 // ------------------------------------------------------------------------- 38 // -------------------------------------------------------------------------
38 // Virtual frames 39 // Virtual frames
39 // 40 //
40 // The virtual frame is an abstraction of the physical stack frame. It 41 // The virtual frame is an abstraction of the physical stack frame. It
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 VirtualFrame(); 76 VirtualFrame();
76 77
77 // Construct a virtual frame as a clone of an existing one. 78 // Construct a virtual frame as a clone of an existing one.
78 explicit VirtualFrame(VirtualFrame* original); 79 explicit VirtualFrame(VirtualFrame* original);
79 80
80 CodeGenerator* cgen() { return CodeGeneratorScope::Current(); } 81 CodeGenerator* cgen() { return CodeGeneratorScope::Current(); }
81 82
82 MacroAssembler* masm() { return cgen()->masm(); } 83 MacroAssembler* masm() { return cgen()->masm(); }
83 84
84 // Create a duplicate of an existing valid frame element. 85 // Create a duplicate of an existing valid frame element.
85 FrameElement CopyElementAt(int index); 86 FrameElement CopyElementAt(int index,
87 NumberInfo::Type info = NumberInfo::kUninitialized);
86 88
87 // The number of elements on the virtual frame. 89 // The number of elements on the virtual frame.
88 int element_count() { return elements_.length(); } 90 int element_count() { return elements_.length(); }
89 91
90 // The height of the virtual expression stack. 92 // The height of the virtual expression stack.
91 int height() { return element_count() - expression_base_index(); } 93 int height() { return element_count() - expression_base_index(); }
92 94
93 int register_location(int num) { 95 int register_location(int num) {
94 ASSERT(num >= 0 && num < RegisterAllocator::kNumRegisters); 96 ASSERT(num >= 0 && num < RegisterAllocator::kNumRegisters);
95 return register_locations_[num]; 97 return register_locations_[num];
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 // eax (arg1). The arguments are given as results which do not have 319 // eax (arg1). The arguments are given as results which do not have
318 // to be in the proper registers or even in registers. The 320 // to be in the proper registers or even in registers. The
319 // arguments are consumed by the call. 321 // arguments are consumed by the call.
320 Result CallStub(CodeStub* stub, Result* arg0, Result* arg1); 322 Result CallStub(CodeStub* stub, Result* arg0, Result* arg1);
321 323
322 // Call runtime given the number of arguments expected on (and 324 // Call runtime given the number of arguments expected on (and
323 // removed from) the stack. 325 // removed from) the stack.
324 Result CallRuntime(Runtime::Function* f, int arg_count); 326 Result CallRuntime(Runtime::Function* f, int arg_count);
325 Result CallRuntime(Runtime::FunctionId id, int arg_count); 327 Result CallRuntime(Runtime::FunctionId id, int arg_count);
326 328
329 #ifdef ENABLE_DEBUGGER_SUPPORT
330 void DebugBreak();
331 #endif
332
327 // Invoke builtin given the number of arguments it expects on (and 333 // Invoke builtin given the number of arguments it expects on (and
328 // removes from) the stack. 334 // removes from) the stack.
329 Result InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, int arg_count); 335 Result InvokeBuiltin(Builtins::JavaScript id, InvokeFlag flag, int arg_count);
330 336
331 // Call load IC. Name and receiver are found on top of the frame. 337 // Call load IC. Name and receiver are found on top of the frame.
332 // Receiver is not dropped. 338 // Both are dropped.
333 Result CallLoadIC(RelocInfo::Mode mode); 339 Result CallLoadIC(RelocInfo::Mode mode);
334 340
335 // Call keyed load IC. Key and receiver are found on top of the 341 // Call keyed load IC. Key and receiver are found on top of the
336 // frame. They are not dropped. 342 // frame. Both are dropped.
337 Result CallKeyedLoadIC(RelocInfo::Mode mode); 343 Result CallKeyedLoadIC(RelocInfo::Mode mode);
338 344
339 // Call store IC. Name, value, and receiver are found on top of the 345 // Call store IC. If the load is contextual, value is found on top of the
340 // frame. Receiver is not dropped. 346 // frame. If not, value and receiver are on the frame. Both are dropped.
341 Result CallStoreIC(); 347 Result CallStoreIC(Handle<String> name, bool is_contextual);
342 348
343 // Call keyed store IC. Value, key, and receiver are found on top 349 // Call keyed store IC. Value, key, and receiver are found on top
344 // of the frame. Key and receiver are not dropped. 350 // of the frame. Key and receiver are not dropped.
345 Result CallKeyedStoreIC(); 351 Result CallKeyedStoreIC();
346 352
347 // Call call IC. Function name, arguments, and receiver are found on top 353 // Call call IC. Function name, arguments, and receiver are found on top
348 // of the frame and dropped by the call. The argument count does not 354 // of the frame and dropped by the call. The argument count does not
349 // include the receiver. 355 // include the receiver.
350 Result CallCallIC(RelocInfo::Mode mode, int arg_count, int loop_nesting); 356 Result CallCallIC(RelocInfo::Mode mode, int arg_count, int loop_nesting);
351 357
(...skipping 22 matching lines...) Expand all
374 // Result, which may be a constant or a register. 380 // Result, which may be a constant or a register.
375 Result Pop(); 381 Result Pop();
376 382
377 // Pop and save an element from the top of the expression stack and 383 // Pop and save an element from the top of the expression stack and
378 // emit a corresponding pop instruction. 384 // emit a corresponding pop instruction.
379 void EmitPop(Register reg); 385 void EmitPop(Register reg);
380 void EmitPop(Operand operand); 386 void EmitPop(Operand operand);
381 387
382 // Push an element on top of the expression stack and emit a 388 // Push an element on top of the expression stack and emit a
383 // corresponding push instruction. 389 // corresponding push instruction.
384 void EmitPush(Register reg); 390 void EmitPush(Register reg,
385 void EmitPush(Operand operand); 391 NumberInfo::Type info = NumberInfo::kUnknown);
386 void EmitPush(Immediate immediate); 392 void EmitPush(Operand operand,
393 NumberInfo::Type info = NumberInfo::kUnknown);
394 void EmitPush(Immediate immediate,
395 NumberInfo::Type info = NumberInfo::kUnknown);
387 396
388 // Push an element on the virtual frame. 397 // Push an element on the virtual frame.
389 void Push(Register reg); 398 void Push(Register reg, NumberInfo::Type info = NumberInfo::kUnknown);
390 void Push(Handle<Object> value); 399 void Push(Handle<Object> value);
391 void Push(Smi* value) { 400 void Push(Smi* value) {
392 Push(Handle<Object> (value)); 401 Push(Handle<Object> (value));
393 } 402 }
394 403
395 // Pushing a result invalidates it (its contents become owned by the 404 // Pushing a result invalidates it (its contents become owned by the
396 // frame). 405 // frame).
397 void Push(Result* result) { 406 void Push(Result* result) {
398 // This assert will trigger if you try to push the same value twice. 407 // This assert will trigger if you try to push the same value twice.
399 ASSERT(result->is_valid()); 408 ASSERT(result->is_valid());
400 if (result->is_register()) { 409 if (result->is_register()) {
401 Push(result->reg()); 410 Push(result->reg(), result->number_info());
402 } else { 411 } else {
403 ASSERT(result->is_constant()); 412 ASSERT(result->is_constant());
404 Push(result->handle()); 413 Push(result->handle());
405 } 414 }
406 result->Unuse(); 415 result->Unuse();
407 } 416 }
408 417
418 // Pushing an expression expects that the expression is trivial (according
419 // to Expression::IsTrivial).
420 void Push(Expression* expr);
421
409 // Nip removes zero or more elements from immediately below the top 422 // Nip removes zero or more elements from immediately below the top
410 // of the frame, leaving the previous top-of-frame value on top of 423 // of the frame, leaving the previous top-of-frame value on top of
411 // the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x). 424 // the frame. Nip(k) is equivalent to x = Pop(), Drop(k), Push(x).
412 void Nip(int num_dropped); 425 void Nip(int num_dropped);
413 426
414 private: 427 private:
415 static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset; 428 static const int kLocal0Offset = JavaScriptFrameConstants::kLocal0Offset;
416 static const int kFunctionOffset = JavaScriptFrameConstants::kFunctionOffset; 429 static const int kFunctionOffset = JavaScriptFrameConstants::kFunctionOffset;
417 static const int kContextOffset = StandardFrameConstants::kContextOffset; 430 static const int kContextOffset = StandardFrameConstants::kContextOffset;
418 431
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 bool Equals(VirtualFrame* other); 584 bool Equals(VirtualFrame* other);
572 585
573 // Classes that need raw access to the elements_ array. 586 // Classes that need raw access to the elements_ array.
574 friend class DeferredCode; 587 friend class DeferredCode;
575 friend class JumpTarget; 588 friend class JumpTarget;
576 }; 589 };
577 590
578 } } // namespace v8::internal 591 } } // namespace v8::internal
579 592
580 #endif // V8_IA32_VIRTUAL_FRAME_IA32_H_ 593 #endif // V8_IA32_VIRTUAL_FRAME_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/ia32/virtual-frame-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698