OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 26 matching lines...) Expand all Loading... |
37 #include "parser.h" | 37 #include "parser.h" |
38 #include "scopes.h" | 38 #include "scopes.h" |
39 #include "stub-cache.h" | 39 #include "stub-cache.h" |
40 | 40 |
41 namespace v8 { | 41 namespace v8 { |
42 namespace internal { | 42 namespace internal { |
43 | 43 |
44 #define __ ACCESS_MASM(masm_) | 44 #define __ ACCESS_MASM(masm_) |
45 | 45 |
46 | 46 |
47 static unsigned GetPropertyId(Property* property) { | |
48 return property->id(); | |
49 } | |
50 | |
51 | |
52 class JumpPatchSite BASE_EMBEDDED { | 47 class JumpPatchSite BASE_EMBEDDED { |
53 public: | 48 public: |
54 explicit JumpPatchSite(MacroAssembler* masm) : masm_(masm) { | 49 explicit JumpPatchSite(MacroAssembler* masm) : masm_(masm) { |
55 #ifdef DEBUG | 50 #ifdef DEBUG |
56 info_emitted_ = false; | 51 info_emitted_ = false; |
57 #endif | 52 #endif |
58 } | 53 } |
59 | 54 |
60 ~JumpPatchSite() { | 55 ~JumpPatchSite() { |
61 ASSERT(patch_site_.is_bound() == info_emitted_); | 56 ASSERT(patch_site_.is_bound() == info_emitted_); |
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1681 break; | 1676 break; |
1682 } | 1677 } |
1683 } | 1678 } |
1684 | 1679 |
1685 | 1680 |
1686 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { | 1681 void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) { |
1687 SetSourcePosition(prop->position()); | 1682 SetSourcePosition(prop->position()); |
1688 Literal* key = prop->key()->AsLiteral(); | 1683 Literal* key = prop->key()->AsLiteral(); |
1689 __ Move(rcx, key->handle()); | 1684 __ Move(rcx, key->handle()); |
1690 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); | 1685 Handle<Code> ic = isolate()->builtins()->LoadIC_Initialize(); |
1691 __ call(ic, RelocInfo::CODE_TARGET, GetPropertyId(prop)); | 1686 __ call(ic, RelocInfo::CODE_TARGET, prop->id()); |
1692 } | 1687 } |
1693 | 1688 |
1694 | 1689 |
1695 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { | 1690 void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) { |
1696 SetSourcePosition(prop->position()); | 1691 SetSourcePosition(prop->position()); |
1697 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 1692 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
1698 __ call(ic, RelocInfo::CODE_TARGET, GetPropertyId(prop)); | 1693 __ call(ic, RelocInfo::CODE_TARGET, prop->id()); |
1699 } | 1694 } |
1700 | 1695 |
1701 | 1696 |
1702 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, | 1697 void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, |
1703 Token::Value op, | 1698 Token::Value op, |
1704 OverwriteMode mode, | 1699 OverwriteMode mode, |
1705 Expression* left, | 1700 Expression* left, |
1706 Expression* right) { | 1701 Expression* right) { |
1707 // Do combined smi check of the operands. Left operand is on the | 1702 // Do combined smi check of the operands. Left operand is on the |
1708 // stack (popped into rdx). Right operand is in rax but moved into | 1703 // stack (popped into rdx). Right operand is in rax but moved into |
(...skipping 2545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4254 *context_length = 0; | 4249 *context_length = 0; |
4255 return previous_; | 4250 return previous_; |
4256 } | 4251 } |
4257 | 4252 |
4258 | 4253 |
4259 #undef __ | 4254 #undef __ |
4260 | 4255 |
4261 } } // namespace v8::internal | 4256 } } // namespace v8::internal |
4262 | 4257 |
4263 #endif // V8_TARGET_ARCH_X64 | 4258 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |