blob: fb8c5cd4a31e15082f5e92b3a9541bd5ab2d61f4 [file] [log] [blame]
Kristian Monsen0d5e1162010-09-30 15:31:59 +01001// Copyright 2010 the V8 project authors. All rights reserved.
Steve Blocka7e24c12009-10-30 11:49:00 +00002// Redistribution and use in source and binary forms, with or without
3// modification, are permitted provided that the following conditions are
4// met:
5//
6// * Redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer.
8// * Redistributions in binary form must reproduce the above
9// copyright notice, this list of conditions and the following
10// disclaimer in the documentation and/or other materials provided
11// with the distribution.
12// * Neither the name of Google Inc. nor the names of its
13// contributors may be used to endorse or promote products derived
14// from this software without specific prior written permission.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
27
28#include "v8.h"
29
30#include "bootstrapper.h"
31#include "codegen-inl.h"
Steve Blockd0582a62009-12-15 09:54:21 +000032#include "compiler.h"
Steve Blocka7e24c12009-10-30 11:49:00 +000033#include "debug.h"
34#include "oprofile-agent.h"
35#include "prettyprinter.h"
36#include "register-allocator-inl.h"
37#include "rewriter.h"
38#include "runtime.h"
39#include "scopeinfo.h"
40#include "stub-cache.h"
Steve Block6ded16b2010-05-10 14:33:55 +010041#include "virtual-frame-inl.h"
Steve Blocka7e24c12009-10-30 11:49:00 +000042
43namespace v8 {
44namespace internal {
45
Andrei Popescu31002712010-02-23 13:46:05 +000046#define __ ACCESS_MASM(masm_)
47
48#ifdef DEBUG
49
50Comment::Comment(MacroAssembler* masm, const char* msg)
51 : masm_(masm), msg_(msg) {
52 __ RecordComment(msg);
53}
54
55
56Comment::~Comment() {
57 if (msg_[0] == '[') __ RecordComment("]");
58}
59
60#endif // DEBUG
61
62#undef __
63
Steve Blocka7e24c12009-10-30 11:49:00 +000064
65CodeGenerator* CodeGeneratorScope::top_ = NULL;
66
67
Steve Blocka7e24c12009-10-30 11:49:00 +000068void CodeGenerator::ProcessDeferred() {
69 while (!deferred_.is_empty()) {
70 DeferredCode* code = deferred_.RemoveLast();
71 ASSERT(masm_ == code->masm());
72 // Record position of deferred code stub.
Teng-Hui Zhu3e5fa292010-11-09 16:16:48 -080073 masm_->positions_recorder()->RecordStatementPosition(
74 code->statement_position());
Steve Blocka7e24c12009-10-30 11:49:00 +000075 if (code->position() != RelocInfo::kNoPosition) {
Teng-Hui Zhu3e5fa292010-11-09 16:16:48 -080076 masm_->positions_recorder()->RecordPosition(code->position());
Steve Blocka7e24c12009-10-30 11:49:00 +000077 }
78 // Generate the code.
79 Comment cmnt(masm_, code->comment());
80 masm_->bind(code->entry_label());
Iain Merrick75681382010-08-19 15:07:18 +010081 if (code->AutoSaveAndRestore()) {
82 code->SaveRegisters();
83 }
Steve Blocka7e24c12009-10-30 11:49:00 +000084 code->Generate();
Iain Merrick75681382010-08-19 15:07:18 +010085 if (code->AutoSaveAndRestore()) {
86 code->RestoreRegisters();
87 code->Exit();
88 }
Steve Blocka7e24c12009-10-30 11:49:00 +000089 }
90}
91
92
Iain Merrick75681382010-08-19 15:07:18 +010093void DeferredCode::Exit() {
94 masm_->jmp(exit_label());
95}
96
97
Steve Blocka7e24c12009-10-30 11:49:00 +000098void CodeGenerator::SetFrame(VirtualFrame* new_frame,
99 RegisterFile* non_frame_registers) {
100 RegisterFile saved_counts;
101 if (has_valid_frame()) {
102 frame_->DetachFromCodeGenerator();
103 // The remaining register reference counts are the non-frame ones.
104 allocator_->SaveTo(&saved_counts);
105 }
106
107 if (new_frame != NULL) {
108 // Restore the non-frame register references that go with the new frame.
109 allocator_->RestoreFrom(non_frame_registers);
110 new_frame->AttachToCodeGenerator();
111 }
112
113 frame_ = new_frame;
114 saved_counts.CopyTo(non_frame_registers);
115}
116
117
118void CodeGenerator::DeleteFrame() {
119 if (has_valid_frame()) {
120 frame_->DetachFromCodeGenerator();
121 frame_ = NULL;
122 }
123}
124
125
Andrei Popescu31002712010-02-23 13:46:05 +0000126void CodeGenerator::MakeCodePrologue(CompilationInfo* info) {
Steve Blocka7e24c12009-10-30 11:49:00 +0000127#ifdef DEBUG
128 bool print_source = false;
129 bool print_ast = false;
Steve Block3ce2e202009-11-05 08:53:23 +0000130 bool print_json_ast = false;
Steve Blocka7e24c12009-10-30 11:49:00 +0000131 const char* ftype;
132
133 if (Bootstrapper::IsActive()) {
134 print_source = FLAG_print_builtin_source;
135 print_ast = FLAG_print_builtin_ast;
Steve Block3ce2e202009-11-05 08:53:23 +0000136 print_json_ast = FLAG_print_builtin_json_ast;
Steve Blocka7e24c12009-10-30 11:49:00 +0000137 ftype = "builtin";
138 } else {
139 print_source = FLAG_print_source;
140 print_ast = FLAG_print_ast;
Steve Block3ce2e202009-11-05 08:53:23 +0000141 print_json_ast = FLAG_print_json_ast;
Steve Blocka7e24c12009-10-30 11:49:00 +0000142 ftype = "user-defined";
143 }
144
145 if (FLAG_trace_codegen || print_source || print_ast) {
146 PrintF("*** Generate code for %s function: ", ftype);
Andrei Popescu31002712010-02-23 13:46:05 +0000147 info->function()->name()->ShortPrint();
Steve Blocka7e24c12009-10-30 11:49:00 +0000148 PrintF(" ***\n");
149 }
150
151 if (print_source) {
Andrei Popescu31002712010-02-23 13:46:05 +0000152 PrintF("--- Source from AST ---\n%s\n",
153 PrettyPrinter().PrintProgram(info->function()));
Steve Blocka7e24c12009-10-30 11:49:00 +0000154 }
155
156 if (print_ast) {
Andrei Popescu31002712010-02-23 13:46:05 +0000157 PrintF("--- AST ---\n%s\n",
158 AstPrinter().PrintProgram(info->function()));
Steve Block3ce2e202009-11-05 08:53:23 +0000159 }
160
161 if (print_json_ast) {
162 JsonAstBuilder builder;
Andrei Popescu31002712010-02-23 13:46:05 +0000163 PrintF("%s", builder.BuildProgram(info->function()));
Steve Blocka7e24c12009-10-30 11:49:00 +0000164 }
165#endif // DEBUG
Steve Block3ce2e202009-11-05 08:53:23 +0000166}
Steve Blocka7e24c12009-10-30 11:49:00 +0000167
Steve Blocka7e24c12009-10-30 11:49:00 +0000168
Andrei Popescu31002712010-02-23 13:46:05 +0000169Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm,
Steve Block3ce2e202009-11-05 08:53:23 +0000170 Code::Flags flags,
Andrei Popescu31002712010-02-23 13:46:05 +0000171 CompilationInfo* info) {
Steve Block3ce2e202009-11-05 08:53:23 +0000172 // Allocate and install the code.
Steve Blocka7e24c12009-10-30 11:49:00 +0000173 CodeDesc desc;
Steve Block3ce2e202009-11-05 08:53:23 +0000174 masm->GetCode(&desc);
Ben Murdoch3bec4d22010-07-22 14:51:16 +0100175 Handle<Code> code = Factory::NewCode(desc, flags, masm->CodeObject());
Steve Blocka7e24c12009-10-30 11:49:00 +0000176
Steve Blocka7e24c12009-10-30 11:49:00 +0000177#ifdef ENABLE_DISASSEMBLER
Steve Block3ce2e202009-11-05 08:53:23 +0000178 bool print_code = Bootstrapper::IsActive()
179 ? FLAG_print_builtin_code
180 : FLAG_print_code;
Steve Blocka7e24c12009-10-30 11:49:00 +0000181 if (print_code) {
182 // Print the source code if available.
Andrei Popescu31002712010-02-23 13:46:05 +0000183 Handle<Script> script = info->script();
184 FunctionLiteral* function = info->function();
Steve Blocka7e24c12009-10-30 11:49:00 +0000185 if (!script->IsUndefined() && !script->source()->IsUndefined()) {
186 PrintF("--- Raw source ---\n");
187 StringInputBuffer stream(String::cast(script->source()));
Andrei Popescu31002712010-02-23 13:46:05 +0000188 stream.Seek(function->start_position());
Steve Block3ce2e202009-11-05 08:53:23 +0000189 // fun->end_position() points to the last character in the stream. We
Steve Blocka7e24c12009-10-30 11:49:00 +0000190 // need to compensate by adding one to calculate the length.
Andrei Popescu31002712010-02-23 13:46:05 +0000191 int source_len =
192 function->end_position() - function->start_position() + 1;
Steve Blocka7e24c12009-10-30 11:49:00 +0000193 for (int i = 0; i < source_len; i++) {
194 if (stream.has_more()) PrintF("%c", stream.GetNext());
195 }
196 PrintF("\n\n");
197 }
198 PrintF("--- Code ---\n");
Andrei Popescu31002712010-02-23 13:46:05 +0000199 code->Disassemble(*function->name()->ToCString());
Steve Blocka7e24c12009-10-30 11:49:00 +0000200 }
201#endif // ENABLE_DISASSEMBLER
202
203 if (!code.is_null()) {
204 Counters::total_compiled_code_size.Increment(code->instruction_size());
205 }
Steve Blocka7e24c12009-10-30 11:49:00 +0000206 return code;
207}
208
209
Ben Murdochf87a2032010-10-22 12:50:53 +0100210// Generate the code. Compile the AST and assemble all the pieces into a
211// Code object.
212bool CodeGenerator::MakeCode(CompilationInfo* info) {
Andrei Popescu31002712010-02-23 13:46:05 +0000213 Handle<Script> script = info->script();
Leon Clarked91b9f72010-01-27 17:25:45 +0000214 if (!script->IsUndefined() && !script->source()->IsUndefined()) {
215 int len = String::cast(script->source())->length();
216 Counters::total_old_codegen_source_size.Increment(len);
217 }
Andrei Popescu31002712010-02-23 13:46:05 +0000218 MakeCodePrologue(info);
Steve Block3ce2e202009-11-05 08:53:23 +0000219 // Generate code.
220 const int kInitialBufferSize = 4 * KB;
Leon Clarke4515c472010-02-03 11:58:03 +0000221 MacroAssembler masm(NULL, kInitialBufferSize);
Andrei Popescu31002712010-02-23 13:46:05 +0000222 CodeGenerator cgen(&masm);
Steve Block3ce2e202009-11-05 08:53:23 +0000223 CodeGeneratorScope scope(&cgen);
Andrei Popescu402d9372010-02-26 13:31:12 +0000224 cgen.Generate(info);
Steve Block3ce2e202009-11-05 08:53:23 +0000225 if (cgen.HasStackOverflow()) {
226 ASSERT(!Top::has_pending_exception());
Ben Murdochf87a2032010-10-22 12:50:53 +0100227 return false;
Steve Block3ce2e202009-11-05 08:53:23 +0000228 }
229
Ben Murdochf87a2032010-10-22 12:50:53 +0100230 InLoopFlag in_loop = info->is_in_loop() ? IN_LOOP : NOT_IN_LOOP;
Steve Block3ce2e202009-11-05 08:53:23 +0000231 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION, in_loop);
Ben Murdochf87a2032010-10-22 12:50:53 +0100232 Handle<Code> code = MakeCodeEpilogue(cgen.masm(), flags, info);
233 info->SetCode(code); // May be an empty handle.
234 return !code.is_null();
Steve Block3ce2e202009-11-05 08:53:23 +0000235}
236
237
Steve Blocka7e24c12009-10-30 11:49:00 +0000238#ifdef ENABLE_LOGGING_AND_PROFILING
239
240bool CodeGenerator::ShouldGenerateLog(Expression* type) {
241 ASSERT(type != NULL);
Steve Block6ded16b2010-05-10 14:33:55 +0100242 if (!Logger::is_logging() && !CpuProfiler::is_profiling()) return false;
Steve Blocka7e24c12009-10-30 11:49:00 +0000243 Handle<String> name = Handle<String>::cast(type->AsLiteral()->handle());
244 if (FLAG_log_regexp) {
245 static Vector<const char> kRegexp = CStrVector("regexp");
246 if (name->IsEqualTo(kRegexp))
247 return true;
248 }
249 return false;
250}
251
252#endif
253
254
Steve Blocka7e24c12009-10-30 11:49:00 +0000255void CodeGenerator::ProcessDeclarations(ZoneList<Declaration*>* declarations) {
256 int length = declarations->length();
257 int globals = 0;
258 for (int i = 0; i < length; i++) {
259 Declaration* node = declarations->at(i);
260 Variable* var = node->proxy()->var();
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100261 Slot* slot = var->AsSlot();
Steve Blocka7e24c12009-10-30 11:49:00 +0000262
263 // If it was not possible to allocate the variable at compile
264 // time, we need to "declare" it at runtime to make sure it
265 // actually exists in the local context.
266 if ((slot != NULL && slot->type() == Slot::LOOKUP) || !var->is_global()) {
267 VisitDeclaration(node);
268 } else {
269 // Count global variables and functions for later processing
270 globals++;
271 }
272 }
273
274 // Return in case of no declared global functions or variables.
275 if (globals == 0) return;
276
277 // Compute array of global variable and function declarations.
278 Handle<FixedArray> array = Factory::NewFixedArray(2 * globals, TENURED);
279 for (int j = 0, i = 0; i < length; i++) {
280 Declaration* node = declarations->at(i);
281 Variable* var = node->proxy()->var();
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100282 Slot* slot = var->AsSlot();
Steve Blocka7e24c12009-10-30 11:49:00 +0000283
284 if ((slot != NULL && slot->type() == Slot::LOOKUP) || !var->is_global()) {
285 // Skip - already processed.
286 } else {
287 array->set(j++, *(var->name()));
288 if (node->fun() == NULL) {
289 if (var->mode() == Variable::CONST) {
290 // In case this is const property use the hole.
291 array->set_the_hole(j++);
292 } else {
293 array->set_undefined(j++);
294 }
295 } else {
Steve Block6ded16b2010-05-10 14:33:55 +0100296 Handle<SharedFunctionInfo> function =
Ben Murdochf87a2032010-10-22 12:50:53 +0100297 Compiler::BuildFunctionInfo(node->fun(), script());
Steve Blocka7e24c12009-10-30 11:49:00 +0000298 // Check for stack-overflow exception.
Ben Murdochf87a2032010-10-22 12:50:53 +0100299 if (function.is_null()) {
300 SetStackOverflow();
301 return;
302 }
Steve Blocka7e24c12009-10-30 11:49:00 +0000303 array->set(j++, *function);
304 }
305 }
306 }
307
308 // Invoke the platform-dependent code generator to do the actual
309 // declaration the global variables and functions.
310 DeclareGlobals(array);
311}
312
313
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100314void CodeGenerator::VisitIncrementOperation(IncrementOperation* expr) {
315 UNREACHABLE();
316}
317
318
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100319// Lookup table for code generators for special runtime calls which are
320// generated inline.
321#define INLINE_FUNCTION_GENERATOR_ADDRESS(Name, argc, ressize) \
322 &CodeGenerator::Generate##Name,
Steve Blocka7e24c12009-10-30 11:49:00 +0000323
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100324const CodeGenerator::InlineFunctionGenerator
325 CodeGenerator::kInlineFunctionGenerators[] = {
326 INLINE_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
327 INLINE_RUNTIME_FUNCTION_LIST(INLINE_FUNCTION_GENERATOR_ADDRESS)
Steve Blocka7e24c12009-10-30 11:49:00 +0000328};
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100329#undef INLINE_FUNCTION_GENERATOR_ADDRESS
Steve Blocka7e24c12009-10-30 11:49:00 +0000330
331
Steve Blocka7e24c12009-10-30 11:49:00 +0000332bool CodeGenerator::CheckForInlineRuntimeCall(CallRuntime* node) {
333 ZoneList<Expression*>* args = node->arguments();
334 Handle<String> name = node->name();
Kristian Monsen0d5e1162010-09-30 15:31:59 +0100335 Runtime::Function* function = node->function();
336 if (function != NULL && function->intrinsic_type == Runtime::INLINE) {
Ben Murdochf87a2032010-10-22 12:50:53 +0100337 int lookup_index = static_cast<int>(function->function_id) -
338 static_cast<int>(Runtime::kFirstInlineFunction);
339 ASSERT(lookup_index >= 0);
340 ASSERT(static_cast<size_t>(lookup_index) <
341 ARRAY_SIZE(kInlineFunctionGenerators));
342 InlineFunctionGenerator generator = kInlineFunctionGenerators[lookup_index];
343 (this->*generator)(args);
344 return true;
Steve Blocka7e24c12009-10-30 11:49:00 +0000345 }
346 return false;
347}
348
349
Steve Block3ce2e202009-11-05 08:53:23 +0000350// Simple condition analysis. ALWAYS_TRUE and ALWAYS_FALSE represent a
351// known result for the test expression, with no side effects.
352CodeGenerator::ConditionAnalysis CodeGenerator::AnalyzeCondition(
353 Expression* cond) {
354 if (cond == NULL) return ALWAYS_TRUE;
355
356 Literal* lit = cond->AsLiteral();
357 if (lit == NULL) return DONT_KNOW;
358
359 if (lit->IsTrue()) {
360 return ALWAYS_TRUE;
361 } else if (lit->IsFalse()) {
362 return ALWAYS_FALSE;
363 }
364
365 return DONT_KNOW;
366}
367
368
Ben Murdoch7f4d5bd2010-06-15 11:15:29 +0100369bool CodeGenerator::RecordPositions(MacroAssembler* masm,
370 int pos,
371 bool right_here) {
Steve Blocka7e24c12009-10-30 11:49:00 +0000372 if (pos != RelocInfo::kNoPosition) {
Teng-Hui Zhu3e5fa292010-11-09 16:16:48 -0800373 masm->positions_recorder()->RecordStatementPosition(pos);
374 masm->positions_recorder()->RecordPosition(pos);
Ben Murdoch7f4d5bd2010-06-15 11:15:29 +0100375 if (right_here) {
Teng-Hui Zhu3e5fa292010-11-09 16:16:48 -0800376 return masm->positions_recorder()->WriteRecordedPositions();
Ben Murdoch7f4d5bd2010-06-15 11:15:29 +0100377 }
Steve Blocka7e24c12009-10-30 11:49:00 +0000378 }
Ben Murdoch7f4d5bd2010-06-15 11:15:29 +0100379 return false;
Steve Blocka7e24c12009-10-30 11:49:00 +0000380}
381
382
383void CodeGenerator::CodeForFunctionPosition(FunctionLiteral* fun) {
Ben Murdoch7f4d5bd2010-06-15 11:15:29 +0100384 if (FLAG_debug_info) RecordPositions(masm(), fun->start_position(), false);
Steve Blocka7e24c12009-10-30 11:49:00 +0000385}
386
387
388void CodeGenerator::CodeForReturnPosition(FunctionLiteral* fun) {
Ben Murdochbb769b22010-08-11 14:56:33 +0100389 if (FLAG_debug_info) RecordPositions(masm(), fun->end_position() - 1, false);
Steve Blocka7e24c12009-10-30 11:49:00 +0000390}
391
392
393void CodeGenerator::CodeForStatementPosition(Statement* stmt) {
Ben Murdoch7f4d5bd2010-06-15 11:15:29 +0100394 if (FLAG_debug_info) RecordPositions(masm(), stmt->statement_pos(), false);
Steve Blocka7e24c12009-10-30 11:49:00 +0000395}
396
Ben Murdoch7f4d5bd2010-06-15 11:15:29 +0100397
Steve Blockd0582a62009-12-15 09:54:21 +0000398void CodeGenerator::CodeForDoWhileConditionPosition(DoWhileStatement* stmt) {
Ben Murdoch7f4d5bd2010-06-15 11:15:29 +0100399 if (FLAG_debug_info)
400 RecordPositions(masm(), stmt->condition_position(), false);
Steve Blockd0582a62009-12-15 09:54:21 +0000401}
Steve Blocka7e24c12009-10-30 11:49:00 +0000402
Ben Murdoch7f4d5bd2010-06-15 11:15:29 +0100403
Steve Blocka7e24c12009-10-30 11:49:00 +0000404void CodeGenerator::CodeForSourcePosition(int pos) {
405 if (FLAG_debug_info && pos != RelocInfo::kNoPosition) {
Teng-Hui Zhu3e5fa292010-11-09 16:16:48 -0800406 masm()->positions_recorder()->RecordPosition(pos);
Steve Blocka7e24c12009-10-30 11:49:00 +0000407 }
408}
409
410
Leon Clarkee46be812010-01-19 14:06:41 +0000411const char* GenericUnaryOpStub::GetName() {
412 switch (op_) {
413 case Token::SUB:
Leon Clarkeac952652010-07-15 11:15:24 +0100414 if (negative_zero_ == kStrictNegativeZero) {
415 return overwrite_ == UNARY_OVERWRITE
416 ? "GenericUnaryOpStub_SUB_Overwrite_Strict0"
417 : "GenericUnaryOpStub_SUB_Alloc_Strict0";
418 } else {
419 return overwrite_ == UNARY_OVERWRITE
420 ? "GenericUnaryOpStub_SUB_Overwrite_Ignore0"
421 : "GenericUnaryOpStub_SUB_Alloc_Ignore0";
422 }
Leon Clarkee46be812010-01-19 14:06:41 +0000423 case Token::BIT_NOT:
Leon Clarkeac952652010-07-15 11:15:24 +0100424 return overwrite_ == UNARY_OVERWRITE
Leon Clarkee46be812010-01-19 14:06:41 +0000425 ? "GenericUnaryOpStub_BIT_NOT_Overwrite"
426 : "GenericUnaryOpStub_BIT_NOT_Alloc";
427 default:
428 UNREACHABLE();
429 return "<unknown>";
430 }
431}
432
433
Steve Blocka7e24c12009-10-30 11:49:00 +0000434void ArgumentsAccessStub::Generate(MacroAssembler* masm) {
435 switch (type_) {
Steve Blocka7e24c12009-10-30 11:49:00 +0000436 case READ_ELEMENT: GenerateReadElement(masm); break;
437 case NEW_OBJECT: GenerateNewObject(masm); break;
438 }
439}
440
441
Leon Clarke4515c472010-02-03 11:58:03 +0000442int CEntryStub::MinorKey() {
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100443 ASSERT(result_size_ == 1 || result_size_ == 2);
Leon Clarke4515c472010-02-03 11:58:03 +0000444#ifdef _WIN64
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100445 return result_size_ == 1 ? 0 : 1;
Leon Clarke4515c472010-02-03 11:58:03 +0000446#else
Kristian Monsen80d68ea2010-09-08 11:05:35 +0100447 return 0;
Leon Clarke4515c472010-02-03 11:58:03 +0000448#endif
449}
450
451
Steve Blocka7e24c12009-10-30 11:49:00 +0000452} } // namespace v8::internal