From 6b70adc33054f8aee8c54d0f460458a9df11b8a5 Mon Sep 17 00:00:00 2001 From: Russell Brenner Date: Thu, 18 Nov 2010 17:33:13 -0800 Subject: Merge WebKit at r72274: Initial merge by git. Change-Id: Ie51f0b4a16da82942bd516dce59cfb79ebbe25fb --- JavaScriptCore/bytecompiler/BytecodeGenerator.cpp | 27 ++++++---- JavaScriptCore/bytecompiler/BytecodeGenerator.h | 20 +++---- JavaScriptCore/bytecompiler/NodesCodegen.cpp | 64 +++++++++-------------- 3 files changed, 50 insertions(+), 61 deletions(-) (limited to 'JavaScriptCore/bytecompiler') diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 7538314..1fa5aa4 100644 --- a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -443,7 +443,6 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debug emitOpcode(op_get_callee); instructions().append(func->index()); // Load prototype. - emitGetByIdExceptionInfo(op_create_this); emitGetById(funcProto.get(), func.get(), globalData()->propertyNames->prototype); emitOpcode(op_create_this); @@ -1158,6 +1157,12 @@ bool BytecodeGenerator::findScopedProperty(const Identifier& property, int& inde return true; } +void BytecodeGenerator::emitCheckHasInstance(RegisterID* base) +{ + emitOpcode(op_check_has_instance); + instructions().append(base->index()); +} + RegisterID* BytecodeGenerator::emitInstanceOf(RegisterID* dst, RegisterID* value, RegisterID* base, RegisterID* basePrototype) { emitOpcode(op_instanceof); @@ -2050,13 +2055,16 @@ RegisterID* BytecodeGenerator::emitCatch(RegisterID* targetRegister, Label* star return targetRegister; } -RegisterID* BytecodeGenerator::emitNewError(RegisterID* dst, bool isReferenceError, JSValue message) +void BytecodeGenerator::emitThrowReferenceError(const UString& message) { - emitOpcode(op_new_error); - instructions().append(dst->index()); - instructions().append(isReferenceError); - instructions().append(addConstantValue(message)->index()); - return dst; + emitOpcode(op_throw_reference_error); + instructions().append(addConstantValue(jsString(globalData(), message))->index()); +} + +void BytecodeGenerator::emitThrowSyntaxError(const UString& message) +{ + emitOpcode(op_throw_syntax_error); + instructions().append(addConstantValue(jsString(globalData(), message))->index()); } PassRefPtr