OLD | NEW |
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return NULL; | 115 return NULL; |
116 } | 116 } |
117 | 117 |
118 | 118 |
119 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* a, String* b) { | 119 Object* StoreStubCompiler::CompileStoreInterceptor(JSObject* a, String* b) { |
120 UNIMPLEMENTED(); | 120 UNIMPLEMENTED(); |
121 return NULL; | 121 return NULL; |
122 } | 122 } |
123 | 123 |
124 | 124 |
125 Object* StubCompiler::CompileLazyCompile(Code::Flags a) { | 125 #define __ ACCESS_MASM(masm()) |
126 UNIMPLEMENTED(); | 126 |
127 return NULL; | 127 |
| 128 // TODO(1241006): Avoid having lazy compile stubs specialized by the |
| 129 // number of arguments. It is not needed anymore. |
| 130 Object* StubCompiler::CompileLazyCompile(Code::Flags flags) { |
| 131 // Enter an internal frame. |
| 132 __ EnterInternalFrame(); |
| 133 |
| 134 // Push a copy of the function onto the stack. |
| 135 __ push(rdi); |
| 136 |
| 137 __ push(rdi); // function is also the parameter to the runtime call |
| 138 __ CallRuntime(Runtime::kLazyCompile, 1); |
| 139 __ pop(rdi); |
| 140 |
| 141 // Tear down temporary frame. |
| 142 __ LeaveInternalFrame(); |
| 143 |
| 144 // Do a tail-call of the compiled function. |
| 145 __ lea(rcx, FieldOperand(rax, Code::kHeaderSize)); |
| 146 __ jmp(rcx); |
| 147 |
| 148 return GetCodeWithFlags(flags, "LazyCompileStub"); |
128 } | 149 } |
129 | 150 |
130 | 151 |
| 152 #undef __ |
| 153 |
| 154 |
131 } } // namespace v8::internal | 155 } } // namespace v8::internal |
OLD | NEW |